Browse Source

Added an assertion to catch unusual audio buffer behaviour on iOS.

tags/2021-05-28
jules 11 years ago
parent
commit
ee565c32c8
1 changed files with 6 additions and 3 deletions
  1. +6
    -3
      modules/juce_audio_devices/native/juce_ios_Audio.cpp

+ 6
- 3
modules/juce_audio_devices/native/juce_ios_Audio.cpp View File

@@ -120,7 +120,7 @@ public:
AudioSessionSetProperty (kAudioSessionProperty_PreferredHardwareIOBufferDuration, sizeof (bufferDuration), &bufferDuration);
actualBufferSize = preferredBufferSize;
prepareFloatBuffers();
prepareFloatBuffers (actualBufferSize);
isRunning = true;
routingChanged (nullptr); // creates and starts the AU
@@ -209,11 +209,11 @@ private:
float* outputChannels[3];
bool monoInputChannelNumber, monoOutputChannelNumber;
void prepareFloatBuffers()
void prepareFloatBuffers (int bufferSize)
{
if (numInputChannels + numOutputChannels > 0)
{
floatData.setSize (numInputChannels + numOutputChannels, actualBufferSize);
floatData.setSize (numInputChannels + numOutputChannels, bufferSize);
zeromem (inputChannels, sizeof (inputChannels));
zeromem (outputChannels, sizeof (outputChannels));
@@ -238,6 +238,9 @@ private:
if (callback != nullptr)
{
// This shouldn't ever get triggered, but please let me know if it does!
jassert (numFrames <= floatData.getNumSamples());
if (audioInputIsAvailable && numInputChannels > 0)
{
short* shortData = (short*) data->mBuffers[0].mData;


Loading…
Cancel
Save