Post not yet marked as solved
Used the PreferredForwardBufferDuration, this also after 2 - 3 minutes unable to pause the video, its catching live if pause duration more than 2 -3 minutes.
Example:
[self.player.currentItem setPreferredForwardBufferDuration:60];
self.player.automaticallyWaitsToMinimizeStalling = YES;
self.player.currentItem.canUseNetworkResourcesForLiveStreamingWhilePaused = NO;
How to stop buffering the AV-Player during pause state
How to clear the AV-Player buffer during pause.
SeekToTime is not working properly for live channel, I want to seek just one/two sec back. With SeekToTime if av-player unable to seek to previous time line its catching the future position.
Manifest providing to av-player,
#EXT-X-VERSION:4
#EXT-X-TARGETDURATION:1
#EXT-X-MEDIA-SEQUENCE:1
#EXT-X-KEY:METHOD=AES-
http://ServerAddress/f1655359642.ts
#EXT-X-KEY:METHOD=AES-
http://ServerAddress/f1655359643.ts
#EXT-X-KEY:METHOD=AES-
#EXTINF:0.984,
http://ServerAddress/f1655359644.ts
Post not yet marked as solved
Anyone finding any issue with AVSpeechSynthesizer in Xcode 14.0 beta Simulator running iOS 16.0?
[AXTTSCommon] Unable to find voice service for identifier: com.apple.voice.compact.en-US.Ava, voice: TTSSpeechVoice[0x6000026d04e0]: Name: Ava Identifier: com.apple.voice.compact.en-US.Ava Footprint: 3 Language: en-US Gender: Female [default 0] [fallbackDefault: 0] Provider: (null), resource: TTSAXResource<0x600002cdc900> Name:Ava ID:com.apple.voice.compact.en-US.Ava Type:[4:2] Foot:3 Langs:[en-US] Installed:1
Seems it is not finding voice service provider?
Post not yet marked as solved
Hello,
My device is an iPad Pro 2nd generation. Model number MXDC2LL/A. iOS 16 build 20A5283p.
When creating an AVCaptureSession, isMultiTaskingCameraAccessSupported is returning false. Is this expected on this device? Is a newer device needed or is it an issue in this particular iOS 16 build?
Thanks
Post not yet marked as solved
AVAudioUnitTimePitch.latency is 0.09s on my debug devices.
It will have a little time delay during render audio using `AVAudioEngine.
I just want to change the pitch during playing audio.
So how can I avoid this this latency??
Post not yet marked as solved
At around the 5 min mark of "Discover advancements in iOS camera capture: Depth, focus, and multitasking", you state that TrueDepth delivers relative depth. This appears to contradict official documentation. In Capturing Photos with Depth, you state explicitly that TrueDepth camera measures depth directly with absolute accuracy. Why the change?
Post not yet marked as solved
We are using AVCaptureMetadataOutput to detect face and body rects. Face rect is shown in green and body rect is shown in blue. We would like to get body rect that encompasses human body, as shown in red box. This body rect is absolute in a sense that it will include hands, feet, arms etc.
Post not yet marked as solved
Continuity Camera is a way to stream raw video and metadata from iPhone to mac. Is it possible for an iPhone local recording app to use camera continuity to stream a preview from iPhone to mac?
Can camera continuity be made available on iPad, so that one can stream video/metadata to iPad screen (use case being a need to use better camera and user does not have a mac-book)
Post not yet marked as solved
2022-06-09 08:51:30.793789+0800 MyAppName[4651:447798] [aqme] MEMixerChannel.cpp:1629 client <AudioQueueObject@0x7fc09a04f400; [0]; play> got error 2003332927 while sending format information
I use .mp3
Post not yet marked as solved
Hi,
I migrate an audio project using AVAudioEngine from Objective-C to Swift.
All objects are the same but in Swift instead of Objective-C.
The application uses the microphone input and analyses it via a renderCallback process calling the FFT of the Accelerate framework.
The session has an important CPU usage:
- TheObjective-C version keeps the CPU usage at 8%
- The Swift version is on average at 20%.
I have isolated the code that originates the increase and it is due to a method analysing the returned samples in order to summarize them.
Parameters:
arrMagCount = 12
arrMag is an array of float containing the magnitude of the frequency range related to the index
samplesCount = 4096
samples is a pointer of a float array delivering the magnitude of each bins used
Result:
Each arrMag[index] is updated with the magnitude related to the range of frequency underlying the index
The Objective-C version calls a C process for the function
The Swift version was developped in swift since we cannot mix C code and Swift code in the same source
func arrMagFill(arrMagCount:Int, samplesCount:Int, samples:UnsafePointer<Double>, arrMag:UnsafeMutablePointer<Float>, maxFrequency:CGFloat) {
// Zeroes arrMag.
memset(arrMag, 0, arrMagCount)
for iBin in 0..<samplesCount {
for iLoop in 0..<arrMagCount {
if maxFrequency < g.FreqMetersRangeMaxValue[iLoop] {
arrMag[iLoop] = Float(samples[Int(iBin)])
break
}
}
}
}
When I use a C equivalent code via an Objective-C bridge Header, the CPU usage is back to [8..12] on average.
Is there a way in Swift to obtain directly the same performances ?
Post not yet marked as solved
I have a Unity project that plays sound even when silent mode is on. How do I stop that behavior and only play game audio when silent mode is off?
Post not yet marked as solved
Recently started receiving multiple AVErrorMediaServicesWereReset Error (11819) complains from our users
User's video doesn't start for some reason.
I have researched this issue but with no success, because i can't recreate the problem.
All i could find is that users experiencing error have in common is this:
its on DRM content only (we use FPS)
non-drm content plays normally.
restarting device doesn't help
different network doesn't help either
Both iOS app and Mobile web have this issue (probably something with device)
Deleting and redownloading the app doesn't help too.
Last iOS version too (or close to last)
Would be very grateful for any help! Thanks
Post not yet marked as solved
HI
In the App Store version, some users experienced no sound when playing local audio.
Looking at the logs, we found the following two main problems
1、readyToPlay to Play time exceeds 10s
2、avplayer the operation could not be completed
Anyone with relevant experience, please answer.
ThankYou!
Post not yet marked as solved
I am creating a fixed-focus camera app with the focus distance at infinity (or at least 30+ feet away).
When I set lensPosition to 1.0, the images were blurry.
Some tests letting autofocus do the job showed a lensPosition of about 0.808 for my wide and telephoto lenses and 0.84 for the ultra wide lens did the trick. (iPhone 13 Max)
Will the lensPosition to focus at infinity vary between devices and lenses on that device?
Is there a way to determine the appropriate lensPosition at run time?
Post not yet marked as solved
Hi,
for a project I need to implement a custom player, which needs to be able to load multiple AC3 files as tracks and mix them using a linear mixer according to gains delivered by another module. The mixing algorithm is quite simple and follows the following formula for three tracks
output value = gain 1 * input value 1 + gain 2 * input value 2 + gain 3 * input value 3
where gains are 0.33 when each of the tracks should be equally loud since the output value must not exceed 1.0.
For now I used AVFoundation with multiple AVPlayerNodes and AVAudioMixerNode(s). The issue is that I don't know how exactly the mixer works. So what I actually need is to write a custom mixer node or any other solution to achive the desired outcome. Is this actually possible using AVFoundation or do I need to use another framework ?
Thank you and best regards
Stefan
Post not yet marked as solved
I am creating AVCaptureDeviceInput using an audio driver (user land driver) which has 6 channels (5.1 channels). The audio driver captures system's audio.
I am creating AVCaptureAudioDataOutput using stream description of 2 channels.
Now I add AVCaptureDeviceInput and AVCaptureAudioDataOutput to AVCaptureSession and write sample buffers of AVCaptureAudioDataOutput to a file.
I play a 5.1 file in my system and my above sample app writes it to a file.
The recorded audio will have 2 channels as per steam description.
the recorded file will have all 5.1 channels recorded in a stereo file (Eg: Left Front and Rear in Left; Right Front & Rear in Right).
My query is: Who handles the mixing here?
Thank you.
Post not yet marked as solved
I am trying to mix the audio from 2 different hardware audio devices together in real-time and record the results. Does anybody have any idea how to do this? This is on macOS.
Things I have tried and why it didn't work:
Adding 2 audio AVCaptureDevices to an AVCaptureMovieFileOutput or AVAssetWriter. This results in a file that has 2 audio tracks. This doesn't work for me for various reasons. Sure I can mix them together with an AVAssetExportSession, but it needs to be real-time.
Programmatically creating an aggregate device and recording that as an AVCaptureDevice. This "sort of" works, but it always results in a recording with strange channel issues. For example, if I combine a 1 channel mic and a 2 channel device, I get a recording with 3 channel audio (L R C). If I make an aggregate out of 2 stereo devices, I get a recording with quadraphonic sound(L R Ls Rs), which won't even play back on some players. If I always force it to stereo, all stereo tracks get turned to mono for some reason.
Programmatically creating an aggregate device and trying to use it in an AVAudioEngine. I've had multiple problems with this, but the main one is that when the aggregate device is an input node, it only reports the format of its main device, and no sub-devices. And I can't force it to be 3 or 4 channels without errors.
Use an AVCaptureSession to output the sample buffers of both devices, then convert and put those samples into their own AVPlayerNodes. Then mix those AVPlayerNodes into an AVAudioEngine mixer. This actually works, but the resulting audio lags so far behind real-time, that it is unusable. If I record a webcam video along with the audio, the lip-sync is off by like half a second.
I really need help with this. If anybody has a way to do this, let me know.
Some caveats that have also been tripping me up:
The hardware devices that need to be recorded might not be the default input device for the system. The MBP built in mic might be the default device, but I need to record 2 other devices and disclose the built in mic.
The devices usually don't have the same audio format. I might be mixing an lpcm mono int16 interleaved with a lpcm stereo float32 non-interleaved.
It absolutely has to be real-time and 1 single audio track.
It shouldn't be this hard, right?
I have an application that captures an image with a depth map and calibration data and exports it so then I can work with it in python.
The depth map and calibration data are all converted to Float32 and is stored as a json file. The image is stored as a jpeg file.
The depth map shape is (480, 640) and the image shape is (3024, 4032, 3)
My goal is to be able to create a point cloud from this data.
I’m new to working with data provided by apples TrueDepth camera and would like some clarity to what preprocessing steps I need to perform before creating the point cloud.
Here they are below:
1) since the 640x480 is a scaled version of the 12MP image, means that I can scale down the intrinsics as well. So I should scale [fx, fy, cx, cy] by the scaling factor 640/4032 = 0.15873?
2) after scaling comes taking care of the distortion, which I should use lensDistortionLookupTable to distort both the image and depth map?
Are the above two questions correct or am I missing something??
Post not yet marked as solved
I've noticed that my Catalyst app uses around 65% CPU when capturing from the camera, even when everything else is idle. Disabling camera capture drops the CPU usage to 0 (middle of graph in screenshot). I profiled using Instruments, and found that the most heavy stack trace involved face tracking (see attached screenshot), even though no metadata output was added for the camera. Is this a bug in AVFoundation?
Post not yet marked as solved
When I create an aggregate device with 2 hardware inputs and 1 output and I try to use it with AVAudioEngine, it fails to start. I get the error IsFormatSampleRateAndChannelCountValid(outputHWFormat)
If I use an aggregate device with only 1 input/output, it works.
The problem seems to stem from how aggregate devices handle channels. If I add a 2 channel device and a 1 channel device to the aggregate as inputs, I get an aggregate device with 3 channels.
However, if I try and get the format of the input node, it only reports the format of the first device in the aggregate. So instead of saying the device has 3 channels, it will say it has 1 or 2 depending on which device is the main device.
I've tried creating my own AVAudioFormat using channel layouts such as kAudioChannelLayoutTag_AAC_3_0, but this only works in very specific cases and is very unreliable.
Can anybody help with this? It is driving me crazy.
The main problem I am trying to solve is to combine/mix 2 hardware (or virtual hardware via HAL) audio devices in real-time for recording. An aggregate device alone doesn't work (see https://developer.apple.com/forums/thread/703258)
Thanks for any help, you would save my day/week.
Post not yet marked as solved
I am going to be using AVAudioPlayer to play sound effects and looping music in a game. I haven’t been able to find any recent discussion of what format to use (given I almost certainly need to compress it). https://developer.apple.com/library/archive/documentation/AudioVideo/Conceptual/MultimediaPG/UsingAudio/UsingAudio.html#//apple_ref/doc/uid/TP40009767-CH2-SW28 is deprecated (and talks about “AAC” but afconvert -hf shows at least 7 different formats that can be saved in a CAF).
Has that guide been updated? Does hardware vs software playback still matter in iOS 9+?
I’m not really worried about performance in terms of impacting frame rate.