SpeakHere example produces different number of samples
SpeakHere example produces different number of samples
- Subject: SpeakHere example produces different number of samples
- From: On Lee <email@hidden>
- Date: Fri, 11 Jun 2010 00:52:48 +0000
- Importance: Normal
I am looking at the SpeakHere example and added the following:
// Overriding the output audio route UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_Speaker; AudioSessionSetProperty(kAudioSessionProperty_OverrideAudioRoute, sizeof (audioRouteOverride), &audioRouteOverride); assert(status == noErr); // Changing the default output route. The new output route remains in effect unless you change the audio session category. This option is available starting in iPhone OS 3.1. UInt32 doChangeDefaultRoute = 1; status = AudioSessionSetProperty(kAudioSessionProperty_OverrideCategoryDefaultToSpeaker, sizeof(doChangeDefaultRoute), &doChangeDefaultRoute); assert(status == noErr); // Enable Bluetooth. See audioRouteOverride & doChangeDefaultRoute above // http://developer.apple.com/iphone/library/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/Cookbook/Cookbook.html#//apple_ref/doc/uid/TP40007875-CH6-SW2 UInt32 allowBluetoothInput = 1; status = AudioSessionSetProperty(kAudioSessionProperty_OverrideCategoryEnableBluetoothInput, sizeof(allowBluetoothInput), &allowBluetoothInput); assert(status == noErr);
Also,
void AQRecorder::handleInputBufferCallback(void *aqData, ... ...
if (inNumPackets > 0) { NSLog(@"Number of samples = %d", inBuffer->mAudioDataByteSize/2); // print out the number of sample
status = AudioFileWritePackets(aqr->mAudioFile, FALSE, inBuffer->mAudioDataByteSize, inPacketDesc, aqr->mCurrentPacket, &inNumPackets, inBuffer->mAudioData); assert(status == noErr); aqr->mCurrentPacket += inNumPackets; }
...
Notice the "NSLog(@"Number of samples = %d", inBuffer->mAudioDataByteSize/2); //
print out the number of sample" statement above.
I am using iPhone SDK 3.1.3.
I got the following results
- The number of samples is around 44,100 on Simulator
- The number of samples is around 22,000 on iPhone
- The number of samples is around 4,000 on iPhone using Jawbone Bluetooth
I am new on this. Why do they produce different number of samples?
Thanks in advance for your help.
Best, -- On Lee
The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with Hotmail. Get busy.
|
_______________________________________________
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