• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
SpeakHere example produces different number of samples
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  1. The number of samples is around 44,100 on Simulator
  2. The number of samples is around 22,000 on iPhone
  3. 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

  • Follow-Ups:
    • Re: SpeakHere example produces different number of samples
      • From: William Stewart <email@hidden>
  • Prev by Date: Re: Play from Audio CD
  • Next by Date: Re: Using soft synth device with AUGraph
  • Previous by thread: Re: Displaying an AudioUnitCarbonView in a Cocoa application? [solved]
  • Next by thread: Re: SpeakHere example produces different number of samples
  • Index(es):
    • Date
    • Thread