Configuring RemoteIO Audio unit to play and record iLBC on the iPhone
Configuring RemoteIO Audio unit to play and record iLBC on the iPhone
- Subject: Configuring RemoteIO Audio unit to play and record iLBC on the iPhone
- From: Fabrice Ferino <email@hidden>
- Date: Mon, 13 Jun 2011 16:27:26 -0700
- Acceptlanguage: en-US
- Thread-topic: Configuring RemoteIO Audio unit to play and record iLBC on the iPhone
The documentation ("CoreAudioOverview.pdf of 2008-11-03, page 45 Table 2-3
and 2-5 and "Audio Unit Hosting Guide for iOS", section "Using the I/O
Units") states that it should be possible to play and record sound in the
iLBC format but we get errors when we try to setup an I/O AudioUnit
(RemoteIO or VoiceProcessingIO) with that format. Is this expected or are
we doing something wrong? We are using the same code successfully for the
(simpler) G.711 formats. Here are the details:
memset( &m_streamDesc, 0, sizeof(m_streamDesc));
m_streamDesc.mSampleRate = 8000.0;
m_streamDesc.mFormatID = kAudioFormatiLBC;
m_streamDesc.mFormatFlags = 0;
m_streamDesc.mChannelsPerFrame = 1;
m_streamDesc.mFramesPerPacket = 240;
m_streamDesc.mBytesPerPacket = 50;
size = sizeof(m_streamDesc);
err = AudioFormatGetProperty(kAudioFormatProperty_FormatInfo,
0, NULL, &size, &m_streamDesc);
if (0 != (err = AudioUnitSetProperty(m_audioUnit,
kAudioUnitProperty_StreamFormat,
kAudioUnitScope_Output, 1,
&m_streamDesc,
sizeof(m_streamDesc))))
{
goto exit; // succeeds with VoiceProcessingIO, fails with RemoteIO
}
if (0 != (err = AudioUnitSetProperty(m_audioUnit,
kAudioUnitProperty_StreamFormat,
kAudioUnitScope_Input, 0,
&m_streamDesc,
sizeof(m_streamDesc))))
{
goto exit; // fails with either VoiceProcessingIO or RemoteIO
}
The err returned by AudioUnitSetProperty is
kAudioUnitErr_FormatNotSupported.
If we try to set the Stream Format for the Output element of the Input
scope of the VoiceProcessingIO AudioUnit to a "plain vanilla" LPCM format
( since the error happens only on that scope), then we get another error
when calling AudioUnitInitialize with a message in the Debugger console:
2011-06-13 15:50:54.063 iLBCTest[94:6103] 15:50:54.059 <0x488b000>
AURemoteIO::Initialize failed: '!dat' (enable 3, outf< 2 ch, 8000 Hz,
'lpcm' (0x0000000C) 16-bit little-endian signed integer> inf< 1 ch, 8000
Hz, 'ilbc' (0x00000000) 0 bits/channel, 50 bytes/packet, 240
frames/packet, 0 bytes/frame>)
Is there something wrong in the code above? Or is it the expected
behavior?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden