Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c4fb3e27e7 |
+25
-16
@@ -25,24 +25,25 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import <AudioToolbox/AudioToolbox.h>
|
||||
|
||||
#pragma mark - 3rd Party Utilties
|
||||
#import "AEFloatConverter.h"
|
||||
#import "TPCircularBuffer.h"
|
||||
|
||||
#pragma mark - Core Components
|
||||
#import "EZAudioFile.h"
|
||||
#import "EZMicrophone.h"
|
||||
#import "EZOutput.h"
|
||||
#import "EZRecorder.h"
|
||||
|
||||
#pragma mark - Extended Components
|
||||
#import "EZAudioPlayer.h"
|
||||
|
||||
#pragma mark - Interface Components
|
||||
#import "EZPlot.h"
|
||||
#import "EZAudioPlot.h"
|
||||
#import "EZAudioPlotGL.h"
|
||||
#import "EZAudioPlotGLKViewController.h"
|
||||
//#pragma mark - Core Components
|
||||
//#import "EZAudioFile.h"
|
||||
//#import "EZMicrophone.h"
|
||||
//#import "EZOutput.h"
|
||||
//#import "EZRecorder.h"
|
||||
//
|
||||
//#pragma mark - Extended Components
|
||||
//#import "EZAudioPlayer.h"
|
||||
//
|
||||
//#pragma mark - Interface Components
|
||||
//#import "EZPlot.h"
|
||||
//#import "EZAudioPlot.h"
|
||||
//#import "EZAudioPlotGL.h"
|
||||
//#import "EZAudioPlotGLKViewController.h"
|
||||
|
||||
/**
|
||||
EZAudio is a simple, intuitive framework for iOS and OSX. The goal of EZAudio was to provide a modular, cross-platform framework to simplify performing everyday audio operations like getting microphone input, creating audio waveforms, recording/playing audio files, etc. The visualization tools like the EZAudioPlot and EZAudioPlotGL were created to plug right into the framework's various components and provide highly optimized drawing routines that work in harmony with audio callback loops. All components retain the same namespace whether you're on an iOS device or a Mac computer so an EZAudioPlot understands it will subclass an UIView on an iOS device or an NSView on a Mac.
|
||||
@@ -95,13 +96,21 @@
|
||||
+(AudioStreamBasicDescription)iLBCFormatWithSampleRate:(float)sampleRate;
|
||||
|
||||
/**
|
||||
Checks an AudioStreamBasicDescription to check for an interleaved flag (samples are
|
||||
Checks an AudioStreamBasicDescription for an interleaved flag, meaning samples are
|
||||
stored in one buffer one after another instead of two (or n channels) parallel buffers
|
||||
@param asbd A valid AudioStreamBasicDescription
|
||||
@return A BOOL indicating whether or not the AudioStreamBasicDescription is interleaved
|
||||
*/
|
||||
+ (BOOL) isInterleaved:(AudioStreamBasicDescription)asbd;
|
||||
|
||||
/**
|
||||
Checks an AudioStreamBasicDescription to see if it is linear PCM, which is an
|
||||
uncompressed, non-variable bit rate type format
|
||||
@param asbd A valid AudioStreamBasicDescription
|
||||
@return A BOOL indicating whether or not the AudioStreamBasicDescription is linear PCM
|
||||
*/
|
||||
+ (BOOL) isLinearPCM:(AudioStreamBasicDescription)asbd;
|
||||
|
||||
/**
|
||||
|
||||
@param channels The desired number of channels
|
||||
|
||||
+7
-2
@@ -39,7 +39,7 @@
|
||||
{
|
||||
audioBufferList->mBuffers[i].mNumberChannels = channels;
|
||||
audioBufferList->mBuffers[i].mDataByteSize = channels * outputBufferSize;
|
||||
audioBufferList->mBuffers[i].mData = (float*)malloc(channels * sizeof(float) *outputBufferSize);
|
||||
audioBufferList->mBuffers[i].mData = (float*)malloc(channels * sizeof(float) * outputBufferSize);
|
||||
}
|
||||
return audioBufferList;
|
||||
}
|
||||
@@ -105,6 +105,11 @@
|
||||
return !(asbd.mFormatFlags & kAudioFormatFlagIsNonInterleaved);
|
||||
}
|
||||
|
||||
+ (BOOL)isLinearPCM:(AudioStreamBasicDescription)asbd
|
||||
{
|
||||
return asbd.mFormatID == kAudioFormatLinearPCM;
|
||||
}
|
||||
|
||||
+(AudioStreamBasicDescription)M4AFormatWithNumberOfChannels:(UInt32)channels
|
||||
sampleRate:(float)sampleRate
|
||||
{
|
||||
@@ -324,7 +329,7 @@
|
||||
//
|
||||
if( *scrollHistory == NULL ){
|
||||
// Create the history buffer
|
||||
*scrollHistory = (float*)calloc(kEZAudioPlotMaxHistoryBufferLength,floatByteSize);
|
||||
*scrollHistory = (float*)calloc(1024,floatByteSize);
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#import "EZAudioPlotGL.h"
|
||||
|
||||
#import "EZAudio.h"
|
||||
#import "EZAudioPlot.h"
|
||||
|
||||
#if TARGET_OS_IPHONE
|
||||
#import "EZAudioPlotGLKViewController.h"
|
||||
|
||||
+12
-12
@@ -99,10 +99,10 @@ static OSStatus inputCallback(void *inRefCon,
|
||||
if( microphone.microphoneDelegate ){
|
||||
// THIS IS NOT OCCURING ON THE MAIN THREAD
|
||||
if( [microphone.microphoneDelegate respondsToSelector:@selector(microphone:hasAudioReceived:withBufferSize:withNumberOfChannels:)] ){
|
||||
AEFloatConverterToFloat(microphone->converter,
|
||||
microphone->microphoneInputBuffer,
|
||||
microphone->floatBuffers,
|
||||
inNumberFrames);
|
||||
// AEFloatConverterToFloat(microphone->converter,
|
||||
// microphone->microphoneInputBuffer,
|
||||
// microphone->floatBuffers,
|
||||
// inNumberFrames);
|
||||
[microphone.microphoneDelegate microphone:microphone
|
||||
hasAudioReceived:microphone->floatBuffers
|
||||
withBufferSize:inNumberFrames
|
||||
@@ -556,14 +556,14 @@ static OSStatus inputCallback(void *inRefCon,
|
||||
|
||||
#pragma mark - Float Converter Initialization
|
||||
-(void)_configureFloatConverterWithFrameSize:(UInt32)bufferFrameSize {
|
||||
UInt32 bufferSizeBytes = bufferFrameSize * streamFormat.mBytesPerFrame;
|
||||
converter = [[AEFloatConverter alloc] initWithSourceFormat:streamFormat];
|
||||
floatBuffers = (float**)malloc(sizeof(float*)*streamFormat.mChannelsPerFrame);
|
||||
assert(floatBuffers);
|
||||
for ( int i=0; i<streamFormat.mChannelsPerFrame; i++ ) {
|
||||
floatBuffers[i] = (float*)malloc(bufferSizeBytes);
|
||||
assert(floatBuffers[i]);
|
||||
}
|
||||
// UInt32 bufferSizeBytes = bufferFrameSize * streamFormat.mBytesPerFrame;
|
||||
// converter = [[AEFloatConverter alloc] initWithSourceFormat:streamFormat];
|
||||
// floatBuffers = (float**)malloc(sizeof(float*)*streamFormat.mChannelsPerFrame);
|
||||
// assert(floatBuffers);
|
||||
// for ( int i=0; i<streamFormat.mChannelsPerFrame; i++ ) {
|
||||
// floatBuffers[i] = (float*)malloc(bufferSizeBytes);
|
||||
// assert(floatBuffers[i]);
|
||||
// }
|
||||
}
|
||||
|
||||
#pragma mark - Input Callback Initialization
|
||||
|
||||
BIN
Binary file not shown.
+18
-12
@@ -7,6 +7,9 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
668E4F821A905DAF00F4B814 /* EZAudioConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 668E4F811A905DAF00F4B814 /* EZAudioConverter.m */; };
|
||||
668E4F851A905F8700F4B814 /* EZAudioWaveformData.m in Sources */ = {isa = PBXBuildFile; fileRef = 668E4F841A905F8700F4B814 /* EZAudioWaveformData.m */; };
|
||||
668E4F881A90607500F4B814 /* EZMicrophone.m in Sources */ = {isa = PBXBuildFile; fileRef = 668E4F871A90607500F4B814 /* EZMicrophone.m */; };
|
||||
94056EFB185BD83400EB94BA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 94056EFA185BD83400EB94BA /* Cocoa.framework */; };
|
||||
94056F05185BD83400EB94BA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 94056F03185BD83400EB94BA /* InfoPlist.strings */; };
|
||||
94056F07185BD83400EB94BA /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 94056F06185BD83400EB94BA /* main.m */; };
|
||||
@@ -27,13 +30,11 @@
|
||||
94056F66185BDB4700EB94BA /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 94056F63185BDB4700EB94BA /* AudioUnit.framework */; };
|
||||
94056F67185BDB4700EB94BA /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 94056F64185BDB4700EB94BA /* CoreAudio.framework */; };
|
||||
9417A6D51865928C00D9D37B /* simple-drum-beat.wav in Resources */ = {isa = PBXBuildFile; fileRef = 9417A6D41865928C00D9D37B /* simple-drum-beat.wav */; };
|
||||
9417A73E1867DD3400D9D37B /* AEFloatConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7261867DD3400D9D37B /* AEFloatConverter.m */; };
|
||||
9417A73F1867DD3400D9D37B /* EZAudio.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7281867DD3400D9D37B /* EZAudio.m */; };
|
||||
9417A7401867DD3400D9D37B /* EZAudioFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A72A1867DD3400D9D37B /* EZAudioFile.m */; };
|
||||
9417A7411867DD3400D9D37B /* EZAudioPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A72C1867DD3400D9D37B /* EZAudioPlot.m */; };
|
||||
9417A7421867DD3400D9D37B /* EZAudioPlotGL.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A72E1867DD3400D9D37B /* EZAudioPlotGL.m */; };
|
||||
9417A7431867DD3400D9D37B /* EZAudioPlotGLKViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7301867DD3400D9D37B /* EZAudioPlotGLKViewController.m */; };
|
||||
9417A7441867DD3400D9D37B /* EZMicrophone.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7321867DD3400D9D37B /* EZMicrophone.m */; };
|
||||
9417A7451867DD3400D9D37B /* EZOutput.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7341867DD3400D9D37B /* EZOutput.m */; };
|
||||
9417A7461867DD3400D9D37B /* EZPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7361867DD3400D9D37B /* EZPlot.m */; };
|
||||
9417A7471867DD3400D9D37B /* EZRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7381867DD3400D9D37B /* EZRecorder.m */; };
|
||||
@@ -53,6 +54,12 @@
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
668E4F801A905DAF00F4B814 /* EZAudioConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioConverter.h; sourceTree = "<group>"; };
|
||||
668E4F811A905DAF00F4B814 /* EZAudioConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioConverter.m; sourceTree = "<group>"; };
|
||||
668E4F831A905F8700F4B814 /* EZAudioWaveformData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioWaveformData.h; sourceTree = "<group>"; };
|
||||
668E4F841A905F8700F4B814 /* EZAudioWaveformData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioWaveformData.m; sourceTree = "<group>"; };
|
||||
668E4F861A90607500F4B814 /* EZMicrophone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZMicrophone.h; sourceTree = "<group>"; };
|
||||
668E4F871A90607500F4B814 /* EZMicrophone.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZMicrophone.m; sourceTree = "<group>"; };
|
||||
94056EF7185BD83400EB94BA /* EZAudioPlayFileExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = EZAudioPlayFileExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
94056EFA185BD83400EB94BA /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
|
||||
94056EFD185BD83400EB94BA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
|
||||
@@ -82,8 +89,6 @@
|
||||
94056F63185BDB4700EB94BA /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = System/Library/Frameworks/AudioUnit.framework; sourceTree = SDKROOT; };
|
||||
94056F64185BDB4700EB94BA /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = System/Library/Frameworks/CoreAudio.framework; sourceTree = SDKROOT; };
|
||||
9417A6D41865928C00D9D37B /* simple-drum-beat.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = "simple-drum-beat.wav"; path = "../../../simple-drum-beat.wav"; sourceTree = "<group>"; };
|
||||
9417A7251867DD3400D9D37B /* AEFloatConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AEFloatConverter.h; sourceTree = "<group>"; };
|
||||
9417A7261867DD3400D9D37B /* AEFloatConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AEFloatConverter.m; sourceTree = "<group>"; };
|
||||
9417A7271867DD3400D9D37B /* EZAudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudio.h; sourceTree = "<group>"; };
|
||||
9417A7281867DD3400D9D37B /* EZAudio.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudio.m; sourceTree = "<group>"; };
|
||||
9417A7291867DD3400D9D37B /* EZAudioFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFile.h; sourceTree = "<group>"; };
|
||||
@@ -94,8 +99,6 @@
|
||||
9417A72E1867DD3400D9D37B /* EZAudioPlotGL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGL.m; sourceTree = "<group>"; };
|
||||
9417A72F1867DD3400D9D37B /* EZAudioPlotGLKViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGLKViewController.h; sourceTree = "<group>"; };
|
||||
9417A7301867DD3400D9D37B /* EZAudioPlotGLKViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGLKViewController.m; sourceTree = "<group>"; };
|
||||
9417A7311867DD3400D9D37B /* EZMicrophone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZMicrophone.h; sourceTree = "<group>"; };
|
||||
9417A7321867DD3400D9D37B /* EZMicrophone.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZMicrophone.m; sourceTree = "<group>"; };
|
||||
9417A7331867DD3400D9D37B /* EZOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZOutput.h; sourceTree = "<group>"; };
|
||||
9417A7341867DD3400D9D37B /* EZOutput.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZOutput.m; sourceTree = "<group>"; };
|
||||
9417A7351867DD3400D9D37B /* EZPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZPlot.h; sourceTree = "<group>"; };
|
||||
@@ -230,10 +233,12 @@
|
||||
9417A7241867DD3400D9D37B /* EZAudio */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
9417A7251867DD3400D9D37B /* AEFloatConverter.h */,
|
||||
9417A7261867DD3400D9D37B /* AEFloatConverter.m */,
|
||||
9417A7271867DD3400D9D37B /* EZAudio.h */,
|
||||
9417A7281867DD3400D9D37B /* EZAudio.m */,
|
||||
668E4F801A905DAF00F4B814 /* EZAudioConverter.h */,
|
||||
668E4F811A905DAF00F4B814 /* EZAudioConverter.m */,
|
||||
668E4F831A905F8700F4B814 /* EZAudioWaveformData.h */,
|
||||
668E4F841A905F8700F4B814 /* EZAudioWaveformData.m */,
|
||||
9417A7291867DD3400D9D37B /* EZAudioFile.h */,
|
||||
9417A72A1867DD3400D9D37B /* EZAudioFile.m */,
|
||||
9417A72B1867DD3400D9D37B /* EZAudioPlot.h */,
|
||||
@@ -242,8 +247,8 @@
|
||||
9417A72E1867DD3400D9D37B /* EZAudioPlotGL.m */,
|
||||
9417A72F1867DD3400D9D37B /* EZAudioPlotGLKViewController.h */,
|
||||
9417A7301867DD3400D9D37B /* EZAudioPlotGLKViewController.m */,
|
||||
9417A7311867DD3400D9D37B /* EZMicrophone.h */,
|
||||
9417A7321867DD3400D9D37B /* EZMicrophone.m */,
|
||||
668E4F861A90607500F4B814 /* EZMicrophone.h */,
|
||||
668E4F871A90607500F4B814 /* EZMicrophone.m */,
|
||||
9417A7331867DD3400D9D37B /* EZOutput.h */,
|
||||
9417A7341867DD3400D9D37B /* EZOutput.m */,
|
||||
9417A7351867DD3400D9D37B /* EZPlot.h */,
|
||||
@@ -371,16 +376,17 @@
|
||||
files = (
|
||||
9417A7481867DD3400D9D37B /* TPCircularBuffer.c in Sources */,
|
||||
9417A7451867DD3400D9D37B /* EZOutput.m in Sources */,
|
||||
668E4F821A905DAF00F4B814 /* EZAudioConverter.m in Sources */,
|
||||
9417A7431867DD3400D9D37B /* EZAudioPlotGLKViewController.m in Sources */,
|
||||
94056F31185BD86D00EB94BA /* PlayFileViewController.m in Sources */,
|
||||
9417A73E1867DD3400D9D37B /* AEFloatConverter.m in Sources */,
|
||||
94056F0E185BD83400EB94BA /* AppDelegate.m in Sources */,
|
||||
9417A7411867DD3400D9D37B /* EZAudioPlot.m in Sources */,
|
||||
9417A7401867DD3400D9D37B /* EZAudioFile.m in Sources */,
|
||||
668E4F881A90607500F4B814 /* EZMicrophone.m in Sources */,
|
||||
668E4F851A905F8700F4B814 /* EZAudioWaveformData.m in Sources */,
|
||||
9417A7421867DD3400D9D37B /* EZAudioPlotGL.m in Sources */,
|
||||
94056F07185BD83400EB94BA /* main.m in Sources */,
|
||||
9417A7461867DD3400D9D37B /* EZPlot.m in Sources */,
|
||||
9417A7441867DD3400D9D37B /* EZMicrophone.m in Sources */,
|
||||
9417A7471867DD3400D9D37B /* EZRecorder.m in Sources */,
|
||||
9417A73F1867DD3400D9D37B /* EZAudio.m in Sources */,
|
||||
);
|
||||
|
||||
+5
-1
@@ -27,6 +27,9 @@
|
||||
|
||||
// Import EZAudio header
|
||||
#import "EZAudio.h"
|
||||
#import "EZAudioFile.h"
|
||||
#import "EZOutput.h"
|
||||
#import "EZAudioPlot.h"
|
||||
|
||||
/**
|
||||
Here's the default audio file included with the example
|
||||
@@ -47,7 +50,8 @@
|
||||
/**
|
||||
The CoreGraphics based audio plot
|
||||
*/
|
||||
@property (nonatomic,weak) IBOutlet EZAudioPlotGL *audioPlot;
|
||||
@property (nonatomic,weak) IBOutlet EZAudioPlot *audioPlotLeft;
|
||||
@property (nonatomic,weak) IBOutlet EZAudioPlot *audioPlotRight;
|
||||
|
||||
#pragma mark - UI Extras
|
||||
/**
|
||||
|
||||
+52
-37
@@ -32,7 +32,6 @@
|
||||
|
||||
@implementation PlayFileViewController
|
||||
@synthesize audioFile;
|
||||
@synthesize audioPlot;
|
||||
@synthesize eof = _eof;
|
||||
@synthesize framePositionSlider;
|
||||
|
||||
@@ -72,15 +71,20 @@
|
||||
Customizing the audio plot's look
|
||||
*/
|
||||
// Background color
|
||||
self.audioPlot.backgroundColor = [NSColor colorWithCalibratedRed: 0.175 green: 0.151 blue: 0.137 alpha: 1];
|
||||
self.audioPlotLeft.backgroundColor = [NSColor colorWithCalibratedRed:0.1 green:0.3 blue:0.2 alpha:1.0];
|
||||
self.audioPlotRight.backgroundColor = [NSColor colorWithCalibratedRed:0.1 green:0.3 blue:0.2 alpha:1.0];
|
||||
// Waveform color
|
||||
self.audioPlot.color = [NSColor colorWithCalibratedRed: 1.000 green: 1.000 blue: 1.000 alpha: 1];
|
||||
self.audioPlotLeft.color = [NSColor colorWithCalibratedRed: 1.000 green: 1.000 blue: 1.000 alpha: 1];
|
||||
self.audioPlotRight.color = [NSColor colorWithCalibratedRed: 1.000 green: 1.000 blue: 1.000 alpha: 1];
|
||||
// Plot type
|
||||
self.audioPlot.plotType = EZPlotTypeBuffer;
|
||||
self.audioPlotLeft.plotType = EZPlotTypeBuffer;
|
||||
self.audioPlotRight.plotType = EZPlotTypeBuffer;
|
||||
// Fill
|
||||
self.audioPlot.shouldFill = YES;
|
||||
self.audioPlotLeft.shouldFill = YES;
|
||||
self.audioPlotRight.shouldFill = YES;
|
||||
// Mirror
|
||||
self.audioPlot.shouldMirror = YES;
|
||||
self.audioPlotLeft.shouldMirror = YES;
|
||||
self.audioPlotRight.shouldMirror = YES;
|
||||
|
||||
/*
|
||||
Try opening the sample file
|
||||
@@ -129,10 +133,6 @@
|
||||
if( self.eof ){
|
||||
[self.audioFile seekToFrame:0];
|
||||
}
|
||||
if( self.audioPlot.plotType == EZPlotTypeBuffer &&
|
||||
self.audioPlot.shouldFill == YES ){
|
||||
self.audioPlot.plotType = EZPlotTypeRolling;
|
||||
}
|
||||
[EZOutput sharedOutput].outputDataSource = self;
|
||||
[[EZOutput sharedOutput] startPlayback];
|
||||
}
|
||||
@@ -152,11 +152,11 @@
|
||||
*/
|
||||
-(void)drawBufferPlot {
|
||||
// Change the plot type to the buffer plot
|
||||
self.audioPlot.plotType = EZPlotTypeBuffer;
|
||||
self.audioPlotLeft.plotType = EZPlotTypeBuffer;
|
||||
// Don't fill
|
||||
self.audioPlot.shouldFill = NO;
|
||||
self.audioPlotLeft.shouldFill = NO;
|
||||
// Don't mirror over the x-axis
|
||||
self.audioPlot.shouldMirror = NO;
|
||||
self.audioPlotLeft.shouldMirror = NO;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -164,11 +164,11 @@
|
||||
*/
|
||||
-(void)drawRollingPlot {
|
||||
// Change the plot type to the rolling plot
|
||||
self.audioPlot.plotType = EZPlotTypeRolling;
|
||||
self.audioPlotLeft.plotType = EZPlotTypeRolling;
|
||||
// Fill the waveform
|
||||
self.audioPlot.shouldFill = YES;
|
||||
self.audioPlotLeft.shouldFill = YES;
|
||||
// Mirror over the x-axis
|
||||
self.audioPlot.shouldMirror = YES;
|
||||
self.audioPlotLeft.shouldMirror = YES;
|
||||
}
|
||||
|
||||
-(void)openFileWithFilePathURL:(NSURL*)filePathURL {
|
||||
@@ -179,7 +179,7 @@
|
||||
AudioStreamBasicDescription asbd;
|
||||
self.audioFile = [EZAudioFile audioFileWithURL:filePathURL
|
||||
delegate:self
|
||||
permission:EZAudioFilePermissionReadWrite
|
||||
permission:EZAudioFilePermissionRead
|
||||
fileFormat:asbd];
|
||||
[[EZOutput sharedOutput] setAudioStreamBasicDescription:self.audioFile.clientFormat];
|
||||
|
||||
@@ -196,30 +196,45 @@
|
||||
self.sampleRateSlider.floatValue = self.audioFile.clientFormat.mSampleRate;
|
||||
|
||||
// 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.shouldFill = YES;
|
||||
self.audioPlot.shouldMirror = YES;
|
||||
[self.audioPlot updateBuffer:waveformData withBufferSize:length];
|
||||
self.audioPlotLeft.plotType = EZPlotTypeBuffer;
|
||||
self.audioPlotLeft.shouldFill = YES;
|
||||
self.audioPlotLeft.shouldMirror = YES;
|
||||
self.audioPlotRight.plotType = EZPlotTypeBuffer;
|
||||
self.audioPlotRight.shouldFill = YES;
|
||||
self.audioPlotRight.shouldMirror = YES;
|
||||
[self.audioFile getWaveformDataWithCompletionBlock:^(EZAudioWaveformData *data) {
|
||||
self.audioPlotLeft.shouldFill = YES;
|
||||
self.audioPlotLeft.shouldMirror = YES;
|
||||
self.audioPlotRight.shouldFill = YES;
|
||||
self.audioPlotRight.shouldMirror = YES;
|
||||
if (data.numberOfChannels > 1)
|
||||
{
|
||||
[self.audioPlotLeft updateBuffer:[data bufferForChannel:0] withBufferSize:data.bufferSize];
|
||||
[self.audioPlotRight updateBuffer:[data bufferForChannel:1] withBufferSize:data.bufferSize];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self.audioPlotLeft updateBuffer:[data bufferForChannel:0] withBufferSize:data.bufferSize];
|
||||
}
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - EZAudioFileDelegate
|
||||
-(void)audioFile:(EZAudioFile *)audioFile readAudio:(float **)buffer withBufferSize:(UInt32)bufferSize withNumberOfChannels:(UInt32)numberOfChannels {
|
||||
if( [EZOutput sharedOutput].isPlaying ){
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if( self.audioPlot.plotType == EZPlotTypeBuffer &&
|
||||
self.audioPlot.shouldFill == YES &&
|
||||
self.audioPlot.shouldMirror == YES ){
|
||||
self.audioPlot.shouldFill = NO;
|
||||
self.audioPlot.shouldMirror = NO;
|
||||
}
|
||||
[self.audioPlot updateBuffer:buffer[0] withBufferSize:bufferSize];
|
||||
});
|
||||
}
|
||||
-(void)audioFile:(EZAudioFile *)audioFile
|
||||
readAudio:(float **)buffer
|
||||
withBufferSize:(UInt32)bufferSize
|
||||
withNumberOfChannels:(UInt32)numberOfChannels {
|
||||
// if( [EZOutput sharedOutput].isPlaying ){
|
||||
// dispatch_async(dispatch_get_main_queue(), ^{
|
||||
// if( self.audioPlotLeft.plotType == EZPlotTypeBuffer &&
|
||||
// self.audioPlotLeft.shouldFill == YES &&
|
||||
// self.audioPlotLeft.shouldMirror == YES ){
|
||||
// self.audioPlotLeft.shouldFill = NO;
|
||||
// self.audioPlotLeft.shouldMirror = NO;
|
||||
// }
|
||||
// [self.audioPlotLeft updateBuffer:buffer[0] withBufferSize:bufferSize];
|
||||
// });
|
||||
// }
|
||||
}
|
||||
|
||||
-(void)audioFile:(EZAudioFile *)audioFile
|
||||
|
||||
+51
-41
@@ -1,13 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6250" systemVersion="14A389" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6254" systemVersion="14C109" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<deployment version="1070" identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6250"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6254"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="PlayFileViewController">
|
||||
<connections>
|
||||
<outlet property="audioPlot" destination="Lz1-Gs-1lD" id="V5w-yH-ZVR"/>
|
||||
<outlet property="audioPlotLeft" destination="aHI-vj-Ccv" id="Pwl-P4-MyY"/>
|
||||
<outlet property="audioPlotRight" destination="Lz1-Gs-1lD" id="GKN-Pb-Ejy"/>
|
||||
<outlet property="filePathLabel" destination="0eT-7c-7fJ" id="IGv-mA-5Hw"/>
|
||||
<outlet property="framePositionSlider" destination="CFP-v0-TzQ" id="3oy-Xn-4JK"/>
|
||||
<outlet property="playButton" destination="OQp-Lr-dlS" id="K5R-Qg-7DY"/>
|
||||
@@ -19,18 +20,11 @@
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<customView id="Xpo-HP-Ost">
|
||||
<rect key="frame" x="0.0" y="0.0" width="480" height="272"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="480" height="421"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<subviews>
|
||||
<customView misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Lz1-Gs-1lD" customClass="EZAudioPlotGL">
|
||||
<rect key="frame" x="0.0" y="0.0" width="480" height="148"/>
|
||||
</customView>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="2Ma-jj-U3z">
|
||||
<rect key="frame" x="14" y="224" width="125" height="32"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="21" id="Lm5-0d-A72"/>
|
||||
<constraint firstAttribute="width" constant="113" id="Tij-5V-y1Q"/>
|
||||
</constraints>
|
||||
<rect key="frame" x="14" y="373" width="125" height="32"/>
|
||||
<buttonCell key="cell" type="push" title="Choose File..." bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="KLq-bf-Xkh">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
@@ -40,7 +34,7 @@
|
||||
</connections>
|
||||
</button>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="0eT-7c-7fJ">
|
||||
<rect key="frame" x="141" y="235" width="38" height="17"/>
|
||||
<rect key="frame" x="141" y="384" width="38" height="17"/>
|
||||
<textFieldCell key="cell" lineBreakMode="truncatingMiddle" sendsActionOnEndEditing="YES" title="Label" id="vXQ-HF-vLX">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -48,11 +42,7 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="OQp-Lr-dlS">
|
||||
<rect key="frame" x="14" y="191" width="125" height="32"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="21" id="geC-A9-48j"/>
|
||||
<constraint firstAttribute="width" constant="113" id="lc3-4H-QK6"/>
|
||||
</constraints>
|
||||
<rect key="frame" x="14" y="340" width="125" height="32"/>
|
||||
<buttonCell key="cell" type="push" title="Play" alternateTitle="Pause" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="Z2A-7U-sb6">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
@@ -61,8 +51,11 @@
|
||||
<action selector="play:" target="-2" id="y83-JF-y4e"/>
|
||||
</connections>
|
||||
</button>
|
||||
<segmentedControl verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="bZW-tA-C61">
|
||||
<rect key="frame" x="333" y="196" width="129" height="24"/>
|
||||
<segmentedControl verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="bZW-tA-C61">
|
||||
<rect key="frame" x="333" y="345" width="129" height="24"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="125" id="3Yc-x7-gJk"/>
|
||||
</constraints>
|
||||
<segmentedCell key="cell" borderStyle="border" alignment="left" style="rounded" trackingMode="selectOne" id="8U1-ER-vPJ">
|
||||
<font key="font" metaFont="system"/>
|
||||
<segments>
|
||||
@@ -74,39 +67,56 @@
|
||||
<action selector="changePlotType:" target="-2" id="alU-Rf-22L"/>
|
||||
</connections>
|
||||
</segmentedControl>
|
||||
<slider verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="CFP-v0-TzQ">
|
||||
<rect key="frame" x="18" y="159" width="444" height="20"/>
|
||||
<sliderCell key="cell" alignment="left" maxValue="100" doubleValue="9.3380614657210401" tickMarkPosition="above" sliderType="linear" id="gPc-pN-dmP"/>
|
||||
<slider verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="CFP-v0-TzQ">
|
||||
<rect key="frame" x="18" y="308" width="444" height="20"/>
|
||||
<sliderCell key="cell" continuous="YES" alignment="left" maxValue="100" doubleValue="9.3380614657210401" tickMarkPosition="above" sliderType="linear" id="gPc-pN-dmP"/>
|
||||
<connections>
|
||||
<action selector="seekToFrame:" target="-2" id="iVY-so-6X2"/>
|
||||
</connections>
|
||||
</slider>
|
||||
<slider verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="rRH-oS-VV3">
|
||||
<rect key="frame" x="141" y="199" width="96" height="20"/>
|
||||
<slider verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="rRH-oS-VV3">
|
||||
<rect key="frame" x="141" y="348" width="96" height="20"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="92" id="Ul6-1Z-zf6"/>
|
||||
</constraints>
|
||||
<sliderCell key="cell" state="on" alignment="left" minValue="8000" maxValue="88200" doubleValue="44100" tickMarkPosition="above" sliderType="linear" id="xbX-Ce-da5"/>
|
||||
<connections>
|
||||
<action selector="changeOutputSamplingFrequency:" target="-2" id="yWM-Ei-ztA"/>
|
||||
</connections>
|
||||
</slider>
|
||||
<customView translatesAutoresizingMaskIntoConstraints="NO" id="aHI-vj-Ccv" customClass="EZAudioPlot">
|
||||
<rect key="frame" x="0.0" y="148" width="480" height="148"/>
|
||||
</customView>
|
||||
<customView translatesAutoresizingMaskIntoConstraints="NO" id="Lz1-Gs-1lD" customClass="EZAudioPlot">
|
||||
<rect key="frame" x="0.0" y="0.0" width="480" height="148"/>
|
||||
</customView>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="CFP-v0-TzQ" firstAttribute="top" secondItem="OQp-Lr-dlS" secondAttribute="bottom" constant="20" id="6uf-rh-zEf"/>
|
||||
<constraint firstItem="0eT-7c-7fJ" firstAttribute="leading" secondItem="2Ma-jj-U3z" secondAttribute="trailing" constant="10" id="AcA-Rv-Lwl"/>
|
||||
<constraint firstItem="Lz1-Gs-1lD" firstAttribute="top" secondItem="CFP-v0-TzQ" secondAttribute="bottom" constant="13" id="JjU-ri-rxV"/>
|
||||
<constraint firstItem="0eT-7c-7fJ" firstAttribute="top" secondItem="Xpo-HP-Ost" secondAttribute="top" constant="20" id="T86-Jj-i0N"/>
|
||||
<constraint firstAttribute="bottom" secondItem="Lz1-Gs-1lD" secondAttribute="bottom" id="U2b-77-5uo"/>
|
||||
<constraint firstAttribute="trailing" secondItem="bZW-tA-C61" secondAttribute="trailing" constant="20" id="UGO-OL-Dmk"/>
|
||||
<constraint firstAttribute="trailing" secondItem="CFP-v0-TzQ" secondAttribute="trailing" constant="20" id="UpE-fD-Skp"/>
|
||||
<constraint firstItem="2Ma-jj-U3z" firstAttribute="top" secondItem="Xpo-HP-Ost" secondAttribute="top" constant="20" id="a1a-7J-lzc"/>
|
||||
<constraint firstItem="Lz1-Gs-1lD" firstAttribute="leading" secondItem="Xpo-HP-Ost" secondAttribute="leading" id="bZz-am-fqe"/>
|
||||
<constraint firstItem="2Ma-jj-U3z" firstAttribute="leading" secondItem="Xpo-HP-Ost" secondAttribute="leading" constant="20" id="dc1-KX-H5W"/>
|
||||
<constraint firstItem="OQp-Lr-dlS" firstAttribute="leading" secondItem="Xpo-HP-Ost" secondAttribute="leading" constant="20" id="g5e-2M-sHn"/>
|
||||
<constraint firstAttribute="trailing" secondItem="Lz1-Gs-1lD" secondAttribute="trailing" id="jDC-Iz-9c4"/>
|
||||
<constraint firstItem="bZW-tA-C61" firstAttribute="top" secondItem="0eT-7c-7fJ" secondAttribute="bottom" constant="16" id="ll5-1d-SaQ"/>
|
||||
<constraint firstItem="CFP-v0-TzQ" firstAttribute="leading" secondItem="Xpo-HP-Ost" secondAttribute="leading" constant="20" id="qhq-Io-tdF"/>
|
||||
<constraint firstItem="Lz1-Gs-1lD" firstAttribute="leading" secondItem="Xpo-HP-Ost" secondAttribute="leading" id="xtr-M9-Uot"/>
|
||||
<constraint firstItem="OQp-Lr-dlS" firstAttribute="top" secondItem="2Ma-jj-U3z" secondAttribute="bottom" constant="12" id="yGn-40-QqT"/>
|
||||
<constraint firstItem="CFP-v0-TzQ" firstAttribute="top" secondItem="OQp-Lr-dlS" secondAttribute="bottom" constant="21" id="2Xm-ZL-QU7"/>
|
||||
<constraint firstItem="rRH-oS-VV3" firstAttribute="leading" secondItem="0eT-7c-7fJ" secondAttribute="leading" id="3CU-am-fxR"/>
|
||||
<constraint firstItem="2Ma-jj-U3z" firstAttribute="leading" secondItem="Xpo-HP-Ost" secondAttribute="leading" constant="20" symbolic="YES" id="5ch-hJ-6Kp"/>
|
||||
<constraint firstItem="CFP-v0-TzQ" firstAttribute="trailing" secondItem="bZW-tA-C61" secondAttribute="trailing" id="7rr-w2-gvA"/>
|
||||
<constraint firstAttribute="trailing" secondItem="bZW-tA-C61" secondAttribute="trailing" constant="20" symbolic="YES" id="A17-rX-9Sa"/>
|
||||
<constraint firstItem="OQp-Lr-dlS" firstAttribute="top" secondItem="2Ma-jj-U3z" secondAttribute="bottom" constant="12" symbolic="YES" id="Fpt-Cg-5Ur"/>
|
||||
<constraint firstItem="OQp-Lr-dlS" firstAttribute="trailing" secondItem="2Ma-jj-U3z" secondAttribute="trailing" id="GoP-Jj-F0w"/>
|
||||
<constraint firstItem="Lz1-Gs-1lD" firstAttribute="top" secondItem="aHI-vj-Ccv" secondAttribute="bottom" id="Izh-a4-03r"/>
|
||||
<constraint firstItem="2Ma-jj-U3z" firstAttribute="top" secondItem="Xpo-HP-Ost" secondAttribute="top" constant="20" symbolic="YES" id="KHJ-an-Hqi"/>
|
||||
<constraint firstItem="0eT-7c-7fJ" firstAttribute="top" secondItem="2Ma-jj-U3z" secondAttribute="top" id="NAh-en-Pw9"/>
|
||||
<constraint firstItem="Lz1-Gs-1lD" firstAttribute="leading" secondItem="Xpo-HP-Ost" secondAttribute="leading" id="P2a-D3-NNl"/>
|
||||
<constraint firstItem="0eT-7c-7fJ" firstAttribute="leading" secondItem="2Ma-jj-U3z" secondAttribute="trailing" constant="10" id="PBC-BN-wJn"/>
|
||||
<constraint firstItem="aHI-vj-Ccv" firstAttribute="height" secondItem="Lz1-Gs-1lD" secondAttribute="height" id="RkJ-OA-oUM"/>
|
||||
<constraint firstItem="OQp-Lr-dlS" firstAttribute="leading" secondItem="2Ma-jj-U3z" secondAttribute="leading" id="YaB-GO-JhC"/>
|
||||
<constraint firstItem="Lz1-Gs-1lD" firstAttribute="trailing" secondItem="aHI-vj-Ccv" secondAttribute="trailing" id="Z3I-LF-Cja"/>
|
||||
<constraint firstItem="CFP-v0-TzQ" firstAttribute="centerX" secondItem="aHI-vj-Ccv" secondAttribute="centerX" id="Zdn-mM-g9p"/>
|
||||
<constraint firstItem="Lz1-Gs-1lD" firstAttribute="leading" secondItem="aHI-vj-Ccv" secondAttribute="leading" id="cTW-4H-R0G"/>
|
||||
<constraint firstItem="bZW-tA-C61" firstAttribute="top" secondItem="OQp-Lr-dlS" secondAttribute="top" id="jls-iH-yCV"/>
|
||||
<constraint firstItem="rRH-oS-VV3" firstAttribute="baseline" secondItem="OQp-Lr-dlS" secondAttribute="baseline" id="mHm-mA-sbt"/>
|
||||
<constraint firstItem="Lz1-Gs-1lD" firstAttribute="top" secondItem="Xpo-HP-Ost" secondAttribute="top" constant="273" id="oy9-te-LMx"/>
|
||||
<constraint firstAttribute="bottom" secondItem="Lz1-Gs-1lD" secondAttribute="bottom" id="sl1-b2-YvQ"/>
|
||||
<constraint firstItem="OQp-Lr-dlS" firstAttribute="leading" secondItem="CFP-v0-TzQ" secondAttribute="leading" id="tLV-2q-F9W"/>
|
||||
<constraint firstItem="aHI-vj-Ccv" firstAttribute="top" secondItem="CFP-v0-TzQ" secondAttribute="bottom" constant="14" id="z81-ib-E9q"/>
|
||||
</constraints>
|
||||
<point key="canvasLocation" x="241" y="331.5"/>
|
||||
</customView>
|
||||
</objects>
|
||||
</document>
|
||||
|
||||
+3
-2
@@ -110,8 +110,9 @@
|
||||
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];
|
||||
[self.audioFile getWaveformDataWithCompletionBlock:^(EZAudioWaveformData *waveformData) {
|
||||
[self.audioPlot updateBuffer:[waveformData bufferForChannel:1]
|
||||
withBufferSize:waveformData.bufferSize];
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
+5
-5
@@ -10,29 +10,29 @@
|
||||
<string>EZAudioExamplesiOS</string>
|
||||
<key>IDESourceControlProjectOriginsDictionary</key>
|
||||
<dict>
|
||||
<key>F77EC8D9-F815-4829-9274-5DA08EA98D6B</key>
|
||||
<key>9D6FF97A89F512CD81EAE1A971A1D2EB03E03F7C</key>
|
||||
<string>https://github.com/syedhali/EZAudio.git</string>
|
||||
</dict>
|
||||
<key>IDESourceControlProjectPath</key>
|
||||
<string>EZAudioExamples/iOS/EZAudioExamplesiOS.xcworkspace</string>
|
||||
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
|
||||
<dict>
|
||||
<key>F77EC8D9-F815-4829-9274-5DA08EA98D6B</key>
|
||||
<key>9D6FF97A89F512CD81EAE1A971A1D2EB03E03F7C</key>
|
||||
<string>../../..</string>
|
||||
</dict>
|
||||
<key>IDESourceControlProjectURL</key>
|
||||
<string>https://github.com/syedhali/EZAudio.git</string>
|
||||
<key>IDESourceControlProjectVersion</key>
|
||||
<integer>110</integer>
|
||||
<integer>111</integer>
|
||||
<key>IDESourceControlProjectWCCIdentifier</key>
|
||||
<string>F77EC8D9-F815-4829-9274-5DA08EA98D6B</string>
|
||||
<string>9D6FF97A89F512CD81EAE1A971A1D2EB03E03F7C</string>
|
||||
<key>IDESourceControlProjectWCConfigurations</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
|
||||
<string>public.vcs.git</string>
|
||||
<key>IDESourceControlWCCIdentifierKey</key>
|
||||
<string>F77EC8D9-F815-4829-9274-5DA08EA98D6B</string>
|
||||
<string>9D6FF97A89F512CD81EAE1A971A1D2EB03E03F7C</string>
|
||||
<key>IDESourceControlWCCName</key>
|
||||
<string>EZAudio</string>
|
||||
</dict>
|
||||
|
||||
BIN
Binary file not shown.
+4
-8
@@ -1,7 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="5056" systemVersion="13E28" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="vXZ-lx-hvc">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6254" systemVersion="14C109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="vXZ-lx-hvc">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6247"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--Play File View Controller-->
|
||||
@@ -18,11 +19,9 @@
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="uPM-eF-6ct" customClass="EZAudioPlotGL">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<segmentedControl opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="0" translatesAutoresizingMaskIntoConstraints="NO" id="TsA-XB-MTe">
|
||||
<rect key="frame" x="187" y="520" width="113" height="29"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<segments>
|
||||
<segment title="Buffer"/>
|
||||
<segment title="Rolling"/>
|
||||
@@ -33,14 +32,12 @@
|
||||
</segmentedControl>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Sh2-sS-uR6">
|
||||
<rect key="frame" x="20" y="488" width="280" height="21"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="xKX-cQ-AvV">
|
||||
<rect key="frame" x="20" y="519" width="30" height="30"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<state key="normal" title="Play">
|
||||
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
@@ -48,9 +45,8 @@
|
||||
<action selector="play:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="0vr-5R-dT3"/>
|
||||
</connections>
|
||||
</button>
|
||||
<slider opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.5" minValue="0.0" maxValue="1" continuous="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tSM-7B-ujg">
|
||||
<slider opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="0.5" minValue="0.0" maxValue="1" translatesAutoresizingMaskIntoConstraints="NO" id="tSM-7B-ujg">
|
||||
<rect key="frame" x="18" y="447" width="284" height="34"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<connections>
|
||||
<action selector="seekToFrame:" destination="vXZ-lx-hvc" eventType="valueChanged" id="3A8-F6-h6C"/>
|
||||
</connections>
|
||||
|
||||
+1
-1
@@ -133,7 +133,7 @@
|
||||
[[EZOutput sharedOutput] stopPlayback];
|
||||
|
||||
self.audioFile = [EZAudioFile audioFileWithURL:filePathURL];
|
||||
self.audioFile.audioFileDelegate = self;
|
||||
self.audioFile.delegate = self;
|
||||
self.eof = NO;
|
||||
self.filePathLabel.text = filePathURL.lastPathComponent;
|
||||
self.framePositionSlider.maximumValue = (float)self.audioFile.totalFrames;
|
||||
|
||||
Reference in New Issue
Block a user