Note that there are some explanatory texts on larger screens.

plurals
  1. POStereo playback gets converted to mono (on iPad only) even when using stereo headphones
    primarykey
    data
    text
    <p>I'm developing an audio processing app using core audio that records sounds through the headset mic and plays them back trough the headphones.</p> <p>I've added a feature for the balance, i.e. to shift the playback onto one ear only. </p> <p>This works perfectly on the iPods and iPhones I've tested it on. But not on the iPad. On the iPad the location of the sound doesn't change at all.</p> <p>This is the code used to render the audio output:</p> <pre><code>static OSStatus renderInput(void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList *ioData) { // Get a pointer to the dataBuffer of the AudioBufferList AudioBuffer firstBuffer = ioData-&gt;mBuffers[0]; AudioSampleType *outA = (AudioSampleType *)firstBuffer.mData; int numChannels = firstBuffer.mNumberChannels; NSLog(@"numChannels = %d, left = %d, right = %d", numChannels, leftBalVolume, rightBalVolume); // Loop through the callback buffer, generating samples for (UInt32 i = 0; i &lt; inNumberFrames * numChannels; i += numChannels) { int outSignal = getFilteredSampleData(sampleDataTail); outA[i] = (outSignal * leftBalVolume) / 32768; if (numChannels &gt; 1) { outA[i + 1] = (outSignal * rightBalVolume) / 32768; } sampleDataTail = (sampleDataTail + 1) % sampleDataLen; } return noErr; } </code></pre> <p>The output from the NSLog is as follows:</p> <pre><code>numChannels = 2, left = 16557, right = 32767 </code></pre> <p>...telling me that it is basically working in stereo mode, I should hear the audio slightly to the right. But even if I put it 100% to the right, I still hear the audio in the middle, same volume on both earphones.</p> <p>Obviously, the iPad 2 mixes the audiosignal down to mono and then plays that on both earphones. I thought that it might have to do with the fact that the iPad has only one speaker and thus would usually mix to mono... but why does it do that, even when a stereo headphone is connected?</p> <p>Any help is greatly appreciated! </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload