Updated examples and fixed bugs with AudioPlayer example for iOS and OSX
This commit is contained in:
+5
-2
@@ -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
|
||||
*/
|
||||
|
||||
+5
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user