Updated examples and fixed bugs with AudioPlayer example for iOS and OSX

This commit is contained in:
Syed Haris Ali
2013-12-18 18:20:25 -08:00
parent 44ebf5ba99
commit 63adace349
12 changed files with 88 additions and 98 deletions
@@ -33,13 +33,16 @@
@property (nonatomic,weak) IBOutlet EZAudioPlotGL *audioPlot;
#pragma mark - UI Extras
@property (nonatomic,weak) IBOutlet UISlider *framePositionSlider;
/**
A label to display the current file path with the waveform shown
*/
@property (nonatomic,weak) IBOutlet UILabel *filePathLabel;
/**
A slider to indicate the current frame position in the audio file
*/
@property (nonatomic,weak) IBOutlet UISlider *framePositionSlider;
/**
A BOOL indicating whether or not we've reached the end of the file
*/
@@ -139,6 +139,10 @@
self.framePositionSlider.maximumValue = (float)self.audioFile.totalFrames;
// Plot the whole waveform
// Plot the whole waveform
self.audioPlot.plotType = EZPlotTypeBuffer;
self.audioPlot.shouldFill = YES;
self.audioPlot.shouldMirror = YES;
[self.audioFile getWaveformDataWithCompletionBlock:^(float *waveformData, UInt32 length) {
[self.audioPlot updateBuffer:waveformData withBufferSize:length];
}];
@@ -191,7 +195,7 @@ withNumberOfChannels:(UInt32)numberOfChannels {
// Reached the end of the file on the last read
if( eof ){
free(bufferList);
[EZAudio freeBufferList:bufferList];
[self.audioFile seekToFrame:0];
return nil;
}