-
Notifications
You must be signed in to change notification settings - Fork 508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS AVAudioPcmBuffer.Format.StreamDescription returns garbage values #7890
Comments
I confirmed that the audio data was correct. It is possible to extract it with the following code, should someone need it: private void OnBusTap(AVAudioPcmBuffer buffer, AVAudioTime when)
{
AudioBuffer audioBuffer = buffer.AudioBufferList[0];
byte[] data = new byte[audioBuffer.DataByteSize];
Marshal.Copy(audioBuffer.Data, data, 0, audioBuffer.DataByteSize);
// do something with data. However, note that you are not on the main thread.
}
|
I forgot to mention, but the format in AVAudioFormat recordingFormat = audioEngine.InputNode.GetBusOutputFormat(0); is also valid. |
Here is an obj-c test app: And a full C# app: I didn't bother printing every single field but the first N suggest this might be a real bug:
|
FYI @dalexsoto |
any news? 2 years old bug |
It looks like this has been fixed actually (it's a duplicate of #8892). |
Description
In order to record audio, one can use the following code
However the values contained in AudioStreamBasicDescription are complete garbage.
It also has some interesting characteristics:
Some sample output:
Steps to Reproduce
Expected Behavior
AudioStreamBasicDescription contains valid data.
Actual Behavior
AudioStreamBasicDescription contains garbage data.
Basic Information
Workaround
No workaround available for the moment. However using an AVCaptureSession like below provide correct values in DidOutputSampleBuffer.
The text was updated successfully, but these errors were encountered: