HydrogenAudio

Lossy Audio Compression => Opus => Topic started by: deffo on 2022-04-15 12:05:16

Title: Decode opus stream generated in iOS AVAudioSession formatID = kAudioFormatOpus
Post by: deffo on 2022-04-15 12:05:16
Hi everyone,

This is a tech / coding question, hope it's OK to post here. And apologies if my terminology is off the mark from an audio perspective  ;D

I'm working on a voice app wanting to record straight to an Opus stream.

On the iOS side, I'm working in Objective C and I'm using an AVAudioSession recorder with formatID set to  kAudioFormatOpus.

This is all working well and emitting a stream of audio data.

My problem is when I receive the audio stream in the backend, I find I'm unable to reliably decode the Opus stream using ffmpeg. (I wish to decode to PCM.)

My question would be, is anyone familiar with the format of Opus audio stream that is generated by iOS AudioSession recorder under audio format kAudioFormatOpus ? Is anyone able to suggest proven conversion techniques? (e.g. some ffmpeg commands), or else hook me up with some links to format specs so I can figure out what is going on here ?

I have looked all over the internet, but I'm unable to find any useful spec info that corresponds to the stream that AVAudioSession recorder is outputting. I have seen a few posts which say Apple have not fully complied with the Opus spec.

Apologies if this is way off topic. Thanks all  :D