Converting GSM encoded audio to linear PCM in iOS
I have been working on converting GSM6.10 to linear PCM in iOS for the past few months and just can't make it work. I would appreciate any advice!
I am receiving streaming data from a Windows program. The data is received in packets with several different packet types. Some packet types contain display data. One packet type contains audio data. The audio data is in Microsoft WAV format, 8000 samples per second, 8 bits per sample, monaural, compressed using GSM6.10. I don't have control over the Windows program so I can't change how the data is streamed.
My iOS program parses the streamed data into the different packet types. The display data is used to update the display and works fine. The problem I am having is with the audio data.
When my iOS program connects to the stream there is no canonical WAVE descriptors. I am basically connecting mid stream.
At first I was trying to use Audio File Stream Services, passing the parsed audio packets as input. No luck. I worked and worked and could not resolve the typ? issue.
I then tried Audio Queue Services and was successful in getting the audio to play. However, the latency involved using Audio Queue Services made the display and the audio out of sync (by almost 4 seconds).
I am now working on using an Audio Graph. I have tried using the converter unit and remote IO unit together. I have also tried using just the remote IO unit. In both cases it appears that I can't specify GSM6.10 as input. I am using the same AudioStreamBasicDescription that I used in the working Audio Queue solution. However, when I try to init the graph I get an error.
Does the converter unit and/or remote I/O unit convert GSM6.10 to linear PCM? It is not clear in the documentation if these units convert compressed format to linear PCM or just convert linear PCM formats (different sample rates for example).
Is there a better way to convert GSM6.10 to linear PCM? Maybe a Core Audio converter that I can call when parsing the audio packets?
Suggestions are greatly appreciated!
链接地址: http://www.djcxy.com/p/67020.html上一篇: 在iOS上录音