alexbw / novocaine

Painless high-performance audio on iOS and Mac OS X

Home Page:http://alexbw.github.com/novocaine/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does default sample rate cause resampling and setting buffer size for minimum latency?

ilkercankaya opened this issue · comments

Hello, Firstly HUGE thanks for the library. Working with AudioUnit RemoteIO is a real pain!

I am wondering two things:
1 - I see that you set the sample rate here with the following code:

    // TODO: check this works on iOS!
    _inputFormat.mSampleRate = 44100.0;
    _outputFormat.mSampleRate = 44100.0;

AFAIK newest iphones have a default sample rate of 48kHz, is there a resampling done to ensure 44100kHz gets resampled to 48kHz? Is this done by Apple automatically?

2 - Can I set the buffer size with AudioSessionSetProperty? Normally with AudioUnits you can ask for a preferred buffer size with the following code:

float aBufferLength = 0.005; // In seconds
AudioSessionSetProperty(kAudioSessionProperty_PreferredHardwareIOBufferDuration, 
                        sizeof(aBufferLength), &aBufferLength);

Does this also affect novocaine's internal buffer size?

1 is Mentioned here, so I am closing this issue :)
#134