Obj-C EZAudioPlot with pan 1.0

140 Views Asked by At

I have a problem with updateBuffer method when I'm setting pan to right earphone (1.0f). Sound is playing correctly but plot is not updating: **buffer = (float) 0 for every element.

Code is simple:

- (void)audioPlayer:(EZAudioPlayer *)audioPlayer
             playedAudio:(float **)buffer
          withBufferSize:(UInt32)bufferSize
    withNumberOfChannels:(UInt32)numberOfChannels
             inAudioFile:(EZAudioFile *)audioFile {

  __weak typeof(self) weakSelf = self;
  [weakSelf.plot updateBuffer:buffer[0] withBufferSize:bufferSize];
}

its working for left earphone -> pan = -1.0f or both -> 0.0f but not for right one.

1

There are 1 best solutions below

0
On

(float **)buffer is a 2d array and so I am assuming buffer[0] is left channel while buffer[1] is right channel. Try putting in buffer[1] instead.