Compare commits

...

57 Commits

Author SHA1 Message Date
Syed Haris Ali 80f4d92165 fixed homepage 2015-06-26 01:51:42 -07:00
Syed Haris Ali 2822b1952d updated readme 2015-06-24 01:49:49 -07:00
Syed Haris Ali 05fc557b47 updated podspec 2015-06-24 01:48:09 -07:00
Syed Haris Ali 319b377204 updated license headers 2015-06-24 01:46:04 -07:00
Syed Haris Ali 2b191c2934 Merge branch 'microphone_rewrite' 2015-06-24 01:38:06 -07:00
Syed Haris Ali 1e7ecccb34 updated background color 2015-06-24 01:33:16 -07:00
Syed Haris Ali d6df17dd77 minor tweak 2015-06-24 01:12:48 -07:00
Syed Haris Ali 6fa604744d cleaning up with .gitignore 2015-06-24 01:09:40 -07:00
Syed Haris Ali c85d2d15f0 last commit before global gitignore 2015-06-24 01:08:33 -07:00
Syed Haris Ali 7299edd94e updated gitignore 2015-06-24 01:05:24 -07:00
Syed Haris Ali 786019aada added documentation 2015-06-24 00:58:35 -07:00
Syed Haris Ali 7852b391f2 added code to make sure info structures that are malloc'ed are also initalized to 0 (memset) 2015-06-24 00:44:36 -07:00
Syed Haris Ali 1978023fed tweaked deprecated attributes documentation 2015-06-24 00:21:57 -07:00
Syed Haris Ali 20df3f3531 mapped EZAudio to EZAudioUtilities and added deprecated warnings 2015-06-24 00:13:29 -07:00
Syed Haris Ali 73b478e28b got rid of warnings from deprecated use of EZAudio methods 2015-06-23 23:47:57 -07:00
Syed Haris Ali a00df48ea1 added additional documentation 2015-06-23 22:26:37 -07:00
Syed Haris Ali 98e953ce98 cleaned up utilities and added license to header 2015-06-23 21:09:04 -07:00
Syed Haris Ali d63cd4dc40 added documentation to shouldExistOnCheckResultFail 2015-06-23 17:28:50 -07:00
Syed Haris Ali fd37dcdda0 cleaned up float converter + data classes 2015-06-23 17:16:24 -07:00
Syed Haris Ali ee6cc530d8 beginning to add documentation to EZAudioDevice 2015-06-23 17:13:21 -07:00
Syed Haris Ali 682b41ecd7 added tweak to opengl plot to properly render on retina macbooks 2015-06-23 16:39:55 -07:00
Syed Haris Ali 46526a0151 added print line to pass through example to show input device used 2015-06-23 16:38:33 -07:00
Syed Haris Ali 7bbe1c8335 cleaned up recording and passthrough examples 2015-06-23 16:34:52 -07:00
Syed Haris Ali 2f4e2492b2 added memory clean up for FFT example 2015-06-23 16:17:45 -07:00
Syed Haris Ali e72b5697bc updated FFT example for OSX 2015-06-23 16:16:03 -07:00
Syed Haris Ali 07b93765ae more cleanup for waveform from file example 2015-06-23 15:59:50 -07:00
Syed Haris Ali 4a7fb90ffa fixed waveform from file example for OSX 2015-06-23 15:58:03 -07:00
Syed Haris Ali cdd6e2b099 minor UI tweaks 2015-06-23 15:49:31 -07:00
Syed Haris Ali 6c77e38d39 updated OSX play file example 2015-06-23 15:46:55 -07:00
Syed Haris Ali 2c3c267859 all iOS examples have been updated 2015-06-23 15:11:03 -07:00
Syed Haris Ali f6e07602a0 cleaned up passthrough example 2015-06-23 15:08:31 -07:00
Syed Haris Ali 3915791e43 more support for direct out 2015-06-23 14:50:40 -07:00
Syed Haris Ali bdfb9956fa added support to microphone to allow direct out to EZOutput 2015-06-23 14:38:55 -07:00
Syed Haris Ali f5b0c727c4 added interruption handling for iOS 2015-06-23 14:24:12 -07:00
Syed Haris Ali 1e58da11ed tweaked microphone to respect custom asbd 2015-06-23 14:17:27 -07:00
Syed Haris Ali 35fdfb4c71 updated passthrough exampe 2015-06-23 14:06:31 -07:00
Syed Haris Ali ac9937a40a updated FFT example 2015-06-23 14:02:48 -07:00
Syed Haris Ali bbfe60861d updated record example ui for iOS project 2015-06-23 13:53:43 -07:00
Syed Haris Ali 8fb459635f tweaked styles for play file example 2015-06-23 13:38:20 -07:00
Syed Haris Ali 4cf8544cbf replaced iphone/ipad storyboards with universal storyboards 2015-06-23 13:35:55 -07:00
Syed Haris Ali 9fadbd3c1c updating recording example for iOS 2015-06-23 11:23:40 -07:00
Syed Haris Ali 32e27759d2 updated core graphics and openGL waveforms on iOS examples 2015-06-23 11:13:02 -07:00
Syed Haris Ali 3a3ab955f2 cleaning up EZMicrophone interface 2015-06-23 11:09:43 -07:00
Syed Haris Ali 47ebde3903 made microphone mono by default 2015-06-23 10:52:13 -07:00
Syed Haris Ali 38253f0923 more cleanup 2015-06-22 14:37:03 -07:00
Syed Haris Ali ade9cc9d1e updating OSX examples 2015-06-22 14:35:04 -07:00
Syed Haris Ali 1e923f2c85 added new float converter (EZAudioFloatConverter), float data object (EZAudioFloatData), and device selector (EZAudioDevice) 2015-06-22 14:18:13 -07:00
Syed Haris Ali d0bae18885 going to fix examples 2015-06-22 14:09:05 -07:00
Syed Haris Ali 46fe0bbb4c removed DS_Store from iOS examples 2015-06-22 14:04:46 -07:00
Syed Haris Ali dca7aec551 removed DS_Store from OSX example 2015-06-22 14:04:10 -07:00
Syed Haris Ali 23e3a216c7 Merge pull request #150 from JamieCruwys/master
Fixed memory leak in EZAudioFile
2015-04-25 12:24:09 -07:00
Jamie Cruwys 1b1d0bf81d Fixed memory leak in EZAudioFile
The variable _floatBuffers is allocated but is not subsequently
deallocated (freed). Some memory management was present for
_floatBuffers in this commit:
https://github.com/syedhali/EZAudio/commit/2431b2520496118cdc09af6b99846
61285e38c52. However, this was subsequently commented out in a later
commit:
https://github.com/syedhali/EZAudio/commit/1dc2fc2ba902f6fa9b1f8ec2c0c77
94aa7d66ee2. I have uncommented and improved this.
2015-04-25 18:39:15 +01:00
Syed Haris Ali e3be762414 Merge pull request #149 from JamieCruwys/master
Fixed two memory leaks in EZMicrophone
2015-04-24 15:27:24 -07:00
Jamie Cruwys da6bd9445a Fixed two memory leaks in EZMicrophone
The variables microphoneInputBuffer and floatBuffers are allocated but
are not subsequently deallocated (freed). The memory leaks are visible
in this leaks instrumentation screenshot:
http://i.imgur.com/vvO3GBt.png. After running this fix, the leaks are
gone as per the results here: http://i.imgur.com/mbtS3Rb.png.
2015-04-24 23:00:24 +01:00
Syed Haris Ali ba6d8582c8 merged msater 2015-02-14 21:21:11 -08:00
Syed Haris Ali e25baaa21e removing DS_Store 2015-02-14 21:18:42 -08:00
Syed Haris Ali e1d404238b Adding files to develop branch 2014-05-28 23:37:44 -07:00
131 changed files with 8106 additions and 6136 deletions
Vendored
BIN
View File
Binary file not shown.
+17
View File
@@ -0,0 +1,17 @@
.DS_Store
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
+3 -3
View File
@@ -1,14 +1,14 @@
Pod::Spec.new do |s|
s.name = "EZAudio"
s.version = "0.0.6"
s.version = "0.1.0"
s.summary = "A simple, intuitive audio framework for iOS and OSX useful for anyone doing audio processing and/or audio-based visualizations."
s.homepage = "http://syedharisali.com/projects/EZAudio/getting-started"
s.homepage = "https://github.com/syedhali/EZAudio"
s.screenshots = "https://s3-us-west-1.amazonaws.com/ezaudio-media/EZAudioSummary.png"
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { "Syed Haris Ali" => "syedhali07@gmail.com" }
s.ios.deployment_target = '6.0'
s.osx.deployment_target = '10.8'
s.source = { :git => "https://github.com/syedhali/EZAudio.git", :tag => "0.0.6" }
s.source = { :git => "https://github.com/syedhali/EZAudio.git", :tag => s.version }
s.source_files = 'EZAudio/*.{h,m,c}'
s.exclude_files = 'EZAudio/VERSION'
s.ios.frameworks = 'AudioToolbox','AVFoundation','GLKit'
+24 -24
View File
@@ -27,7 +27,7 @@
#define checkResult(result,operation) (_checkResult((result),(operation),strrchr(__FILE__, '/')+1,__LINE__))
static inline BOOL _checkResult(OSStatus result, const char *operation, const char* file, int line) {
if ( result != noErr ) {
if (result != noErr) {
NSLog(@"%s:%d: %s result %d %08X %4.4s", file, line, operation, (int)result, (int)result, (char*)&result);
return NO;
}
@@ -59,7 +59,7 @@ static OSStatus complexInputDataProc(AudioConverterRef inAudioConver
@synthesize sourceFormat = _sourceAudioDescription;
-(id)initWithSourceFormat:(AudioStreamBasicDescription)sourceFormat {
if ( !(self = [super init]) ) return nil;
if (!(self = [super init])) return nil;
_floatAudioDescription.mFormatID = kAudioFormatLinearPCM;
_floatAudioDescription.mFormatFlags = kAudioFormatFlagIsFloat | kAudioFormatFlagIsPacked | kAudioFormatFlagIsNonInterleaved;
@@ -72,12 +72,12 @@ static OSStatus complexInputDataProc(AudioConverterRef inAudioConver
_sourceAudioDescription = sourceFormat;
if ( memcmp(&sourceFormat, &_floatAudioDescription, sizeof(AudioStreamBasicDescription)) != 0 ) {
if (memcmp(&sourceFormat, &_floatAudioDescription, sizeof(AudioStreamBasicDescription)) != 0) {
checkResult(AudioConverterNew(&sourceFormat, &_floatAudioDescription, &_toFloatConverter), "AudioConverterNew");
checkResult(AudioConverterNew(&_floatAudioDescription, &sourceFormat, &_fromFloatConverter), "AudioConverterNew");
_scratchFloatBufferList = (AudioBufferList*)malloc(sizeof(AudioBufferList) + (_floatAudioDescription.mChannelsPerFrame-1)*sizeof(AudioBuffer));
_scratchFloatBufferList->mNumberBuffers = _floatAudioDescription.mChannelsPerFrame;
for ( int i=0; i<_scratchFloatBufferList->mNumberBuffers; i++ ) {
for ( int i=0; i<_scratchFloatBufferList->mNumberBuffers; i++) {
_scratchFloatBufferList->mBuffers[i].mNumberChannels = 1;
}
}
@@ -86,23 +86,23 @@ static OSStatus complexInputDataProc(AudioConverterRef inAudioConver
}
-(void)dealloc {
if ( _toFloatConverter ) AudioConverterDispose(_toFloatConverter);
if ( _fromFloatConverter ) AudioConverterDispose(_fromFloatConverter);
if ( _scratchFloatBufferList ) free(_scratchFloatBufferList);
if (_toFloatConverter) AudioConverterDispose(_toFloatConverter);
if (_fromFloatConverter) AudioConverterDispose(_fromFloatConverter);
if (_scratchFloatBufferList) free(_scratchFloatBufferList);
// [super dealloc];
}
BOOL AEFloatConverterToFloat(AEFloatConverter* THIS, AudioBufferList *sourceBuffer, float * const * targetBuffers, UInt32 frames) {
if ( frames == 0 ) return YES;
if (frames == 0) return YES;
if ( THIS->_toFloatConverter ) {
if (THIS->_toFloatConverter) {
UInt32 priorDataByteSize = sourceBuffer->mBuffers[0].mDataByteSize;
for ( int i=0; i<sourceBuffer->mNumberBuffers; i++ ) {
for ( int i=0; i<sourceBuffer->mNumberBuffers; i++) {
sourceBuffer->mBuffers[i].mDataByteSize = frames * THIS->_sourceAudioDescription.mBytesPerFrame;
}
for ( int i=0; i<THIS->_scratchFloatBufferList->mNumberBuffers; i++ ) {
for ( int i=0; i<THIS->_scratchFloatBufferList->mNumberBuffers; i++) {
THIS->_scratchFloatBufferList->mBuffers[i].mData = targetBuffers[i];
THIS->_scratchFloatBufferList->mBuffers[i].mDataByteSize = frames * sizeof(float);
}
@@ -114,16 +114,16 @@ BOOL AEFloatConverterToFloat(AEFloatConverter* THIS, AudioBufferList *sourceBuff
THIS->_scratchFloatBufferList,
NULL);
for ( int i=0; i<sourceBuffer->mNumberBuffers; i++ ) {
for ( int i=0; i<sourceBuffer->mNumberBuffers; i++) {
sourceBuffer->mBuffers[i].mDataByteSize = priorDataByteSize;
}
if ( !checkResult(result, "AudioConverterConvertComplexBuffer") ) {
if (!checkResult(result, "AudioConverterConvertComplexBuffer")) {
return NO;
}
} else {
for ( int i=0; i<sourceBuffer->mNumberBuffers; i++ ) {
for ( int i=0; i<sourceBuffer->mNumberBuffers; i++) {
memcpy(targetBuffers[i], sourceBuffer->mBuffers[i].mData, frames * sizeof(float));
}
}
@@ -135,23 +135,23 @@ BOOL AEFloatConverterToFloatBufferList(AEFloatConverter* converter, AudioBufferL
assert(targetBuffer->mNumberBuffers == converter->_floatAudioDescription.mChannelsPerFrame);
float *targetBuffers[targetBuffer->mNumberBuffers];
for ( int i=0; i<targetBuffer->mNumberBuffers; i++ ) {
for ( int i=0; i<targetBuffer->mNumberBuffers; i++) {
targetBuffers[i] = (float*)targetBuffer->mBuffers[i].mData;
}
return AEFloatConverterToFloat(converter, sourceBuffer, targetBuffers, frames);
}
BOOL AEFloatConverterFromFloat(AEFloatConverter* THIS, float * const * sourceBuffers, AudioBufferList *targetBuffer, UInt32 frames) {
if ( frames == 0 ) return YES;
if (frames == 0) return YES;
if ( THIS->_fromFloatConverter ) {
for ( int i=0; i<THIS->_scratchFloatBufferList->mNumberBuffers; i++ ) {
if (THIS->_fromFloatConverter) {
for ( int i=0; i<THIS->_scratchFloatBufferList->mNumberBuffers; i++) {
THIS->_scratchFloatBufferList->mBuffers[i].mData = sourceBuffers[i];
THIS->_scratchFloatBufferList->mBuffers[i].mDataByteSize = frames * sizeof(float);
}
UInt32 priorDataByteSize = targetBuffer->mBuffers[0].mDataByteSize;
for ( int i=0; i<targetBuffer->mNumberBuffers; i++ ) {
for ( int i=0; i<targetBuffer->mNumberBuffers; i++) {
targetBuffer->mBuffers[i].mDataByteSize = frames * THIS->_sourceAudioDescription.mBytesPerFrame;
}
@@ -162,15 +162,15 @@ BOOL AEFloatConverterFromFloat(AEFloatConverter* THIS, float * const * sourceBuf
targetBuffer,
NULL);
for ( int i=0; i<targetBuffer->mNumberBuffers; i++ ) {
for ( int i=0; i<targetBuffer->mNumberBuffers; i++) {
targetBuffer->mBuffers[i].mDataByteSize = priorDataByteSize;
}
if ( !checkResult(result, "AudioConverterConvertComplexBuffer") ) {
if (!checkResult(result, "AudioConverterConvertComplexBuffer")) {
return NO;
}
} else {
for ( int i=0; i<targetBuffer->mNumberBuffers; i++ ) {
for ( int i=0; i<targetBuffer->mNumberBuffers; i++) {
memcpy(targetBuffer->mBuffers[i].mData, sourceBuffers[i], frames * sizeof(float));
}
}
@@ -182,7 +182,7 @@ BOOL AEFloatConverterFromFloatBufferList(AEFloatConverter* converter, AudioBuffe
assert(sourceBuffer->mNumberBuffers == converter->_floatAudioDescription.mChannelsPerFrame);
float *sourceBuffers[sourceBuffer->mNumberBuffers];
for ( int i=0; i<sourceBuffer->mNumberBuffers; i++ ) {
for ( int i=0; i<sourceBuffer->mNumberBuffers; i++) {
sourceBuffers[i] = (float*)sourceBuffer->mBuffers[i].mData;
}
return AEFloatConverterFromFloat(converter, sourceBuffers, targetBuffer, frames);
@@ -194,7 +194,7 @@ static OSStatus complexInputDataProc(AudioConverterRef inAudioConver
AudioStreamPacketDescription **outDataPacketDescription,
void *inUserData) {
struct complexInputDataProc_t *arg = (struct complexInputDataProc_t*)inUserData;
if ( !arg->sourceBuffer ) {
if (!arg->sourceBuffer) {
return kNoMoreDataErr;
}
+302 -63
View File
@@ -26,14 +26,15 @@
#import <Foundation/Foundation.h>
#pragma mark - 3rd Party Utilties
#import "AEFloatConverter.h"
#import "TPCircularBuffer.h"
#pragma mark - Core Components
#import "EZAudioFile.h"
#import "EZAudioFloatData.h"
#import "EZMicrophone.h"
#import "EZOutput.h"
#import "EZRecorder.h"
#import "EZAudioUtilities.h"
#pragma mark - Extended Components
#import "EZAudioPlayer.h"
@@ -44,14 +45,47 @@
#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.
Class methods for EZAudio are provided as utility methods used throughout the other modules within the framework. For instance, these methods help make sense of error codes (checkResult:operation:), map values betwen coordinate systems (MAP:leftMin:leftMax:rightMin:rightMax:), calculate root mean squared values for buffers (RMS:length:), etc.
@warning As of 1.0 these methods have been moved over to `EZAudioUtilities` to allow using specific modules without requiring the whole library.
*/
@interface EZAudio : NSObject
//------------------------------------------------------------------------------
#pragma mark - Debugging
//------------------------------------------------------------------------------
///-----------------------------------------------------------
/// @name Debugging EZAudio
///-----------------------------------------------------------
/**
Globally sets whether or not the program should exit if a `checkResult:operation:` operation fails. Currently the behavior on EZAudio is to quit if a `checkResult:operation:` fails, but this is not desirable in any production environment. Internally there are a lot of `checkResult:operation:` operations used on all the core classes. This should only ever be set to NO in production environments since a `checkResult:operation:` failing means something breaking has likely happened.
@param shouldExitOnCheckResultFail A BOOL indicating whether or not the running program should exist due to a `checkResult:operation:` fail.
@deprecated This method is deprecated starting in version 0.1.0.
@note Please use same method in EZAudioUtilities class instead.
*/
+ (void)setShouldExitOnCheckResultFail:(BOOL)shouldExitOnCheckResultFail __attribute__((deprecated));
//------------------------------------------------------------------------------
/**
Provides a flag indicating whether or not the program will exit if a `checkResult:operation:` fails.
@deprecated This method is deprecated starting in version 0.1.0.
@note Please use same method in EZAudioUtilities class instead.
@return A BOOL indicating whether or not the program will exit if a `checkResult:operation:` fails.
*/
+ (BOOL)shouldExitOnCheckResultFail __attribute__((deprecated));
//------------------------------------------------------------------------------
#pragma mark - AudioBufferList Utility
//------------------------------------------------------------------------------
///-----------------------------------------------------------
/// @name AudioBufferList Utility
///-----------------------------------------------------------
@@ -61,82 +95,195 @@
@param frames The number of frames that will be stored within each audio buffer
@param channels The number of channels (e.g. 2 for stereo, 1 for mono, etc.)
@param interleaved Whether the samples will be interleaved (if not it will be assumed to be non-interleaved and each channel will have an AudioBuffer allocated)
@deprecated This method is deprecated starting in version 0.1.0.
@note Please use same method in EZAudioUtilities class instead.
@return An AudioBufferList struct that has been allocated in memory
*/
+(AudioBufferList *)audioBufferListWithNumberOfFrames:(UInt32)frames
numberOfChannels:(UInt32)channels
interleaved:(BOOL)interleaved;
+ (AudioBufferList *)audioBufferListWithNumberOfFrames:(UInt32)frames
numberOfChannels:(UInt32)channels
interleaved:(BOOL)interleaved __attribute__((deprecated));
//------------------------------------------------------------------------------
/**
Allocates an array of float arrays given the number of frames needed to store in each float array.
@param frames A UInt32 representing the number of frames to store in each float buffer
@param channels A UInt32 representing the number of channels (i.e. the number of float arrays to allocate)
@deprecated This method is deprecated starting in version 0.1.0.
@note Please use same method in EZAudioUtilities class instead.
@return An array of float arrays, each the length of the number of frames specified
*/
+ (float **)floatBuffersWithNumberOfFrames:(UInt32)frames
numberOfChannels:(UInt32)channels __attribute__((deprecated));
//------------------------------------------------------------------------------
/**
Deallocates an AudioBufferList structure from memory.
@param bufferList A pointer to the buffer list you would like to free
@deprecated This method is deprecated starting in version 0.1.0.
@note Please use same method in EZAudioUtilities class instead.
*/
+(void)freeBufferList:(AudioBufferList*)bufferList;
+ (void)freeBufferList:(AudioBufferList *)bufferList __attribute__((deprecated));
//------------------------------------------------------------------------------
/**
Deallocates an array of float buffers
@param buffers An array of float arrays
@param channels A UInt32 representing the number of channels (i.e. the number of float arrays to deallocate)
@deprecated This method is deprecated starting in version 0.1.0.
@note Please use same method in EZAudioUtilities class instead.
*/
+ (void)freeFloatBuffers:(float **)buffers numberOfChannels:(UInt32)channels __attribute__((deprecated));
//------------------------------------------------------------------------------
#pragma mark - AudioStreamBasicDescription Utilties
//------------------------------------------------------------------------------
///-----------------------------------------------------------
/// @name Creating An AudioStreamBasicDescription
///-----------------------------------------------------------
/**
Creates a signed-integer, interleaved AudioStreamBasicDescription for the number of channels specified for an AIFF format.
@param channels The desired number of channels
@param sampleRate The desired sample rate
@param sampleRate A float representing the sample rate.
@deprecated This method is deprecated starting in version 0.1.0.
@note Please use same method in EZAudioUtilities class instead.
@return A new AudioStreamBasicDescription with the specified format.
*/
+(AudioStreamBasicDescription)AIFFFormatWithNumberOfChannels:(UInt32)channels
sampleRate:(float)sampleRate;
+ (AudioStreamBasicDescription)AIFFFormatWithNumberOfChannels:(UInt32)channels
sampleRate:(float)sampleRate __attribute__((deprecated));
//------------------------------------------------------------------------------
/**
@param sampleRate The desired sample rate
Creates an AudioStreamBasicDescription for the iLBC narrow band speech codec.
@param sampleRate A float representing the sample rate.
@deprecated This method is deprecated starting in version 0.1.0.
@note Please use same method in EZAudioUtilities class instead.
@return A new AudioStreamBasicDescription with the specified format.
*/
+(AudioStreamBasicDescription)iLBCFormatWithSampleRate:(float)sampleRate;
+ (AudioStreamBasicDescription)iLBCFormatWithSampleRate:(float)sampleRate __attribute__((deprecated));
//------------------------------------------------------------------------------
/**
Creates a float-based, non-interleaved AudioStreamBasicDescription for the number of channels specified.
@param channels A UInt32 representing the number of channels.
@param sampleRate A float representing the sample rate.
@deprecated This method is deprecated starting in version 0.1.0.
@note Please use same method in EZAudioUtilities class instead.
@return A float-based AudioStreamBasicDescription with the number of channels specified.
*/
+ (AudioStreamBasicDescription)floatFormatWithNumberOfChannels:(UInt32)channels
sampleRate:(float)sampleRate __attribute__((deprecated));
//------------------------------------------------------------------------------
/**
Creates an AudioStreamBasicDescription for an M4A AAC format.
@param channels The desired number of channels
@param sampleRate The desired sample rate
@param sampleRate A float representing the sample rate.
@deprecated This method is deprecated starting in version 0.1.0.
@note Please use same method in EZAudioUtilities class instead.
@return A new AudioStreamBasicDescription with the specified format.
*/
+(AudioStreamBasicDescription)M4AFormatWithNumberOfChannels:(UInt32)channels
sampleRate:(float)sampleRate;
+ (AudioStreamBasicDescription)M4AFormatWithNumberOfChannels:(UInt32)channels
sampleRate:(float)sampleRate __attribute__((deprecated));
//------------------------------------------------------------------------------
/**
@param sampleRate The desired sample rate
Creates a single-channel, float-based AudioStreamBasicDescription.
@param sampleRate A float representing the sample rate.
@deprecated This method is deprecated starting in version 0.1.0.
@note Please use same method in EZAudioUtilities class instead.
@return A new AudioStreamBasicDescription with the specified format.
*/
+(AudioStreamBasicDescription)monoFloatFormatWithSampleRate:(float)sampleRate;
+ (AudioStreamBasicDescription)monoFloatFormatWithSampleRate:(float)sampleRate __attribute__((deprecated));
//------------------------------------------------------------------------------
/**
@param sampleRate The desired sample rate
Creates a single-channel, float-based AudioStreamBasicDescription (as of 0.0.6 this is the same as `monoFloatFormatWithSampleRate:`).
@param sampleRate A float representing the sample rate.
@return A new AudioStreamBasicDescription with the specified format.
@deprecated This method is deprecated starting in version 0.1.0.
@note Please use same method in EZAudioUtilities class instead.
*/
+(AudioStreamBasicDescription)monoCanonicalFormatWithSampleRate:(float)sampleRate;
+ (AudioStreamBasicDescription)monoCanonicalFormatWithSampleRate:(float)sampleRate __attribute__((deprecated));
//------------------------------------------------------------------------------
/**
@param sampleRate The desired sample rate
Creates a two-channel, non-interleaved, float-based AudioStreamBasicDescription (as of 0.0.6 this is the same as `stereoFloatNonInterleavedFormatWithSampleRate:`).
@param sampleRate A float representing the sample rate.
@deprecated This method is deprecated starting in version 0.1.0.
@note Please use same method in EZAudioUtilities class instead.
@return A new AudioStreamBasicDescription with the specified format.
*/
+(AudioStreamBasicDescription)stereoCanonicalNonInterleavedFormatWithSampleRate:(float)sampleRate;
+ (AudioStreamBasicDescription)stereoCanonicalNonInterleavedFormatWithSampleRate:(float)sampleRate __attribute__((deprecated));
//------------------------------------------------------------------------------
/**
@param sampleRate The desired sample rate
Creates a two-channel, interleaved, float-based AudioStreamBasicDescription.
@param sampleRate A float representing the sample rate.
@deprecated This method is deprecated starting in version 0.1.0.
@note Please use same method in EZAudioUtilities class instead.
@return A new AudioStreamBasicDescription with the specified format.
*/
+(AudioStreamBasicDescription)stereoFloatInterleavedFormatWithSampleRate:(float)sampleRate;
+ (AudioStreamBasicDescription)stereoFloatInterleavedFormatWithSampleRate:(float)sampleRate __attribute__((deprecated));
//------------------------------------------------------------------------------
/**
@param sampleRate The desired sample rate
Creates a two-channel, non-interleaved, float-based AudioStreamBasicDescription.
@param sampleRate A float representing the sample rate.
@deprecated This method is deprecated starting in version 0.1.0.
@note Please use same method in EZAudioUtilities class instead.
@return A new AudioStreamBasicDescription with the specified format.
*/
+(AudioStreamBasicDescription)stereoFloatNonInterleavedFormatWithSampleRate:(float)sameRate;
+ (AudioStreamBasicDescription)stereoFloatNonInterleavedFormatWithSampleRate:(float)sameRate __attribute__((deprecated));
//------------------------------------------------------------------------------
// @name AudioStreamBasicDescription Helper Functions
//------------------------------------------------------------------------------
/**
Checks an AudioStreamBasicDescription to see if it is a float-based format (as opposed to a signed integer based format).
@param asbd A valid AudioStreamBasicDescription
@deprecated This method is deprecated starting in version 0.1.0.
@note Please use same method in EZAudioUtilities class instead.
@return A BOOL indicating whether or not the AudioStreamBasicDescription is a float format.
*/
+ (BOOL)isFloatFormat:(AudioStreamBasicDescription)asbd __attribute__((deprecated));
//------------------------------------------------------------------------------
/**
Checks an AudioStreamBasicDescription to check for an interleaved flag (samples are
stored in one buffer one after another instead of two (or n channels) parallel buffers
@param asbd A valid AudioStreamBasicDescription
@deprecated This method is deprecated starting in version 0.1.0.
@note Please use same method in EZAudioUtilities class instead.
@return A BOOL indicating whether or not the AudioStreamBasicDescription is interleaved
*/
+ (BOOL)isInterleaved:(AudioStreamBasicDescription)asbd __attribute__((deprecated));
//------------------------------------------------------------------------------
/**
Checks an AudioStreamBasicDescription to see if it is a linear PCM format (uncompressed,
1 frame per packet)
@param asbd A valid AudioStreamBasicDescription
@deprecated This method is deprecated starting in version 0.1.0.
@note Please use same method in EZAudioUtilities class instead.
@return A BOOL indicating whether or not the AudioStreamBasicDescription is linear PCM.
*/
+ (BOOL)isLinearPCM:(AudioStreamBasicDescription)asbd __attribute__((deprecated));
///-----------------------------------------------------------
/// @name AudioStreamBasicDescription Utilities
@@ -144,21 +291,52 @@
/**
Nicely logs out the contents of an AudioStreamBasicDescription struct
@param asbd The AudioStreamBasicDescription struct with content to print out
@param asbd The AudioStreamBasicDescription struct with content to print out
@deprecated This method is deprecated starting in version 0.1.0.
@note Please use same method in EZAudioUtilities class instead.
*/
+(void)printASBD:(AudioStreamBasicDescription)asbd;
+ (void)printASBD:(AudioStreamBasicDescription)asbd __attribute__((deprecated));
//------------------------------------------------------------------------------
/**
Converts seconds into a string formatted as MM:SS
@param seconds An NSTimeInterval representing the number of seconds
@deprecated This method is deprecated starting in version 0.1.0.
@note Please use same method in EZAudioUtilities class instead.
@return An NSString instance formatted as MM:SS from the seconds provided.
*/
+ (NSString *)displayTimeStringFromSeconds:(NSTimeInterval)seconds __attribute__((deprecated));
//------------------------------------------------------------------------------
/**
Creates a string to use when logging out the contents of an AudioStreamBasicDescription
@param asbd A valid AudioStreamBasicDescription struct.
@deprecated This method is deprecated starting in version 0.1.0.
@note Please use same method in EZAudioUtilities class instead.
@return An NSString representing the contents of the AudioStreamBasicDescription.
*/
+ (NSString *)stringForAudioStreamBasicDescription:(AudioStreamBasicDescription)asbd __attribute__((deprecated));
//------------------------------------------------------------------------------
/**
Just a wrapper around the setCanonical function provided in the Core Audio Utility C++ class.
@param asbd The AudioStreamBasicDescription structure to modify
@param nChannels The number of expected channels on the description
@param interleaved A flag indicating whether the stereo samples should be interleaved in the buffer
@deprecated This method is deprecated starting in version 0.1.0.
@note Please use same method in EZAudioUtilities class instead.
*/
+(void)setCanonicalAudioStreamBasicDescription:(AudioStreamBasicDescription*)asbd
numberOfChannels:(UInt32)nChannels
interleaved:(BOOL)interleaved;
+ (void)setCanonicalAudioStreamBasicDescription:(AudioStreamBasicDescription*)asbd
numberOfChannels:(UInt32)nChannels
interleaved:(BOOL)interleaved __attribute__((deprecated));
//------------------------------------------------------------------------------
#pragma mark - Math Utilities
//------------------------------------------------------------------------------
///-----------------------------------------------------------
/// @name Math Utilities
///-----------------------------------------------------------
@@ -169,21 +347,29 @@
@param bufferLength The length of the float array being appended to the history buffer
@param scrollHistory The target history buffer in which to append the values
@param scrollHistoryLength The length of the target history buffer
@deprecated This method is deprecated starting in version 0.1.0.
@note Please use same method in EZAudioUtilities class instead.
*/
+(void)appendBufferAndShift:(float*)buffer
withBufferSize:(int)bufferLength
toScrollHistory:(float*)scrollHistory
withScrollHistorySize:(int)scrollHistoryLength;
+ (void)appendBufferAndShift:(float*)buffer
withBufferSize:(int)bufferLength
toScrollHistory:(float*)scrollHistory
withScrollHistorySize:(int)scrollHistoryLength __attribute__((deprecated));
//------------------------------------------------------------------------------
/**
Appends a value to a history buffer and performs an internal shift to add the value to the tail and remove the 0th value.
@param value The float value to append to the history array
@param scrollHistory The target history buffer in which to append the values
@param scrollHistoryLength The length of the target history buffer
@deprecated This method is deprecated starting in version 0.1.0.
@note Please use same method in EZAudioUtilities class instead.
*/
+(void) appendValue:(float)value
toScrollHistory:(float*)scrollHistory
withScrollHistorySize:(int)scrollHistoryLength;
withScrollHistorySize:(int)scrollHistoryLength __attribute__((deprecated));
//------------------------------------------------------------------------------
/**
Maps a value from one coordinate system into another one. Takes in the current value to map, the minimum and maximum values of the first coordinate system, and the minimum and maximum values of the second coordinate system and calculates the mapped value in the second coordinate system's constraints.
@@ -192,22 +378,29 @@
@param leftMax The maximum of the first coordinate system
@param rightMin The minimum of the second coordindate system
@param rightMax The maximum of the second coordinate system
@deprecated This method is deprecated starting in version 0.1.0.
@note Please use same method in EZAudioUtilities class instead.
@return The mapped value in terms of the second coordinate system
*/
+(float)MAP:(float)value
leftMin:(float)leftMin
leftMax:(float)leftMax
rightMin:(float)rightMin
rightMax:(float)rightMax;
+ (float)MAP:(float)value
leftMin:(float)leftMin
leftMax:(float)leftMax
rightMin:(float)rightMin
rightMax:(float)rightMax __attribute__((deprecated));
//------------------------------------------------------------------------------
/**
Calculates the root mean squared for a buffer.
@param buffer A float buffer array of values whose root mean squared to calculate
@param bufferSize The size of the float buffer
@deprecated This method is deprecated starting in version 0.1.0.
@note Please use same method in EZAudioUtilities class instead.
@return The root mean squared of the buffer
*/
+(float)RMS:(float*)buffer
length:(int)bufferSize;
+ (float)RMS:(float*)buffer length:(int)bufferSize __attribute__((deprecated));
//------------------------------------------------------------------------------
/**
Calculate the sign function sgn(x) =
@@ -215,11 +408,16 @@
{ 0 , x = 0,
{ 1 , x > 0
@param value The float value for which to use as x
@deprecated This method is deprecated starting in version 0.1.0.
@note Please use same method in EZAudioUtilities class instead.
@return The float sign value
*/
+(float)SGN:(float)value;
+ (float)SGN:(float)value __attribute__((deprecated));
//------------------------------------------------------------------------------
#pragma mark - OSStatus Utility
//------------------------------------------------------------------------------
///-----------------------------------------------------------
/// @name OSStatus Utility
///-----------------------------------------------------------
@@ -228,23 +426,52 @@
Basic check result function useful for checking each step of the audio setup process
@param result The OSStatus representing the result of an operation
@param operation A string (const char, not NSString) describing the operation taking place (will print if fails)
@deprecated This method is deprecated starting in version 0.1.0.
@note Please use same method in EZAudioUtilities class instead.
*/
+(void)checkResult:(OSStatus)result
operation:(const char*)operation;
+ (void)checkResult:(OSStatus)result operation:(const char *)operation __attribute__((deprecated));
//------------------------------------------------------------------------------
/**
Provides a string representation of the often cryptic Core Audio error codes
@param code A UInt32 representing an error code
@deprecated This method is deprecated starting in version 0.1.0.
@note Please use same method in EZAudioUtilities class instead.
@return An NSString with a human readable version of the error code.
*/
+ (NSString *)stringFromUInt32Code:(UInt32)code __attribute__((deprecated));
//------------------------------------------------------------------------------
#pragma mark - Plot Utility
//------------------------------------------------------------------------------
///-----------------------------------------------------------
/// @name Plot Utility
///-----------------------------------------------------------
+(void)updateScrollHistory:(float**)scrollHistory
withLength:(int)scrollHistoryLength
atIndex:(int*)index
withBuffer:(float*)buffer
withBufferSize:(int)bufferSize
isResolutionChanging:(BOOL*)isChanging;
/**
Given a buffer representing a window of float history data this append the RMS of a buffer of incoming float data...This will likely be deprecated in a future version of EZAudio for a circular buffer based approach.
@param scrollHistory An array of float arrays being used to hold the history values for each channel.
@param scrollHistoryLength An int representing the length of the history window.
@param index An int pointer to the index of the current read index of the history buffer.
@param buffer A float array representing the incoming audio data.
@param bufferSize An int representing the length of the incoming audio data.
@param isChanging A BOOL pointer representing whether the resolution (length of the history window) is currently changing.
@deprecated This method is deprecated starting in version 0.1.0.
@note Please use same method in EZAudioUtilities class instead.
*/
+ (void)updateScrollHistory:(float **)scrollHistory
withLength:(int)scrollHistoryLength
atIndex:(int *)index
withBuffer:(float *)buffer
withBufferSize:(int)bufferSize
isResolutionChanging:(BOOL *)isChanging __attribute__((deprecated));
//------------------------------------------------------------------------------
#pragma mark - TPCircularBuffer Utility
//------------------------------------------------------------------------------
///-----------------------------------------------------------
/// @name TPCircularBuffer Utility
///-----------------------------------------------------------
@@ -253,22 +480,34 @@
Appends the data from the audio buffer list to the circular buffer
@param circularBuffer Pointer to the instance of the TPCircularBuffer to add the audio data to
@param audioBufferList Pointer to the instance of the AudioBufferList with the audio data
@deprecated This method is deprecated starting in version 0.1.0.
@note Please use same method in EZAudioUtilities class instead.
*/
+(void)appendDataToCircularBuffer:(TPCircularBuffer*)circularBuffer
fromAudioBufferList:(AudioBufferList*)audioBufferList;
+ (void)appendDataToCircularBuffer:(TPCircularBuffer*)circularBuffer
fromAudioBufferList:(AudioBufferList*)audioBufferList __attribute__((deprecated));
//------------------------------------------------------------------------------
/**
Initializes the circular buffer (just a wrapper around the C method)
* @param circularBuffer Pointer to an instance of the TPCircularBuffer
* @param size The length of the TPCircularBuffer (usually 1024)
@deprecated This method is deprecated starting in version 0.1.0.
@note Please use same method in EZAudioUtilities class instead.
*/
+(void)circularBuffer:(TPCircularBuffer*)circularBuffer
withSize:(int)size;
+ (void)circularBuffer:(TPCircularBuffer*)circularBuffer
withSize:(int)size __attribute__((deprecated));
//------------------------------------------------------------------------------
/**
Frees a circular buffer
@param circularBuffer Pointer to the circular buffer to clear
@deprecated This method is deprecated starting in version 0.1.0.
@note Please use same method in EZAudioUtilities class instead.
*/
+(void)freeCircularBuffer:(TPCircularBuffer*)circularBuffer;
+ (void)freeCircularBuffer:(TPCircularBuffer*)circularBuffer __attribute__((deprecated));
@end
//------------------------------------------------------------------------------
@end
+242 -294
View File
@@ -1,359 +1,307 @@
//
// EZAudio.m
// EZAudio
// EZAudioCoreGraphicsWaveformExample
//
// Created by Syed Haris Ali on 11/21/13.
// Copyright (c) 2013 Syed Haris Ali. All rights reserved.
// Created by Syed Haris Ali on 5/13/15.
// Copyright (c) 2015 Syed Haris Ali. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import "EZAudio.h"
@implementation EZAudio
//------------------------------------------------------------------------------
#pragma mark - Debugging
//------------------------------------------------------------------------------
+ (void)setShouldExitOnCheckResultFail:(BOOL)shouldExitOnCheckResultFail
{
[EZAudioUtilities setShouldExitOnCheckResultFail:shouldExitOnCheckResultFail];
}
//------------------------------------------------------------------------------
+ (BOOL)shouldExitOnCheckResultFail
{
return [EZAudioUtilities shouldExitOnCheckResultFail];
}
//------------------------------------------------------------------------------
#pragma mark - AudioBufferList Utility
+(AudioBufferList *)audioBufferListWithNumberOfFrames:(UInt32)frames
numberOfChannels:(UInt32)channels
interleaved:(BOOL)interleaved
//------------------------------------------------------------------------------
+ (AudioBufferList *)audioBufferListWithNumberOfFrames:(UInt32)frames
numberOfChannels:(UInt32)channels
interleaved:(BOOL)interleaved
{
AudioBufferList *audioBufferList = (AudioBufferList*)malloc(sizeof(AudioBufferList));
UInt32 outputBufferSize = 32 * frames; // 32 KB
audioBufferList->mNumberBuffers = interleaved ? 1 : channels;
for( int i = 0; i < audioBufferList->mNumberBuffers; i++ )
{
audioBufferList->mBuffers[i].mNumberChannels = channels;
audioBufferList->mBuffers[i].mDataByteSize = channels * outputBufferSize;
audioBufferList->mBuffers[i].mData = (float*)malloc(channels * sizeof(float) *outputBufferSize);
}
return audioBufferList;
return [EZAudioUtilities audioBufferListWithNumberOfFrames:frames
numberOfChannels:channels
interleaved:interleaved];
}
+(void)freeBufferList:(AudioBufferList *)bufferList
//------------------------------------------------------------------------------
+ (float **)floatBuffersWithNumberOfFrames:(UInt32)frames
numberOfChannels:(UInt32)channels
{
if( bufferList )
{
if( bufferList->mNumberBuffers )
{
for( int i = 0; i < bufferList->mNumberBuffers; i++ )
{
if( bufferList->mBuffers[i].mData )
{
free(bufferList->mBuffers[i].mData);
}
}
}
free(bufferList);
}
bufferList = NULL;
return [EZAudioUtilities floatBuffersWithNumberOfFrames:frames
numberOfChannels:channels];
}
//------------------------------------------------------------------------------
+ (void)freeBufferList:(AudioBufferList *)bufferList
{
[EZAudioUtilities freeBufferList:bufferList];
}
//------------------------------------------------------------------------------
+ (void)freeFloatBuffers:(float **)buffers numberOfChannels:(UInt32)channels
{
[EZAudioUtilities freeFloatBuffers:buffers numberOfChannels:channels];
}
//------------------------------------------------------------------------------
#pragma mark - AudioStreamBasicDescription Utility
+(AudioStreamBasicDescription)AIFFFormatWithNumberOfChannels:(UInt32)channels
//------------------------------------------------------------------------------
+ (AudioStreamBasicDescription)AIFFFormatWithNumberOfChannels:(UInt32)channels
sampleRate:(float)sampleRate
{
return [EZAudioUtilities AIFFFormatWithNumberOfChannels:channels
sampleRate:sampleRate];
}
//------------------------------------------------------------------------------
+ (AudioStreamBasicDescription)iLBCFormatWithSampleRate:(float)sampleRate
{
return [EZAudioUtilities iLBCFormatWithSampleRate:sampleRate];
}
//------------------------------------------------------------------------------
+ (AudioStreamBasicDescription)floatFormatWithNumberOfChannels:(UInt32)channels
sampleRate:(float)sampleRate
{
return [EZAudioUtilities floatFormatWithNumberOfChannels:channels
sampleRate:sampleRate];
}
//------------------------------------------------------------------------------
+ (AudioStreamBasicDescription)M4AFormatWithNumberOfChannels:(UInt32)channels
sampleRate:(float)sampleRate
{
AudioStreamBasicDescription asbd;
memset(&asbd, 0, sizeof(asbd));
asbd.mFormatID = kAudioFormatLinearPCM;
asbd.mFormatFlags = kAudioFormatFlagIsBigEndian|kAudioFormatFlagIsPacked|kAudioFormatFlagIsSignedInteger;
asbd.mSampleRate = sampleRate;
asbd.mChannelsPerFrame = channels;
asbd.mBitsPerChannel = 32;
asbd.mBytesPerPacket = (asbd.mBitsPerChannel / 8) * asbd.mChannelsPerFrame;
asbd.mFramesPerPacket = 1;
asbd.mBytesPerFrame = (asbd.mBitsPerChannel / 8) * asbd.mChannelsPerFrame;
return asbd;
return [EZAudioUtilities M4AFormatWithNumberOfChannels:channels
sampleRate:sampleRate];
}
+(AudioStreamBasicDescription)iLBCFormatWithSampleRate:(float)sampleRate
//------------------------------------------------------------------------------
+ (AudioStreamBasicDescription)monoFloatFormatWithSampleRate:(float)sampleRate
{
AudioStreamBasicDescription asbd;
memset(&asbd, 0, sizeof(asbd));
asbd.mFormatID = kAudioFormatiLBC;
asbd.mChannelsPerFrame = 1;
asbd.mSampleRate = sampleRate;
// Fill in the rest of the descriptions using the Audio Format API
UInt32 propSize = sizeof(asbd);
[EZAudio checkResult:AudioFormatGetProperty(kAudioFormatProperty_FormatInfo,
0,
NULL,
&propSize,
&asbd)
operation:"Failed to fill out the rest of the m4a AudioStreamBasicDescription"];
return asbd;
return [EZAudioUtilities monoFloatFormatWithSampleRate:sampleRate];
}
+(AudioStreamBasicDescription)M4AFormatWithNumberOfChannels:(UInt32)channels
sampleRate:(float)sampleRate
//------------------------------------------------------------------------------
+ (AudioStreamBasicDescription)monoCanonicalFormatWithSampleRate:(float)sampleRate
{
AudioStreamBasicDescription asbd;
memset(&asbd, 0, sizeof(asbd));
asbd.mFormatID = kAudioFormatMPEG4AAC;
asbd.mChannelsPerFrame = channels;
asbd.mSampleRate = sampleRate;
// Fill in the rest of the descriptions using the Audio Format API
UInt32 propSize = sizeof(asbd);
[EZAudio checkResult:AudioFormatGetProperty(kAudioFormatProperty_FormatInfo,
0,
NULL,
&propSize,
&asbd)
operation:"Failed to fill out the rest of the m4a AudioStreamBasicDescription"];
return asbd;
return [EZAudioUtilities monoCanonicalFormatWithSampleRate:sampleRate];
}
+(AudioStreamBasicDescription)monoFloatFormatWithSampleRate:(float)sampleRate
//------------------------------------------------------------------------------
+ (AudioStreamBasicDescription)stereoCanonicalNonInterleavedFormatWithSampleRate:(float)sampleRate
{
AudioStreamBasicDescription asbd;
UInt32 byteSize = sizeof(float);
asbd.mBitsPerChannel = 8 * byteSize;
asbd.mBytesPerFrame = byteSize;
asbd.mBytesPerPacket = byteSize;
asbd.mChannelsPerFrame = 1;
asbd.mFormatFlags = kAudioFormatFlagIsPacked|kAudioFormatFlagIsFloat;
asbd.mFormatID = kAudioFormatLinearPCM;
asbd.mFramesPerPacket = 1;
asbd.mSampleRate = sampleRate;
return asbd;
return [EZAudioUtilities stereoCanonicalNonInterleavedFormatWithSampleRate:sampleRate];
}
+(AudioStreamBasicDescription)monoCanonicalFormatWithSampleRate:(float)sampleRate
//------------------------------------------------------------------------------
+ (AudioStreamBasicDescription)stereoFloatInterleavedFormatWithSampleRate:(float)sampleRate
{
AudioStreamBasicDescription asbd;
UInt32 byteSize = sizeof(float);
asbd.mBitsPerChannel = 8 * byteSize;
asbd.mBytesPerFrame = byteSize;
asbd.mBytesPerPacket = byteSize;
asbd.mChannelsPerFrame = 1;
asbd.mFormatFlags = kAudioFormatFlagsNativeFloatPacked|kAudioFormatFlagIsNonInterleaved;
asbd.mFormatID = kAudioFormatLinearPCM;
asbd.mFramesPerPacket = 1;
asbd.mSampleRate = sampleRate;
return asbd;
return [EZAudioUtilities stereoFloatInterleavedFormatWithSampleRate:sampleRate];
}
+(AudioStreamBasicDescription)stereoCanonicalNonInterleavedFormatWithSampleRate:(float)sampleRate
//------------------------------------------------------------------------------
+ (AudioStreamBasicDescription)stereoFloatNonInterleavedFormatWithSampleRate:(float)sampleRate
{
AudioStreamBasicDescription asbd;
UInt32 byteSize = sizeof(float);
asbd.mBitsPerChannel = 8 * byteSize;
asbd.mBytesPerFrame = byteSize;
asbd.mBytesPerPacket = byteSize;
asbd.mChannelsPerFrame = 2;
asbd.mFormatFlags = kAudioFormatFlagsNativeFloatPacked|kAudioFormatFlagIsNonInterleaved;
asbd.mFormatID = kAudioFormatLinearPCM;
asbd.mFramesPerPacket = 1;
asbd.mSampleRate = sampleRate;
return asbd;
return [EZAudioUtilities stereoFloatNonInterleavedFormatWithSampleRate:sampleRate];
}
+(AudioStreamBasicDescription)stereoFloatInterleavedFormatWithSampleRate:(float)sampleRate
//------------------------------------------------------------------------------
+ (BOOL)isFloatFormat:(AudioStreamBasicDescription)asbd
{
AudioStreamBasicDescription asbd;
UInt32 floatByteSize = sizeof(float);
asbd.mChannelsPerFrame = 2;
asbd.mBitsPerChannel = 8 * floatByteSize;
asbd.mBytesPerFrame = asbd.mChannelsPerFrame * floatByteSize;
asbd.mBytesPerPacket = asbd.mChannelsPerFrame * floatByteSize;
asbd.mFormatFlags = kAudioFormatFlagIsPacked|kAudioFormatFlagIsFloat;
asbd.mFormatID = kAudioFormatLinearPCM;
asbd.mFramesPerPacket = 1;
asbd.mSampleRate = sampleRate;
return asbd;
return [EZAudioUtilities isFloatFormat:asbd];
}
+(AudioStreamBasicDescription)stereoFloatNonInterleavedFormatWithSampleRate:(float)sampleRate
//------------------------------------------------------------------------------
+ (BOOL)isInterleaved:(AudioStreamBasicDescription)asbd
{
AudioStreamBasicDescription asbd;
UInt32 floatByteSize = sizeof(float);
asbd.mBitsPerChannel = 8 * floatByteSize;
asbd.mBytesPerFrame = floatByteSize;
asbd.mBytesPerPacket = floatByteSize;
asbd.mChannelsPerFrame = 2;
asbd.mFormatFlags = kAudioFormatFlagIsFloat|kAudioFormatFlagIsNonInterleaved;
asbd.mFormatID = kAudioFormatLinearPCM;
asbd.mFramesPerPacket = 1;
asbd.mSampleRate = sampleRate;
return asbd;
return [EZAudioUtilities isInterleaved:asbd];
}
+(void)printASBD:(AudioStreamBasicDescription)asbd {
char formatIDString[5];
UInt32 formatID = CFSwapInt32HostToBig(asbd.mFormatID);
bcopy (&formatID, formatIDString, 4);
formatIDString[4] = '\0';
NSLog (@" Sample Rate: %10.0f", asbd.mSampleRate);
NSLog (@" Format ID: %10s", formatIDString);
NSLog (@" Format Flags: %10X", (unsigned int)asbd.mFormatFlags);
NSLog (@" Bytes per Packet: %10d", (unsigned int)asbd.mBytesPerPacket);
NSLog (@" Frames per Packet: %10d", (unsigned int)asbd.mFramesPerPacket);
NSLog (@" Bytes per Frame: %10d", (unsigned int)asbd.mBytesPerFrame);
NSLog (@" Channels per Frame: %10d", (unsigned int)asbd.mChannelsPerFrame);
NSLog (@" Bits per Channel: %10d", (unsigned int)asbd.mBitsPerChannel);
//------------------------------------------------------------------------------
+ (BOOL)isLinearPCM:(AudioStreamBasicDescription)asbd
{
return [EZAudioUtilities isLinearPCM:asbd];
}
+(void)setCanonicalAudioStreamBasicDescription:(AudioStreamBasicDescription*)asbd
numberOfChannels:(UInt32)nChannels
interleaved:(BOOL)interleaved {
asbd->mFormatID = kAudioFormatLinearPCM;
#if TARGET_OS_IPHONE
int sampleSize = sizeof(float);
asbd->mFormatFlags = kAudioFormatFlagsNativeFloatPacked;
#elif TARGET_OS_MAC
int sampleSize = sizeof(Float32);
asbd->mFormatFlags = kAudioFormatFlagsNativeFloatPacked;
#endif
asbd->mBitsPerChannel = 8 * sampleSize;
asbd->mChannelsPerFrame = nChannels;
asbd->mFramesPerPacket = 1;
if (interleaved)
asbd->mBytesPerPacket = asbd->mBytesPerFrame = nChannels * sampleSize;
else {
asbd->mBytesPerPacket = asbd->mBytesPerFrame = sampleSize;
asbd->mFormatFlags |= kAudioFormatFlagIsNonInterleaved;
}
//------------------------------------------------------------------------------
+ (void)printASBD:(AudioStreamBasicDescription)asbd
{
[EZAudioUtilities printASBD:asbd];
}
#pragma mark - OSStatus Utility
+(void)checkResult:(OSStatus)result
operation:(const char *)operation {
if (result == noErr) return;
char errorString[20];
// see if it appears to be a 4-char-code
*(UInt32 *)(errorString + 1) = CFSwapInt32HostToBig(result);
if (isprint(errorString[1]) && isprint(errorString[2]) && isprint(errorString[3]) && isprint(errorString[4])) {
errorString[0] = errorString[5] = '\'';
errorString[6] = '\0';
} else
// no, format it as an integer
sprintf(errorString, "%d", (int)result);
fprintf(stderr, "Error: %s (%s)\n", operation, errorString);
exit(1);
//------------------------------------------------------------------------------
+ (NSString *)displayTimeStringFromSeconds:(NSTimeInterval)seconds
{
return [EZAudioUtilities displayTimeStringFromSeconds:seconds];
}
#pragma mark - Math Utility
+(void)appendBufferAndShift:(float*)buffer
withBufferSize:(int)bufferLength
toScrollHistory:(float*)scrollHistory
withScrollHistorySize:(int)scrollHistoryLength {
NSAssert(scrollHistoryLength>=bufferLength,@"Scroll history array length must be greater buffer length");
NSAssert(scrollHistoryLength>0,@"Scroll history array length must be greater than 0");
NSAssert(bufferLength>0,@"Buffer array length must be greater than 0");
int shiftLength = scrollHistoryLength - bufferLength;
size_t floatByteSize = sizeof(float);
size_t shiftByteSize = shiftLength * floatByteSize;
size_t bufferByteSize = bufferLength * floatByteSize;
memmove(&scrollHistory[0],
&scrollHistory[bufferLength],
shiftByteSize);
memmove(&scrollHistory[shiftLength],
&buffer[0],
bufferByteSize);
//------------------------------------------------------------------------------
+ (NSString *)stringForAudioStreamBasicDescription:(AudioStreamBasicDescription)asbd
{
return [EZAudioUtilities stringForAudioStreamBasicDescription:asbd];
}
+(void) appendValue:(float)value
//------------------------------------------------------------------------------
+ (void)setCanonicalAudioStreamBasicDescription:(AudioStreamBasicDescription*)asbd
numberOfChannels:(UInt32)nChannels
interleaved:(BOOL)interleaved
{
[EZAudioUtilities setCanonicalAudioStreamBasicDescription:asbd
numberOfChannels:nChannels
interleaved:interleaved];
}
//------------------------------------------------------------------------------
#pragma mark - Math Utilities
//------------------------------------------------------------------------------
+ (void)appendBufferAndShift:(float*)buffer
withBufferSize:(int)bufferLength
toScrollHistory:(float*)scrollHistory
withScrollHistorySize:(int)scrollHistoryLength
{
[EZAudioUtilities appendBufferAndShift:buffer
withBufferSize:bufferLength
toScrollHistory:scrollHistory
withScrollHistorySize:scrollHistoryLength];
}
//------------------------------------------------------------------------------
+ (void) appendValue:(float)value
toScrollHistory:(float*)scrollHistory
withScrollHistorySize:(int)scrollHistoryLength {
float val[1]; val[0] = value;
[self appendBufferAndShift:val
withBufferSize:1
toScrollHistory:scrollHistory
withScrollHistorySize:scrollHistoryLength];
}
+(float)MAP:(float)value
leftMin:(float)leftMin
leftMax:(float)leftMax
rightMin:(float)rightMin
rightMax:(float)rightMax {
float leftSpan = leftMax - leftMin;
float rightSpan = rightMax - rightMin;
float valueScaled = ( value - leftMin ) / leftSpan;
return rightMin + (valueScaled * rightSpan);
}
+(float)RMS:(float *)buffer
length:(int)bufferSize {
float sum = 0.0;
for(int i = 0; i < bufferSize; i++)
sum += buffer[i] * buffer[i];
return sqrtf( sum / bufferSize );
}
+(float)SGN:(float)value
withScrollHistorySize:(int)scrollHistoryLength
{
return value < 0 ? -1.0f : ( value > 0 ? 1.0f : 0.0f );
[EZAudioUtilities appendValue:value
toScrollHistory:scrollHistory
withScrollHistorySize:scrollHistoryLength];
}
//------------------------------------------------------------------------------
+ (float)MAP:(float)value
leftMin:(float)leftMin
leftMax:(float)leftMax
rightMin:(float)rightMin
rightMax:(float)rightMax
{
return [EZAudioUtilities MAP:value
leftMin:leftMin
leftMax:leftMax
rightMin:rightMin
rightMax:rightMax];
}
//------------------------------------------------------------------------------
+ (float)RMS:(float *)buffer length:(int)bufferSize
{
return [EZAudioUtilities RMS:buffer length:bufferSize];
}
//------------------------------------------------------------------------------
+ (float)SGN:(float)value
{
return [EZAudioUtilities SGN:value];
}
//------------------------------------------------------------------------------
#pragma mark - OSStatus Utility
//------------------------------------------------------------------------------
+ (void)checkResult:(OSStatus)result operation:(const char *)operation
{
[EZAudioUtilities checkResult:result
operation:operation];
}
//------------------------------------------------------------------------------
+ (NSString *)stringFromUInt32Code:(UInt32)code
{
return [EZAudioUtilities stringFromUInt32Code:code];
}
//------------------------------------------------------------------------------
#pragma mark - Plot Utility
+(void)updateScrollHistory:(float **)scrollHistory
withLength:(int)scrollHistoryLength
atIndex:(int*)index
withBuffer:(float *)buffer
withBufferSize:(int)bufferSize
isResolutionChanging:(BOOL*)isChanging {
//
size_t floatByteSize = sizeof(float);
//
if( *scrollHistory == NULL ){
// Create the history buffer
*scrollHistory = (float*)calloc(kEZAudioPlotMaxHistoryBufferLength,floatByteSize);
}
//
if( !*isChanging ){
float rms = [EZAudio RMS:buffer length:bufferSize];
if( *index < scrollHistoryLength ){
float *hist = *scrollHistory;
hist[*index] = rms;
(*index)++;
}
else {
[EZAudio appendValue:rms
toScrollHistory:*scrollHistory
withScrollHistorySize:scrollHistoryLength];
}
}
//------------------------------------------------------------------------------
+ (void)updateScrollHistory:(float **)scrollHistory
withLength:(int)scrollHistoryLength
atIndex:(int *)index
withBuffer:(float *)buffer
withBufferSize:(int)bufferSize
isResolutionChanging:(BOOL *)isChanging
{
[EZAudioUtilities updateScrollHistory:scrollHistory
withLength:scrollHistoryLength
atIndex:index
withBuffer:buffer
withBufferSize:bufferSize
isResolutionChanging:isChanging];
}
//------------------------------------------------------------------------------
#pragma mark - TPCircularBuffer Utility
+(void)circularBuffer:(TPCircularBuffer *)circularBuffer withSize:(int)size {
TPCircularBufferInit(circularBuffer,size);
//------------------------------------------------------------------------------
+ (void)appendDataToCircularBuffer:(TPCircularBuffer *)circularBuffer
fromAudioBufferList:(AudioBufferList *)audioBufferList
{
[EZAudioUtilities appendDataToCircularBuffer:circularBuffer
fromAudioBufferList:audioBufferList];
}
+(void)appendDataToCircularBuffer:(TPCircularBuffer*)circularBuffer
fromAudioBufferList:(AudioBufferList*)audioBufferList {
TPCircularBufferProduceBytes(circularBuffer,
audioBufferList->mBuffers[0].mData,
audioBufferList->mBuffers[0].mDataByteSize);
//------------------------------------------------------------------------------
+ (void)circularBuffer:(TPCircularBuffer *)circularBuffer withSize:(int)size
{
[EZAudioUtilities circularBuffer:circularBuffer withSize:size];
}
+(void)freeCircularBuffer:(TPCircularBuffer *)circularBuffer {
TPCircularBufferClear(circularBuffer);
TPCircularBufferCleanup(circularBuffer);
//------------------------------------------------------------------------------
+ (void)freeCircularBuffer:(TPCircularBuffer *)circularBuffer
{
[EZAudioUtilities freeCircularBuffer:circularBuffer];
}
//------------------------------------------------------------------------------
@end
+152
View File
@@ -0,0 +1,152 @@
//
// EZAudioDevice.h
// MicrophoneTest
//
// Created by Syed Haris Ali on 4/3/15.
// Copyright (c) 2015 Syed Haris Ali. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <AudioToolbox/AudioToolbox.h>
#if TARGET_OS_IPHONE
#import <AVFoundation/AVFoundation.h>
#elif TARGET_OS_MAC
#endif
/**
The EZAudioDevice provides an interface for getting the available input and output hardware devices on iOS and OSX. On iOS the EZAudioDevice uses the available devices found from the AVAudioSession, while on OSX the EZAudioDevice wraps the AudioHardware API to find any devices that are connected including the built-in devices (for instance, Built-In Microphone, Display Audio). Since the AVAudioSession and AudioHardware APIs are quite different the EZAudioDevice has different properties available on each platform. The EZMicrophone now supports setting any specific EZAudioDevice from the `inputDevices` function.
*/
@interface EZAudioDevice : NSObject
//------------------------------------------------------------------------------
#pragma mark - Class Methods
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// @name Getting The Devices
//------------------------------------------------------------------------------
/**
Enumerates all the available input devices and returns the result in an NSArray of EZAudioDevice instances.
@return An NSArray containing EZAudioDevice instances, one for each available input device.
*/
+ (NSArray *)inputDevices;
#if TARGET_OS_IPHONE
/**
Provides the current EZAudioDevice that is being used to pull input.
- iOS only
@return An EZAudioDevice instance representing the currently selected input device.
*/
+ (EZAudioDevice *)currentInputDevice;
//------------------------------------------------------------------------------
/**
Enumerates all the available input devices.
- iOS only
@param block When enumerating this block executes repeatedly for each EZAudioDevice found. It contains two arguments - first, the EZAudioDevice found, then a pointer to a stop BOOL to allow breaking out of the enumeration)
*/
+ (void)enumerateInputDevicesUsingBlock:(void(^)(EZAudioDevice *device,
BOOL *stop))block;
#elif TARGET_OS_MAC
/**
Enumerates all the available devices and returns the result in an NSArray of EZAudioDevice instances.
- OSX only
@return An NSArray of input and output EZAudioDevice instances.
*/
+ (NSArray *)devices;
//------------------------------------------------------------------------------
/**
Enumerates all the available output devices and returns the result in an NSArray of EZAudioDevice instances.
- OSX only
@return An NSArray of output EZAudioDevice instances.
*/
+ (NSArray *)outputDevices;
//------------------------------------------------------------------------------
/**
Enumerates all the available devices.
- OSX only
@param block When enumerating this block executes repeatedly for each EZAudioDevice found. It contains two arguments - first, the EZAudioDevice found, then a pointer to a stop BOOL to allow breaking out of the enumeration)
*/
+ (void)enumerateDevicesUsingBlock:(void(^)(EZAudioDevice *device,
BOOL *stop))block;
#endif
//------------------------------------------------------------------------------
#pragma mark - Properties
//------------------------------------------------------------------------------
/**
An NSString representing a human-reable version of the device.
*/
@property (nonatomic, copy, readonly) NSString *name;
#if TARGET_OS_IPHONE
/**
An AVAudioSessionPortDescription describing an input or output hardware port.
- iOS only
*/
@property (nonatomic, strong, readonly) AVAudioSessionPortDescription *port;
//------------------------------------------------------------------------------
/**
An AVAudioSessionDataSourceDescription describing a specific data source for the `port` provided.
- iOS only
*/
@property (nonatomic, strong, readonly) AVAudioSessionDataSourceDescription *dataSource;
#elif TARGET_OS_MAC
/**
An AudioDeviceID representing the device in the AudioHardware API.
- OSX only
*/
@property (nonatomic, assign, readonly) AudioDeviceID deviceID;
//------------------------------------------------------------------------------
/**
An NSString representing the name of the manufacturer of the device.
- OSX only
*/
@property (nonatomic, copy, readonly) NSString *manufacturer;
//------------------------------------------------------------------------------
/**
An NSInteger representing the number of input channels available.
- OSX only
*/
@property (nonatomic, assign, readonly) NSInteger inputChannelCount;
//------------------------------------------------------------------------------
/**
An NSInteger representing the number of output channels available.
- OSX only
*/
@property (nonatomic, assign, readonly) NSInteger outputChannelCount;
//------------------------------------------------------------------------------
/**
An NSString representing the persistent identifier for the AudioDevice.
- OSX only
*/
@property (nonatomic, copy, readonly) NSString *UID;
#endif
@end
+359
View File
@@ -0,0 +1,359 @@
//
// EZAudioDevice.m
// MicrophoneTest
//
// Created by Syed Haris Ali on 4/3/15.
// Copyright (c) 2015 Syed Haris Ali. All rights reserved.
//
#import "EZAudioDevice.h"
#import "EZAudioUtilities.h"
@interface EZAudioDevice ()
@property (nonatomic, copy, readwrite) NSString *name;
#if TARGET_OS_IPHONE
@property (nonatomic, strong, readwrite) AVAudioSessionPortDescription *port;
@property (nonatomic, strong, readwrite) AVAudioSessionDataSourceDescription *dataSource;
#elif TARGET_OS_MAC
@property (nonatomic, assign, readwrite) AudioDeviceID deviceID;
@property (nonatomic, copy, readwrite) NSString *manufacturer;
@property (nonatomic, assign, readwrite) NSInteger inputChannelCount;
@property (nonatomic, assign, readwrite) NSInteger outputChannelCount;
@property (nonatomic, copy, readwrite) NSString *UID;
#endif
@end
@implementation EZAudioDevice
#if TARGET_OS_IPHONE
//------------------------------------------------------------------------------
+ (EZAudioDevice *)currentInputDevice
{
AVAudioSession *session = [AVAudioSession sharedInstance];
AVAudioSessionPortDescription *port = [[[session currentRoute] inputs] firstObject];
AVAudioSessionDataSourceDescription *dataSource = [session inputDataSource];
EZAudioDevice *device = [[EZAudioDevice alloc] init];
device.port = port;
device.dataSource = dataSource;
return device;
}
//------------------------------------------------------------------------------
+ (NSArray *)inputDevices
{
__block NSMutableArray *devices = [NSMutableArray array];
[self enumerateInputDevicesUsingBlock:^(EZAudioDevice *device, BOOL *stop)
{
[devices addObject:device];
}];
return devices;
}
//------------------------------------------------------------------------------
+ (void)enumerateInputDevicesUsingBlock:(void (^)(EZAudioDevice *, BOOL *))block
{
if (!block)
{
return;
}
NSArray *inputs = [[AVAudioSession sharedInstance] availableInputs];
if (inputs == nil)
{
NSLog(@"Audio session is not active! In order to enumerate the audio devices you must set the category and set active the audio session for your iOS app before calling this function.");
return;
}
BOOL stop;
for (AVAudioSessionPortDescription *inputDevicePortDescription in inputs)
{
// add any additional sub-devices
NSArray *dataSources = [inputDevicePortDescription dataSources];
if (dataSources.count)
{
for (AVAudioSessionDataSourceDescription *inputDeviceDataSourceDescription in dataSources)
{
EZAudioDevice *device = [[EZAudioDevice alloc] init];
device.port = inputDevicePortDescription;
device.dataSource = inputDeviceDataSourceDescription;
block(device, &stop);
}
}
else
{
EZAudioDevice *device = [[EZAudioDevice alloc] init];
device.port = inputDevicePortDescription;
block(device, &stop);
}
}
}
//------------------------------------------------------------------------------
- (NSString *)name
{
NSMutableString *name = [NSMutableString string];
if (self.port)
{
[name appendString:self.port.portName];
}
if (self.dataSource)
{
[name appendFormat:@": %@", self.dataSource.dataSourceName];
}
return name;
}
//------------------------------------------------------------------------------
- (NSString *)description
{
return [NSString stringWithFormat:@"%@ { port: %@, data source: %@ }",
[super description],
self.port,
self.dataSource];
}
//------------------------------------------------------------------------------
- (BOOL)isEqual:(id)object
{
if ([object isKindOfClass:self.class])
{
EZAudioDevice *device = (EZAudioDevice *)object;
BOOL isPortUIDEqual = [device.port.UID isEqualToString:self.port.UID];
BOOL isDataSourceIDEqual = device.dataSource.dataSourceID.longValue == self.dataSource.dataSourceID.longValue;
return isPortUIDEqual && isDataSourceIDEqual;
}
else
{
return [super isEqual:object];
}
}
#elif TARGET_OS_MAC
+ (void)enumerateDevicesUsingBlock:(void(^)(EZAudioDevice *device,
BOOL *stop))block
{
if (!block)
{
return;
}
// get the present system devices
AudioObjectPropertyAddress address = [self addressForPropertySelector:kAudioHardwarePropertyDevices];
UInt32 devicesDataSize;
[EZAudioUtilities checkResult:AudioObjectGetPropertyDataSize(kAudioObjectSystemObject,
&address,
0,
NULL,
&devicesDataSize)
operation:"Failed to get data size"];
// enumerate devices
NSInteger count = devicesDataSize / sizeof(AudioDeviceID);
AudioDeviceID *deviceIDs = (AudioDeviceID *)malloc(devicesDataSize);
// fill in the devices
[EZAudioUtilities checkResult:AudioObjectGetPropertyData(kAudioObjectSystemObject,
&address,
0,
NULL,
&devicesDataSize,
deviceIDs)
operation:"Failed to get device IDs for available devices on OSX"];
BOOL stop = NO;
for (UInt32 i = 0; i < count; i++)
{
AudioDeviceID deviceID = deviceIDs[i];
EZAudioDevice *device = [[EZAudioDevice alloc] init];
device.deviceID = deviceID;
device.manufacturer = [self manufacturerForDeviceID:deviceID];
device.name = [self namePropertyForDeviceID:deviceID];
device.UID = [self UIDPropertyForDeviceID:deviceID];
device.inputChannelCount = [self channelCountForScope:kAudioObjectPropertyScopeInput forDeviceID:deviceID];
device.outputChannelCount = [self channelCountForScope:kAudioObjectPropertyScopeOutput forDeviceID:deviceID];
block(device, &stop);
if (stop)
{
break;
}
}
free(deviceIDs);
}
//------------------------------------------------------------------------------
+ (NSArray *)devices
{
__block NSMutableArray *devices = [NSMutableArray array];
[self enumerateDevicesUsingBlock:^(EZAudioDevice *device, BOOL *stop)
{
[devices addObject:device];
}];
return devices;
}
//------------------------------------------------------------------------------
+ (NSArray *)inputDevices
{
__block NSMutableArray *devices = [NSMutableArray array];
[self enumerateDevicesUsingBlock:^(EZAudioDevice *device, BOOL *stop)
{
if (device.inputChannelCount > 0)
{
[devices addObject:device];
}
}];
return devices;
}
//------------------------------------------------------------------------------
+ (NSArray *)outputDevices
{
__block NSMutableArray *devices = [NSMutableArray array];
[self enumerateDevicesUsingBlock:^(EZAudioDevice *device, BOOL *stop)
{
if (device.outputChannelCount > 0)
{
[devices addObject:device];
}
}];
return devices;
}
//------------------------------------------------------------------------------
#pragma mark - Utility
//------------------------------------------------------------------------------
+ (AudioObjectPropertyAddress)addressForPropertySelector:(AudioObjectPropertySelector)selector
{
AudioObjectPropertyAddress address;
address.mScope = kAudioObjectPropertyScopeGlobal;
address.mElement = kAudioObjectPropertyElementMaster;
address.mSelector = selector;
return address;
}
//------------------------------------------------------------------------------
+ (NSString *)stringPropertyForSelector:(AudioObjectPropertySelector)selector
withDeviceID:(AudioDeviceID)deviceID
{
AudioObjectPropertyAddress address = [self addressForPropertySelector:selector];
CFStringRef string;
UInt32 propSize = sizeof(CFStringRef);
NSString *errorString = [NSString stringWithFormat:@"Failed to get device property (%u)",(unsigned int)selector];
[EZAudioUtilities checkResult:AudioObjectGetPropertyData(deviceID,
&address,
0,
NULL,
&propSize,
&string)
operation:errorString.UTF8String];
return (__bridge_transfer NSString *)string;
}
//------------------------------------------------------------------------------
+ (NSInteger)channelCountForScope:(AudioObjectPropertyScope)scope
forDeviceID:(AudioDeviceID)deviceID
{
AudioObjectPropertyAddress address;
address.mScope = scope;
address.mElement = kAudioObjectPropertyElementMaster;
address.mSelector = kAudioDevicePropertyStreamConfiguration;
AudioBufferList streamConfiguration;
UInt32 propSize = sizeof(streamConfiguration);
[EZAudioUtilities checkResult:AudioObjectGetPropertyData(deviceID,
&address,
0,
NULL,
&propSize,
&streamConfiguration)
operation:"Failed to get frame size"];
NSInteger channelCount = 0;
for (NSInteger i = 0; i < streamConfiguration.mNumberBuffers; i++)
{
channelCount += streamConfiguration.mBuffers[i].mNumberChannels;
}
return channelCount;
}
//------------------------------------------------------------------------------
+ (NSString *)manufacturerForDeviceID:(AudioDeviceID)deviceID
{
return [self stringPropertyForSelector:kAudioDevicePropertyDeviceManufacturerCFString
withDeviceID:deviceID];
}
//------------------------------------------------------------------------------
+ (NSString *)namePropertyForDeviceID:(AudioDeviceID)deviceID
{
return [self stringPropertyForSelector:kAudioDevicePropertyDeviceNameCFString
withDeviceID:deviceID];
}
//------------------------------------------------------------------------------
+ (NSString *)UIDPropertyForDeviceID:(AudioDeviceID)deviceID
{
return [self stringPropertyForSelector:kAudioDevicePropertyDeviceUID
withDeviceID:deviceID];
}
//------------------------------------------------------------------------------
- (NSString *)description
{
return [NSString stringWithFormat:@"%@ { deviceID: %i, manufacturer: %@, name: %@, UID: %@, inputChannelCount: %ld, outputChannelCount: %ld }",
[super description],
self.deviceID,
self.manufacturer,
self.name,
self.UID,
self.inputChannelCount,
self.outputChannelCount];
}
//------------------------------------------------------------------------------
- (BOOL)isEqual:(id)object
{
if ([object isKindOfClass:self.class])
{
EZAudioDevice *device = (EZAudioDevice *)object;
return [self.UID isEqualToString:device.UID];
}
else
{
return [super isEqual:object];
}
}
//------------------------------------------------------------------------------
#endif
@end
+38 -39
View File
@@ -24,8 +24,8 @@
// THE SOFTWARE.
#import "EZAudioFile.h"
#import "EZAudio.h"
#import "AEFloatConverter.h"
#import "EZAudioUtilities.h"
#define kEZAudioFileWaveformDefaultResolution (1024)
@@ -104,17 +104,17 @@
NSAssert(_sourceURL,@"Source URL was not specified correctly.");
// Try to open the file for reading
[EZAudio checkResult:ExtAudioFileOpenURL(_sourceURL,&_audioFile)
[EZAudioUtilities checkResult:ExtAudioFileOpenURL(_sourceURL,&_audioFile)
operation:"Failed to open audio file for reading"];
// Try pulling the stream description
UInt32 size = sizeof(_fileFormat);
[EZAudio checkResult:ExtAudioFileGetProperty(_audioFile,kExtAudioFileProperty_FileDataFormat, &size, &_fileFormat)
[EZAudioUtilities checkResult:ExtAudioFileGetProperty(_audioFile,kExtAudioFileProperty_FileDataFormat, &size, &_fileFormat)
operation:"Failed to get audio stream basic description of input file"];
// Try pulling the total frame size
size = sizeof(_totalFrames);
[EZAudio checkResult:ExtAudioFileGetProperty(_audioFile,kExtAudioFileProperty_FileLengthFrames, &size, &_totalFrames)
[EZAudioUtilities checkResult:ExtAudioFileGetProperty(_audioFile,kExtAudioFileProperty_FileLengthFrames, &size, &_totalFrames)
operation:"Failed to get total frames of input file"];
_totalFrames = MAX(1, _totalFrames);
@@ -124,16 +124,16 @@
// Set the client format on the stream
switch (_fileFormat.mChannelsPerFrame) {
case 1:
_clientFormat = [EZAudio monoFloatFormatWithSampleRate:_fileFormat.mSampleRate];
_clientFormat = [EZAudioUtilities monoFloatFormatWithSampleRate:_fileFormat.mSampleRate];
break;
case 2:
_clientFormat = [EZAudio stereoFloatInterleavedFormatWithSampleRate:_fileFormat.mSampleRate];
_clientFormat = [EZAudioUtilities stereoFloatInterleavedFormatWithSampleRate:_fileFormat.mSampleRate];
break;
default:
break;
}
[EZAudio checkResult:ExtAudioFileSetProperty(_audioFile,
[EZAudioUtilities checkResult:ExtAudioFileSetProperty(_audioFile,
kExtAudioFileProperty_ClientDataFormat,
sizeof (AudioStreamBasicDescription),
&_clientFormat)
@@ -143,13 +143,13 @@
_floatConverter = [[AEFloatConverter alloc] initWithSourceFormat:_clientFormat];
size_t sizeToAllocate = sizeof(float*) * _clientFormat.mChannelsPerFrame;
sizeToAllocate = MAX(8, sizeToAllocate);
_floatBuffers = (float**)malloc( sizeToAllocate );
_floatBuffers = (float**)malloc( sizeToAllocate);
UInt32 outputBufferSize = 32 * 1024; // 32 KB
for ( int i=0; i< _clientFormat.mChannelsPerFrame; i++ ) {
for ( int i=0; i< _clientFormat.mChannelsPerFrame; i++) {
_floatBuffers[i] = (float*)malloc(outputBufferSize);
}
[EZAudio printASBD:_fileFormat];
[EZAudioUtilities printASBD:_fileFormat];
// There's no waveform data yet
_waveformData = NULL;
@@ -164,19 +164,19 @@
audioBufferList:(AudioBufferList *)audioBufferList
bufferSize:(UInt32 *)bufferSize
eof:(BOOL *)eof {
[EZAudio checkResult:ExtAudioFileRead(_audioFile,
[EZAudioUtilities checkResult:ExtAudioFileRead(_audioFile,
&frames,
audioBufferList)
operation:"Failed to read audio data from audio file"];
*bufferSize = audioBufferList->mBuffers[0].mDataByteSize/sizeof(float);
*eof = frames == 0;
_frameIndex += frames;
if( self.audioFileDelegate ){
if( [self.audioFileDelegate respondsToSelector:@selector(audioFile:updatedPosition:)] ){
if (self.audioFileDelegate){
if ([self.audioFileDelegate respondsToSelector:@selector(audioFile:updatedPosition:)]){
[self.audioFileDelegate audioFile:self
updatedPosition:_frameIndex];
}
if( [self.audioFileDelegate respondsToSelector:@selector(audioFile:readAudio:withBufferSize:withNumberOfChannels:)] ){
if ([self.audioFileDelegate respondsToSelector:@selector(audioFile:readAudio:withBufferSize:withNumberOfChannels:)]){
AEFloatConverterToFloat(_floatConverter,audioBufferList,_floatBuffers,frames);
[self.audioFileDelegate audioFile:self
readAudio:_floatBuffers
@@ -187,11 +187,11 @@
}
-(void)seekToFrame:(SInt64)frame {
[EZAudio checkResult:ExtAudioFileSeek(_audioFile,frame)
[EZAudioUtilities checkResult:ExtAudioFileSeek(_audioFile,frame)
operation:"Failed to seek frame position within audio file"];
_frameIndex = frame;
if( self.audioFileDelegate ){
if( [self.audioFileDelegate respondsToSelector:@selector(audioFile:updatedPosition:)] ){
if (self.audioFileDelegate){
if ([self.audioFileDelegate respondsToSelector:@selector(audioFile:updatedPosition:)]){
[self.audioFileDelegate audioFile:self updatedPosition:_frameIndex];
}
}
@@ -206,8 +206,8 @@
SInt64 currentFramePosition = _frameIndex;
if( _waveformData != NULL ){
waveformDataCompletionBlock( _waveformData, _waveformTotalBuffers );
if (_waveformData != NULL){
waveformDataCompletionBlock( _waveformData, _waveformTotalBuffers);
return;
}
@@ -215,24 +215,24 @@
_waveformTotalBuffers = [self minBuffersWithFrameRate:_waveformFrameRate];
_waveformData = (float*)malloc(sizeof(float)*_waveformTotalBuffers);
if( self.totalFrames == 0 ){
waveformDataCompletionBlock( _waveformData, _waveformTotalBuffers );
if (self.totalFrames == 0){
waveformDataCompletionBlock( _waveformData, _waveformTotalBuffers);
return;
}
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0ul), ^{
for( int i = 0; i < _waveformTotalBuffers; i++ ){
for( int i = 0; i < _waveformTotalBuffers; i++){
// Take a snapshot of each buffer through the audio file to form the waveform
AudioBufferList *bufferList = [EZAudio audioBufferListWithNumberOfFrames:_waveformFrameRate
AudioBufferList *bufferList = [EZAudioUtilities audioBufferListWithNumberOfFrames:_waveformFrameRate
numberOfChannels:_clientFormat.mChannelsPerFrame
interleaved:YES];
UInt32 bufferSize;
BOOL eof;
// Read in the specified number of frames
[EZAudio checkResult:ExtAudioFileRead(_audioFile,
[EZAudioUtilities checkResult:ExtAudioFileRead(_audioFile,
&_waveformFrameRate,
bufferList)
operation:"Failed to read audio data from audio file"];
@@ -242,23 +242,23 @@
_frameIndex += _waveformFrameRate;
// Calculate RMS of each buffer
float rms = [EZAudio RMS:bufferList->mBuffers[0].mData
float rms = [EZAudioUtilities RMS:bufferList->mBuffers[0].mData
length:bufferSize];
_waveformData[i] = rms;
// Since we malloc'ed, we should cleanup
[EZAudio freeBufferList:bufferList];
[EZAudioUtilities freeBufferList:bufferList];
}
// Seek the audio file back to the beginning
[EZAudio checkResult:ExtAudioFileSeek(_audioFile,currentFramePosition)
[EZAudioUtilities checkResult:ExtAudioFileSeek(_audioFile,currentFramePosition)
operation:"Failed to seek frame position within audio file"];
_frameIndex = currentFramePosition;
// Once we're done send off the waveform data
dispatch_async(dispatch_get_main_queue(), ^{
waveformDataCompletionBlock( _waveformData, _waveformTotalBuffers );
waveformDataCompletionBlock( _waveformData, _waveformTotalBuffers);
});
});
@@ -281,8 +281,7 @@
{
AudioFileID audioFileID;
UInt32 propSize = sizeof(audioFileID);
[EZAudio checkResult:ExtAudioFileGetProperty(_audioFile,
[EZAudioUtilities checkResult:ExtAudioFileGetProperty(_audioFile,
kExtAudioFileProperty_AudioFile,
&propSize,
&audioFileID)
@@ -290,13 +289,13 @@
CFDictionaryRef metadata;
UInt32 isWritable;
[EZAudio checkResult:AudioFileGetPropertyInfo(audioFileID,
[EZAudioUtilities checkResult:AudioFileGetPropertyInfo(audioFileID,
kAudioFilePropertyInfoDictionary,
&propSize,
&isWritable)
operation:"Failed to get the size of the metadata dictionary"];
[EZAudio checkResult:AudioFileGetProperty(audioFileID,
[EZAudioUtilities checkResult:AudioFileGetProperty(audioFileID,
kAudioFilePropertyInfoDictionary,
&propSize,
&metadata)
@@ -319,9 +318,9 @@
#pragma mark - Setters
-(void)setWaveformResolution:(UInt32)waveformResolution {
if( _waveformResolution != waveformResolution ){
if (_waveformResolution != waveformResolution){
_waveformResolution = waveformResolution;
if( _waveformData ){
if (_waveformData){
free(_waveformData);
_waveformData = NULL;
}
@@ -347,19 +346,19 @@
#pragma mark - Cleanup
-(void)dealloc {
if( _waveformData ){
if (_waveformData){
free(_waveformData);
_waveformData = NULL;
}
// if( _floatBuffers ){
// if (_floatBuffers){
// free(_floatBuffers);
// _floatBuffers = NULL;
// }
_frameIndex = 0;
_waveformFrameRate = 0;
_waveformTotalBuffers = 0;
if( _audioFile ){
[EZAudio checkResult:ExtAudioFileDispose(_audioFile)
if (_audioFile){
[EZAudioUtilities checkResult:ExtAudioFileDispose(_audioFile)
operation:"Failed to dispose of audio file"];
}
}
+75
View File
@@ -0,0 +1,75 @@
//
// EZAudioFloatConverter.h
// EZAudio
//
// Created by Syed Haris Ali on 6/23/15.
// Copyright (c) 2013 Syed Haris Ali. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import <Foundation/Foundation.h>
#import <AudioToolbox/AudioToolbox.h>
//------------------------------------------------------------------------------
#pragma mark - Constants
//------------------------------------------------------------------------------
FOUNDATION_EXPORT UInt32 const EZAudioFloatConverterDefaultPacketSize;
//------------------------------------------------------------------------------
#pragma mark - EZAudioFloatConverter
//------------------------------------------------------------------------------
@interface EZAudioFloatConverter : NSObject
//------------------------------------------------------------------------------
#pragma mark - Class Methods
//------------------------------------------------------------------------------
+ (instancetype)converterWithInputFormat:(AudioStreamBasicDescription)inputFormat;
//------------------------------------------------------------------------------
#pragma mark - Properties
//------------------------------------------------------------------------------
@property (nonatomic, assign, readonly) AudioStreamBasicDescription inputFormat;
@property (nonatomic, assign, readonly) AudioStreamBasicDescription floatFormat;
//------------------------------------------------------------------------------
#pragma mark - Instance Methods
//------------------------------------------------------------------------------
- (instancetype)initWithInputFormat:(AudioStreamBasicDescription)inputFormat;
//------------------------------------------------------------------------------
- (void)convertDataFromAudioBufferList:(AudioBufferList *)audioBufferList
withNumberOfFrames:(UInt32)frames
toFloatBuffers:(float **)buffers;
//------------------------------------------------------------------------------
- (void)convertDataFromAudioBufferList:(AudioBufferList *)audioBufferList
withNumberOfFrames:(UInt32)frames
toFloatBuffers:(float **)buffers
packetDescriptions:(AudioStreamPacketDescription *)packetDescriptions;
//------------------------------------------------------------------------------
@end
+224
View File
@@ -0,0 +1,224 @@
//
// EZAudioFloatConverter.m
// EZAudio
//
// Created by Syed Haris Ali on 6/23/15.
// Copyright (c) 2013 Syed Haris Ali. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import "EZAudioFloatConverter.h"
#import "EZAudioUtilities.h"
//------------------------------------------------------------------------------
#pragma mark - Constants
//------------------------------------------------------------------------------
static UInt32 EZAudioFloatConverterDefaultOutputBufferSize = 128 * 32;
UInt32 const EZAudioFloatConverterDefaultPacketSize = 2048;
//------------------------------------------------------------------------------
#pragma mark - Data Structures
//------------------------------------------------------------------------------
typedef struct
{
AudioConverterRef converterRef;
AudioBufferList *floatAudioBufferList;
AudioStreamBasicDescription inputFormat;
AudioStreamBasicDescription outputFormat;
AudioStreamPacketDescription *packetDescriptions;
UInt32 packetsPerBuffer;
} EZAudioFloatConverterInfo;
//------------------------------------------------------------------------------
#pragma mark - Callbacks
//------------------------------------------------------------------------------
OSStatus EZAudioFloatConverterCallback(AudioConverterRef inAudioConverter,
UInt32 *ioNumberDataPackets,
AudioBufferList *ioData,
AudioStreamPacketDescription **outDataPacketDescription,
void *inUserData)
{
AudioBufferList *sourceBuffer = (AudioBufferList *)inUserData;
memcpy(ioData,
sourceBuffer,
sizeof(AudioBufferList) + (sourceBuffer->mNumberBuffers - 1)*sizeof(AudioBuffer));
return noErr;
}
//------------------------------------------------------------------------------
#pragma mark - EZAudioFloatConverter (Interface Extension)
//------------------------------------------------------------------------------
@interface EZAudioFloatConverter ()
@property (nonatomic, assign) EZAudioFloatConverterInfo *info;
@end
//------------------------------------------------------------------------------
#pragma mark - EZAudioFloatConverter (Implementation)
//------------------------------------------------------------------------------
@implementation EZAudioFloatConverter
//------------------------------------------------------------------------------
#pragma mark - Class Methods
//------------------------------------------------------------------------------
+ (instancetype)converterWithInputFormat:(AudioStreamBasicDescription)inputFormat
{
return [[self alloc] initWithInputFormat:inputFormat];
}
//------------------------------------------------------------------------------
#pragma mark - Dealloc
//------------------------------------------------------------------------------
- (void)dealloc
{
AudioConverterDispose(self.info->converterRef);
[EZAudioUtilities freeBufferList:self.info->floatAudioBufferList];
free(self.info->packetDescriptions);
free(self.info);
}
//------------------------------------------------------------------------------
#pragma mark - Initialization
//------------------------------------------------------------------------------
- (instancetype)initWithInputFormat:(AudioStreamBasicDescription)inputFormat
{
self = [super init];
if (self)
{
self.info = (EZAudioFloatConverterInfo *)malloc(sizeof(EZAudioFloatConverterInfo));
memset(self.info, 0, sizeof(EZAudioFloatConverterInfo));
self.info->inputFormat = inputFormat;
[self setup];
}
return self;
}
//------------------------------------------------------------------------------
#pragma mark - Setup
//------------------------------------------------------------------------------
- (void)setup
{
// create output format
self.info->outputFormat = [EZAudioUtilities floatFormatWithNumberOfChannels:self.info->inputFormat.mChannelsPerFrame
sampleRate:self.info->inputFormat.mSampleRate];
// create a new instance of the audio converter
[EZAudioUtilities checkResult:AudioConverterNew(&self.info->inputFormat,
&self.info->outputFormat,
&self.info->converterRef)
operation:"Failed to create new audio converter"];
// get max packets per buffer so you can allocate a proper AudioBufferList
UInt32 packetsPerBuffer = 0;
UInt32 outputBufferSize = EZAudioFloatConverterDefaultOutputBufferSize;
UInt32 sizePerPacket = self.info->inputFormat.mBytesPerPacket;
BOOL isVBR = sizePerPacket == 0;
// VBR
if (isVBR)
{
// determine the max output buffer size
UInt32 maxOutputPacketSize;
UInt32 propSize = sizeof(maxOutputPacketSize);
OSStatus result = AudioConverterGetProperty(self.info->converterRef,
kAudioConverterPropertyMaximumOutputPacketSize,
&propSize,
&maxOutputPacketSize);
if (result != noErr)
{
maxOutputPacketSize = EZAudioFloatConverterDefaultPacketSize;
}
// set the output buffer size to at least the max output size
if (maxOutputPacketSize > outputBufferSize)
{
outputBufferSize = maxOutputPacketSize;
}
packetsPerBuffer = outputBufferSize / maxOutputPacketSize;
// allocate memory for the packet descriptions
self.info->packetDescriptions = (AudioStreamPacketDescription *)malloc(sizeof(AudioStreamPacketDescription) * packetsPerBuffer);
}
else
{
packetsPerBuffer = outputBufferSize / sizePerPacket;
}
self.info->packetsPerBuffer = packetsPerBuffer;
// allocate the AudioBufferList to hold the float values
BOOL isInterleaved = [EZAudioUtilities isInterleaved:self.info->outputFormat];
self.info->floatAudioBufferList = [EZAudioUtilities audioBufferListWithNumberOfFrames:packetsPerBuffer
numberOfChannels:self.info->outputFormat.mChannelsPerFrame
interleaved:isInterleaved];
}
//------------------------------------------------------------------------------
#pragma mark - Events
//------------------------------------------------------------------------------
- (void)convertDataFromAudioBufferList:(AudioBufferList *)audioBufferList
withNumberOfFrames:(UInt32)frames
toFloatBuffers:(float **)buffers
{
[self convertDataFromAudioBufferList:audioBufferList
withNumberOfFrames:frames
toFloatBuffers:buffers
packetDescriptions:self.info->packetDescriptions];
}
//------------------------------------------------------------------------------
- (void)convertDataFromAudioBufferList:(AudioBufferList *)audioBufferList
withNumberOfFrames:(UInt32)frames
toFloatBuffers:(float **)buffers
packetDescriptions:(AudioStreamPacketDescription *)packetDescriptions
{
if (frames == 0)
{
}
else
{
[EZAudioUtilities checkResult:AudioConverterFillComplexBuffer(self.info->converterRef,
EZAudioFloatConverterCallback,
audioBufferList,
&frames,
self.info->floatAudioBufferList,
packetDescriptions ? packetDescriptions : self.info->packetDescriptions)
operation:"Failed to fill complex buffer in float converter"];
for (int i = 0; i < self.info->floatAudioBufferList->mNumberBuffers; i++)
{
memcpy(buffers[i],
self.info->floatAudioBufferList->mBuffers[i].mData,
self.info->floatAudioBufferList->mBuffers[i].mDataByteSize);
}
}
}
//------------------------------------------------------------------------------
@end
+52
View File
@@ -0,0 +1,52 @@
//
// EZAudioFloatData.h
// EZAudio
//
// Created by Syed Haris Ali on 6/23/15.
// Copyright (c) 2013 Syed Haris Ali. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import <Foundation/Foundation.h>
//------------------------------------------------------------------------------
#pragma mark - EZAudioFloatData
//------------------------------------------------------------------------------
@interface EZAudioFloatData : NSObject
//------------------------------------------------------------------------------
+ (instancetype)dataWithNumberOfChannels:(int)numberOfChannels
buffers:(float **)buffers
bufferSize:(UInt32)bufferSize;
//------------------------------------------------------------------------------
@property (nonatomic, assign, readonly) int numberOfChannels;
@property (nonatomic, assign, readonly) float **buffers;
@property (nonatomic, assign, readonly) UInt32 bufferSize;
//------------------------------------------------------------------------------
- (float *)bufferForChannel:(int)channel;
//------------------------------------------------------------------------------
@end
+85
View File
@@ -0,0 +1,85 @@
//
// EZAudioFloatData.m
// EZAudio
//
// Created by Syed Haris Ali on 6/23/15.
// Copyright (c) 2013 Syed Haris Ali. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import "EZAudioFloatData.h"
#import "EZAudioUtilities.h"
//------------------------------------------------------------------------------
#pragma mark - EZAudioFloatData
//------------------------------------------------------------------------------
@interface EZAudioFloatData ()
@property (nonatomic, assign, readwrite) int numberOfChannels;
@property (nonatomic, assign, readwrite) float **buffers;
@property (nonatomic, assign, readwrite) UInt32 bufferSize;
@end
//------------------------------------------------------------------------------
@implementation EZAudioFloatData
//------------------------------------------------------------------------------
- (void)dealloc
{
[EZAudioUtilities freeFloatBuffers:self.buffers
numberOfChannels:self.numberOfChannels];
}
//------------------------------------------------------------------------------
+ (instancetype)dataWithNumberOfChannels:(int)numberOfChannels
buffers:(float **)buffers
bufferSize:(UInt32)bufferSize
{
id data = [[self alloc] init];
size_t size = sizeof(float) * bufferSize;
float **buffersCopy = [EZAudioUtilities floatBuffersWithNumberOfFrames:bufferSize
numberOfChannels:numberOfChannels];
for (int i = 0; i < numberOfChannels; i++)
{
memcpy(buffersCopy[i], buffers[i], size);
}
((EZAudioFloatData *)data).buffers = buffersCopy;
((EZAudioFloatData *)data).bufferSize = bufferSize;
((EZAudioFloatData *)data).numberOfChannels = numberOfChannels;
return data;
}
//------------------------------------------------------------------------------
- (float *)bufferForChannel:(int)channel
{
float *buffer = NULL;
if (channel < self.numberOfChannels)
{
buffer = self.buffers[channel];
}
return buffer;
}
//------------------------------------------------------------------------------
@end
+3 -2
View File
@@ -25,8 +25,8 @@
#import <Foundation/Foundation.h>
#import "TargetConditionals.h"
#import "EZAudio.h"
#import "EZAudioFile.h"
#import "EZOutput.h"
#if TARGET_OS_IPHONE
#import <AVFoundation/AVFoundation.h>
@@ -35,6 +35,7 @@
@class EZAudioPlayer;
/**
The EZAudioPlayerDelegate provides event callbacks for the EZAudioPlayer. These type of events are triggered by changes in the EZAudioPlayer's state and allow someone implementing the EZAudioPlayer to more easily update their user interface. Events are triggered anytime the EZAudioPlayer resumes/pauses playback, reaches the end of the file, reads audio data and converts it to float data visualizations (using the EZAudioFile), and updates its cursor position within the audio file during playback (use this for the play position on a slider on the user interface).
@warning These callbacks don't necessarily occur on the main thread so make sure you wrap any UI code in a GCD block like: dispatch_async(dispatch_get_main_queue(), ^{ // Update UI });
+21 -20
View File
@@ -24,6 +24,7 @@
// THE SOFTWARE.
#import "EZAudioPlayer.h"
#import "EZAudioUtilities.h"
#if TARGET_OS_IPHONE
#elif TARGET_OS_MAC
@@ -124,11 +125,11 @@
AVAudioSession *audioSession = [AVAudioSession sharedInstance];
NSError *err = NULL;
[audioSession setCategory:AVAudioSessionCategoryPlayAndRecord error:&err];
if( err ){
if (err){
NSLog(@"There was an error creating the audio session");
}
[audioSession overrideOutputAudioPort:AVAudioSessionPortOverrideSpeaker error:NULL];
if( err ){
if (err){
NSLog(@"There was an error sending the audio to the speakers");
}
#elif TARGET_OS_MAC
@@ -143,7 +144,7 @@
-(float)currentTime {
NSAssert(_audioFile,@"No audio file to perform the seek on, check that EZAudioFile is not nil");
return [EZAudio MAP:self.audioFile.frameIndex
return [EZAudioUtilities MAP:self.audioFile.frameIndex
leftMin:0
leftMax:self.audioFile.totalFrames
rightMin:0
@@ -185,7 +186,7 @@
#pragma mark - Setters
-(void)setAudioFile:(EZAudioFile *)audioFile {
if( _audioFile ){
if (_audioFile){
_audioFile.audioFileDelegate = nil;
}
_eof = NO;
@@ -202,13 +203,13 @@
#pragma mark - Methods
-(void)play {
NSAssert(_audioFile,@"No audio file to perform the seek on, check that EZAudioFile is not nil");
if( _audioFile ){
if (_audioFile){
[_output startPlayback];
if( self.frameIndex != self.totalFrames ){
if (self.frameIndex != self.totalFrames){
_eof = NO;
}
if( self.audioPlayerDelegate ){
if( [self.audioPlayerDelegate respondsToSelector:@selector(audioPlayer:didResumePlaybackOnAudioFile:)] ){
if (self.audioPlayerDelegate){
if ([self.audioPlayerDelegate respondsToSelector:@selector(audioPlayer:didResumePlaybackOnAudioFile:)]){
// Notify the delegate we're starting playback
[self.audioPlayerDelegate audioPlayer:self didResumePlaybackOnAudioFile:_audioFile];
}
@@ -218,10 +219,10 @@
-(void)pause {
NSAssert(self.audioFile,@"No audio file to perform the seek on, check that EZAudioFile is not nil");
if( _audioFile ){
if (_audioFile){
[_output stopPlayback];
if( self.audioPlayerDelegate ){
if( [self.audioPlayerDelegate respondsToSelector:@selector(audioPlayer:didPausePlaybackOnAudioFile:)] ){
if (self.audioPlayerDelegate){
if ([self.audioPlayerDelegate respondsToSelector:@selector(audioPlayer:didPausePlaybackOnAudioFile:)]){
// Notify the delegate we're pausing playback
[self.audioPlayerDelegate audioPlayer:self didPausePlaybackOnAudioFile:_audioFile];
}
@@ -231,17 +232,17 @@
-(void)seekToFrame:(SInt64)frame {
NSAssert(_audioFile,@"No audio file to perform the seek on, check that EZAudioFile is not nil");
if( _audioFile ){
if (_audioFile){
[_audioFile seekToFrame:frame];
}
if( self.frameIndex != self.totalFrames ){
if (self.frameIndex != self.totalFrames){
_eof = NO;
}
}
-(void)stop {
NSAssert(_audioFile,@"No audio file to perform the seek on, check that EZAudioFile is not nil");
if( _audioFile ){
if (_audioFile){
[_output stopPlayback];
[_audioFile seekToFrame:0];
_eof = NO;
@@ -253,8 +254,8 @@
readAudio:(float **)buffer
withBufferSize:(UInt32)bufferSize
withNumberOfChannels:(UInt32)numberOfChannels {
if( self.audioPlayerDelegate ){
if( [self.audioPlayerDelegate respondsToSelector:@selector(audioPlayer:readAudio:withBufferSize:withNumberOfChannels:inAudioFile:)] ){
if (self.audioPlayerDelegate){
if ([self.audioPlayerDelegate respondsToSelector:@selector(audioPlayer:readAudio:withBufferSize:withNumberOfChannels:inAudioFile:)]){
[self.audioPlayerDelegate audioPlayer:self
readAudio:buffer
withBufferSize:bufferSize
@@ -265,8 +266,8 @@ withNumberOfChannels:(UInt32)numberOfChannels {
}
-(void)audioFile:(EZAudioFile *)audioFile updatedPosition:(SInt64)framePosition {
if( self.audioPlayerDelegate ){
if( [self.audioPlayerDelegate respondsToSelector:@selector(audioPlayer:updatedPosition:inAudioFile:)] ){
if (self.audioPlayerDelegate){
if ([self.audioPlayerDelegate respondsToSelector:@selector(audioPlayer:updatedPosition:inAudioFile:)]){
[self.audioPlayerDelegate audioPlayer:self
updatedPosition:framePosition
inAudioFile:audioFile];
@@ -279,14 +280,14 @@ withNumberOfChannels:(UInt32)numberOfChannels {
shouldFillAudioBufferList:(AudioBufferList *)audioBufferList
withNumberOfFrames:(UInt32)frames
{
if( self.audioFile )
if (self.audioFile)
{
UInt32 bufferSize;
[self.audioFile readFrames:frames
audioBufferList:audioBufferList
bufferSize:&bufferSize
eof:&_eof];
if( _eof && self.shouldLoop )
if (_eof && self.shouldLoop)
{
[self seekToFrame:0];
}
+16 -17
View File
@@ -24,8 +24,7 @@
// THE SOFTWARE.
#import "EZAudioPlot.h"
#import "EZAudio.h"
#import "EZAudioUtilities.h"
@interface EZAudioPlot () {
// BOOL _hasData;
@@ -136,7 +135,7 @@
#pragma mark - Get Data
-(void)setSampleData:(float *)data
length:(int)length {
if( plotData != nil ){
if (plotData != nil){
free(plotData);
}
@@ -153,10 +152,10 @@
#pragma mark - Update
-(void)updateBuffer:(float *)buffer withBufferSize:(UInt32)bufferSize {
if( _plotType == EZPlotTypeRolling ){
if (_plotType == EZPlotTypeRolling){
// Update the scroll history datasource
[EZAudio updateScrollHistory:&_scrollHistory
[EZAudioUtilities updateScrollHistory:&_scrollHistory
withLength:_scrollHistoryLength
atIndex:&_scrollHistoryIndex
withBuffer:buffer
@@ -169,7 +168,7 @@
_setMaxLength = YES;
}
else if( _plotType == EZPlotTypeBuffer ){
else if (_plotType == EZPlotTypeBuffer){
[self setSampleData:buffer
length:bufferSize];
@@ -221,7 +220,7 @@
CGMutablePathRef path = CGPathCreateMutable();
double xscale = (frame.size.width) / (float)plotLength;
double halfHeight = floor( frame.size.height / 2.0 );
double halfHeight = floor( frame.size.height / 2.0);
// iOS drawing origin is flipped by default so make sure we account for that
int deviceOriginFlipped = 1;
@@ -232,23 +231,23 @@
#endif
CGAffineTransform xf = CGAffineTransformIdentity;
xf = CGAffineTransformTranslate( xf, frame.origin.x , halfHeight + frame.origin.y );
xf = CGAffineTransformScale( xf, xscale, deviceOriginFlipped*halfHeight );
CGPathAddPath( path, &xf, halfPath );
xf = CGAffineTransformTranslate( xf, frame.origin.x , halfHeight + frame.origin.y);
xf = CGAffineTransformScale( xf, xscale, deviceOriginFlipped*halfHeight);
CGPathAddPath( path, &xf, halfPath);
if( self.shouldMirror ){
if (self.shouldMirror){
xf = CGAffineTransformIdentity;
xf = CGAffineTransformTranslate( xf, frame.origin.x , halfHeight + frame.origin.y);
xf = CGAffineTransformScale( xf, xscale, -deviceOriginFlipped*(halfHeight));
CGPathAddPath( path, &xf, halfPath );
CGPathAddPath( path, &xf, halfPath);
}
CGPathRelease( halfPath );
CGPathRelease( halfPath);
// Now, path contains the full waveform path.
CGContextAddPath(ctx, path);
// Make this color customizable
if( self.shouldFill ){
if (self.shouldFill){
CGContextFillPath(ctx);
}
else {
@@ -269,11 +268,11 @@
historyLength = MIN(historyLength,kEZAudioPlotMaxHistoryBufferLength);
size_t floatByteSize = sizeof(float);
_changingHistorySize = YES;
if( _scrollHistoryLength != historyLength ){
if (_scrollHistoryLength != historyLength){
_scrollHistoryLength = historyLength;
}
_scrollHistory = realloc(_scrollHistory,_scrollHistoryLength*floatByteSize);
if( _scrollHistoryIndex < _scrollHistoryLength ){
if (_scrollHistoryIndex < _scrollHistoryLength){
memset(&_scrollHistory[_scrollHistoryIndex],
0,
(_scrollHistoryLength-_scrollHistoryIndex)*floatByteSize);
@@ -290,7 +289,7 @@
}
-(void)dealloc {
if( plotData ){
if (plotData){
free(plotData);
}
}
+65 -64
View File
@@ -24,8 +24,8 @@
// THE SOFTWARE.
#import "EZAudioPlotGL.h"
#import "EZAudio.h"
#import "EZAudioUtilities.h"
#import "EZAudioPlot.h"
#if TARGET_OS_IPHONE
#import "EZAudioPlotGLKViewController.h"
@@ -210,7 +210,7 @@
if( _copiedBuffer == NULL ){
if (_copiedBuffer == NULL){
_copiedBuffer = (float*)malloc(bufferSize*sizeof(float));
}
_copiedBufferSize = bufferSize;
@@ -262,7 +262,8 @@
}
-(void)_setupProfile {
NSOpenGLPixelFormatAttribute attrs[] =
NSOpenGLPixelFormatAttribute attrs[] =
{
NSOpenGLPFADoubleBuffer,
NSOpenGLPFAMultisample,
@@ -273,20 +274,20 @@
NSOpenGLProfileVersion3_2Core, 0
};
NSOpenGLPixelFormat *pf = [[NSOpenGLPixelFormat alloc] initWithAttributes:attrs];
NSOpenGLPixelFormat *pf = [[NSOpenGLPixelFormat alloc] initWithAttributes:attrs];
NSOpenGLContext *context = [[NSOpenGLContext alloc] initWithFormat:pf
shareContext:nil];
if (!pf)
{
NSLog(@"No OpenGL pixel format");
}
NSOpenGLContext* context = [[NSOpenGLContext alloc] initWithFormat:pf shareContext:nil];
// Debug only
CGLEnable([context CGLContextObj], kCGLCECrashOnRemovedFunctions);
self.pixelFormat = pf;
self.openGLContext = context;
// Debug only
CGLEnable([context CGLContextObj], kCGLCECrashOnRemovedFunctions);
self.pixelFormat = pf;
self.openGLContext = context;
}
-(void)_setupView {
@@ -296,30 +297,30 @@
#pragma mark - Prepare
-(void)prepareOpenGL {
[super prepareOpenGL];
GLint swapInt = 1;
[self.openGLContext setValues:&swapInt forParameter:NSOpenGLCPSwapInterval];
////////////////////////////////////////////////////////////////////////////
// Setup VABs and VBOs //
////////////////////////////////////////////////////////////////////////////
// Buffer
glGenVertexArrays(1,&_bufferPlotVAB);
glBindVertexArray(_bufferPlotVAB);
glGenBuffers(1,&_bufferPlotVBO);
glBindBuffer(GL_ARRAY_BUFFER,_bufferPlotVBO);
// Rolling
glGenVertexArrays(1,&_rollingPlotVAB);
glBindVertexArray(_rollingPlotVAB);
glGenBuffers(1,&_rollingPlotVBO);
glBindBuffer(GL_ARRAY_BUFFER,_rollingPlotVBO);
if( self.shouldFill ){
[super prepareOpenGL];
GLint swapInt = 1;
[self.openGLContext setValues:&swapInt forParameter:NSOpenGLCPSwapInterval];
////////////////////////////////////////////////////////////////////////////
// Setup VABs and VBOs //
////////////////////////////////////////////////////////////////////////////
// Buffer
glGenVertexArrays(1,&_bufferPlotVAB);
glBindVertexArray(_bufferPlotVAB);
glGenBuffers(1,&_bufferPlotVBO);
glBindBuffer(GL_ARRAY_BUFFER,_bufferPlotVBO);
// Rolling
glGenVertexArrays(1,&_rollingPlotVAB);
glBindVertexArray(_rollingPlotVAB);
glGenBuffers(1,&_rollingPlotVBO);
glBindBuffer(GL_ARRAY_BUFFER,_rollingPlotVBO);
}
if (self.shouldFill){
glBindVertexArray(_rollingPlotVAB);
glBindBuffer(GL_ARRAY_BUFFER,_rollingPlotVBO);
}
// Enable anti-aliasing
glEnable(GL_MULTISAMPLE);
@@ -327,14 +328,14 @@
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glClearColor(0, 0, 0, 0);
self.layer = nil;
self.wantsBestResolutionOpenGLSurface = YES;
// Set the background color
[self _refreshWithBackgroundColor:self.backgroundColor];
[self _refreshWithColor:self.color];
// Setup the display link (rendering loop)
[self _setupDisplayLink];
// Set the background color
[self _refreshWithBackgroundColor:self.backgroundColor];
[self _refreshWithColor:self.color];
// Setup the display link (rendering loop)
[self _setupDisplayLink];
}
-(void)_setupDisplayLink {
@@ -403,9 +404,9 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink,
// If starting with a VBO of half of our max size make sure we initialize it to anticipate
// a filled graph (which needs 2 * bufferSize) to allocate its resources properly
if( !_hasBufferPlotData && _drawingType == EZAudioPlotGLDrawTypeLineStrip ){
if (!_hasBufferPlotData && _drawingType == EZAudioPlotGLDrawTypeLineStrip){
EZAudioPlotGLPoint maxGraph[2*bufferSize];
glBufferData(GL_ARRAY_BUFFER, sizeof(maxGraph), maxGraph, GL_STREAM_DRAW );
glBufferData(GL_ARRAY_BUFFER, sizeof(maxGraph), maxGraph, GL_STREAM_DRAW);
_hasBufferPlotData = YES;
}
@@ -425,7 +426,7 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink,
withGain:self.gain];
// Update the drawing
if( !_hasBufferPlotData ){
if (!_hasBufferPlotData){
glBufferData(GL_ARRAY_BUFFER, sizeof(graph) , graph, GL_STREAM_DRAW);
_hasBufferPlotData = YES;
@@ -452,9 +453,9 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink,
// If starting with a VBO of half of our max size make sure we initialize it to anticipate
// a filled graph (which needs 2 * bufferSize) to allocate its resources properly
if( !_hasRollingPlotData ){
if (!_hasRollingPlotData){
EZAudioPlotGLPoint maxGraph[2*kEZAudioPlotMaxHistoryBufferLength];
glBufferData(GL_ARRAY_BUFFER, sizeof(maxGraph), maxGraph, GL_STREAM_DRAW );
glBufferData(GL_ARRAY_BUFFER, sizeof(maxGraph), maxGraph, GL_STREAM_DRAW);
_hasRollingPlotData = YES;
}
@@ -468,7 +469,7 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink,
// Update the scroll history datasource
[EZAudio updateScrollHistory:&_scrollHistory
[EZAudioUtilities updateScrollHistory:&_scrollHistory
withLength:_scrollHistoryLength
atIndex:&_scrollHistoryIndex
withBuffer:buffer
@@ -484,7 +485,7 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink,
withGain:self.gain];
// Update the drawing
if( !_hasRollingPlotData ){
if (!_hasRollingPlotData){
glBufferData(GL_ARRAY_BUFFER, sizeof(graph), graph, GL_STREAM_DRAW);
_hasRollingPlotData = YES;
}
@@ -507,9 +508,9 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink,
CGLLockContext([[self openGLContext] CGLContextObj]);
// Draw frame
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
if( _hasBufferPlotData || _hasRollingPlotData ){
if (_hasBufferPlotData || _hasRollingPlotData){
// Plot either a buffer plot or a rolling plot
switch(_plotType) {
case EZPlotTypeBuffer:
@@ -545,7 +546,7 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink,
glDrawArrays(_drawingType,0,_bufferPlotGraphSize);
// Mirrored
if( self.shouldMirror ){
if (self.shouldMirror){
[self.baseEffect prepareToDraw];
self.baseEffect.transform.modelviewMatrix = GLKMatrix4MakeXRotation(M_PI);
@@ -575,7 +576,7 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink,
glDrawArrays(_drawingType, 0,_rollingPlotGraphSize);
// Mirrored
if( self.shouldMirror ){
if (self.shouldMirror){
[self.baseEffect prepareToDraw];
self.baseEffect.transform.modelviewMatrix = GLKMatrix4MakeXRotation(M_PI);
@@ -649,8 +650,8 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink,
CVDisplayLinkStop(_displayLink);
CVDisplayLinkRelease(_displayLink);
if( _copiedBuffer != NULL ){
free( _copiedBuffer );
if (_copiedBuffer != NULL){
free( _copiedBuffer);
}
}
#endif
@@ -664,11 +665,11 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink,
historyLength = MIN(historyLength,kEZAudioPlotMaxHistoryBufferLength);
size_t floatByteSize = sizeof(float);
_changingHistorySize = YES;
if( _scrollHistoryLength != historyLength ){
if (_scrollHistoryLength != historyLength){
_scrollHistoryLength = historyLength;
}
_scrollHistory = realloc(_scrollHistory,_scrollHistoryLength*floatByteSize);
if( _scrollHistoryIndex < _scrollHistoryLength ){
if (_scrollHistoryIndex < _scrollHistoryLength){
memset(&_scrollHistory[_scrollHistoryIndex],
0,
(_scrollHistoryLength-_scrollHistoryIndex)*floatByteSize);
@@ -705,10 +706,10 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink,
withBuffer:(float*)buffer
withBufferSize:(UInt32)bufferSize
withGain:(float)gain {
if( drawingType == EZAudioPlotGLDrawTypeLineStrip ){
if (drawingType == EZAudioPlotGLDrawTypeLineStrip){
// graph size = buffer size to stroke waveform
for(int i = 0; i < graphSize; i++){
float x = [EZAudio MAP:i
float x = [EZAudioUtilities MAP:i
leftMin:0
leftMax:bufferSize
rightMin:-1.0
@@ -717,15 +718,15 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink,
graph[i].y = gain*buffer[i];
}
}
else if( drawingType == EZAudioPlotGLDrawTypeTriangleStrip ) {
else if (drawingType == EZAudioPlotGLDrawTypeTriangleStrip) {
// graph size = 2 * buffer size to draw triangles and fill regions properly
for(int i = 0; i < graphSize; i+=2){
int bufferIndex = (int)[EZAudio MAP:i
int bufferIndex = (int)[EZAudioUtilities MAP:i
leftMin:0
leftMax:graphSize
rightMin:0
rightMax:bufferSize];
float x = [EZAudio MAP:bufferIndex
float x = [EZAudioUtilities MAP:bufferIndex
leftMin:0
leftMax:bufferSize
rightMin:-1.0
@@ -734,13 +735,13 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink,
graph[i].y = 0.0f;
}
for(int i = 0; i < graphSize; i+=2){
int bufferIndex = (int)[EZAudio
int bufferIndex = (int)[EZAudioUtilities
MAP:i
leftMin:0
leftMax:graphSize
rightMin:0
rightMax:bufferSize];
float x = [EZAudio MAP:bufferIndex
float x = [EZAudioUtilities MAP:bufferIndex
leftMin:0
leftMax:bufferSize
rightMin:-1.0
+28 -25
View File
@@ -26,7 +26,8 @@
#if TARGET_OS_IPHONE
#import "EZAudioPlotGLKViewController.h"
#import "EZAudio.h"
#import "EZAudioUtilities.h"
#import "EZAudioPlot.h"
@interface EZAudioPlotGLKViewController () {
@@ -100,7 +101,7 @@
[super viewDidLoad];
// Setup the context
if( ![EAGLContext currentContext] )
if (![EAGLContext currentContext])
{
self.context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
}
@@ -120,6 +121,7 @@
GLKView *view = (GLKView *)self.view;
view.context = self.context;
view.drawableMultisample = GLKViewDrawableMultisample4X;
view.opaque = NO;
// Generate both the buffer id references
glGenBuffers(1, &_bufferPlotVBO);
@@ -139,11 +141,11 @@
_changingHistorySize = YES;
historyLength = MIN(historyLength,kEZAudioPlotMaxHistoryBufferLength);
size_t floatByteSize = sizeof(float);
if( _scrollHistoryLength != historyLength ){
if (_scrollHistoryLength != historyLength){
_scrollHistoryLength = historyLength;
}
_scrollHistory = realloc(_scrollHistory,_scrollHistoryLength*floatByteSize);
if( _scrollHistoryIndex < _scrollHistoryLength ){
if (_scrollHistoryIndex < _scrollHistoryLength){
memset(&_scrollHistory[_scrollHistoryIndex],
0,
(_scrollHistoryLength-_scrollHistoryIndex)*floatByteSize);
@@ -170,10 +172,10 @@
-(void)_clearBufferPlot
{
if( _hasBufferPlotData )
if (_hasBufferPlotData)
{
float empty[_bufferPlotGraphSize];
memset( empty, 0.0f, sizeof(float) );
memset( empty, 0.0f, sizeof(float));
[self _updateBufferPlotBufferWithAudioReceived:empty
withBufferSize:_bufferPlotGraphSize];
}
@@ -181,12 +183,12 @@
-(void)_clearRollingPlot
{
if( _hasRollingPlotData )
if (_hasRollingPlotData)
{
float empty[_rollingPlotGraphSize];
EZAudioPlotGLPoint graph[_rollingPlotGraphSize];
// Figure out better way to do this
for(int i = 0; i < _rollingPlotGraphSize; i++ )
for(int i = 0; i < _rollingPlotGraphSize; i++)
{
empty[i] = 0.0f;
}
@@ -195,7 +197,7 @@
_scrollHistory[i] = 0.0f;
}
// Update the scroll history datasource
[EZAudio updateScrollHistory:&_scrollHistory
[EZAudioUtilities updateScrollHistory:&_scrollHistory
withLength:_scrollHistoryLength
atIndex:&_scrollHistoryIndex
withBuffer:empty
@@ -218,7 +220,7 @@
withBufferSize:(UInt32)bufferSize {
// Make sure the update render loop is active
if( self.paused ) self.paused = NO;
if (self.paused) self.paused = NO;
// Make sure we are updating the buffers on the correct gl context.
EAGLContext.currentContext = self.context;
@@ -247,9 +249,9 @@
// If starting with a VBO of half of our max size make sure we initialize it to anticipate
// a filled graph (which needs 2 * bufferSize) to allocate its resources properly
if( !_hasBufferPlotData && _drawingType == EZAudioPlotGLDrawTypeLineStrip ){
if (!_hasBufferPlotData && _drawingType == EZAudioPlotGLDrawTypeLineStrip){
EZAudioPlotGLPoint maxGraph[2*bufferSize];
glBufferData(GL_ARRAY_BUFFER, sizeof(maxGraph), maxGraph, GL_STREAM_DRAW );
glBufferData(GL_ARRAY_BUFFER, sizeof(maxGraph), maxGraph, GL_STREAM_DRAW);
_hasBufferPlotData = YES;
}
@@ -268,8 +270,8 @@
withBufferSize:bufferSize
withGain:self.gain];
if( !_hasBufferPlotData ){
glBufferData( GL_ARRAY_BUFFER, sizeof(graph), graph, GL_STREAM_DRAW );
if (!_hasBufferPlotData){
glBufferData( GL_ARRAY_BUFFER, sizeof(graph), graph, GL_STREAM_DRAW);
_hasBufferPlotData = YES;
}
else {
@@ -289,9 +291,9 @@
// If starting with a VBO of half of our max size make sure we initialize it to anticipate
// a filled graph (which needs 2 * bufferSize) to allocate its resources properly
if( !_hasRollingPlotData ){
if (!_hasRollingPlotData){
EZAudioPlotGLPoint maxGraph[2*kEZAudioPlotMaxHistoryBufferLength];
glBufferData( GL_ARRAY_BUFFER, sizeof(maxGraph), maxGraph, GL_STREAM_DRAW );
glBufferData( GL_ARRAY_BUFFER, sizeof(maxGraph), maxGraph, GL_STREAM_DRAW);
_hasRollingPlotData = YES;
}
@@ -303,7 +305,7 @@
EZAudioPlotGLPoint graph[_rollingPlotGraphSize];
// Update the scroll history datasource
[EZAudio updateScrollHistory:&_scrollHistory
[EZAudioUtilities updateScrollHistory:&_scrollHistory
withLength:_scrollHistoryLength
atIndex:&_scrollHistoryIndex
withBuffer:buffer
@@ -319,8 +321,8 @@
withGain:self.gain];
// Update the drawing
if( !_hasRollingPlotData ){
glBufferData( GL_ARRAY_BUFFER, sizeof(graph) , graph, GL_STREAM_DRAW );
if (!_hasRollingPlotData){
glBufferData( GL_ARRAY_BUFFER, sizeof(graph) , graph, GL_STREAM_DRAW);
_hasRollingPlotData = YES;
}
else {
@@ -338,6 +340,7 @@
// Fill the graph with data
EZAudioPlotGLPoint graph[_rollingPlotGraphSize];
// Fill in graph data
[EZAudioPlotGL fillGraph:graph
withGraphSize:_rollingPlotGraphSize
@@ -347,7 +350,7 @@
withGain:self.gain];
// Update the drawing
if( _hasRollingPlotData ){
if (_hasRollingPlotData){
glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(graph), graph);
}
}
@@ -360,7 +363,7 @@
// Clear the context
glClear(GL_COLOR_BUFFER_BIT);
if( _hasBufferPlotData || _hasRollingPlotData ){
if (_hasBufferPlotData || _hasRollingPlotData){
// Prepare the effect for drawing
[self.baseEffect prepareToDraw];
@@ -383,7 +386,7 @@
#pragma mark - Private Drawing
-(void)_drawBufferPlotWithView:(GLKView*)view drawInRect:(CGRect)rect {
if( _hasBufferPlotData ){
if (_hasBufferPlotData){
glBindBuffer(GL_ARRAY_BUFFER, _bufferPlotVBO);
glEnableVertexAttribArray(GLKVertexAttribPosition);
@@ -395,7 +398,7 @@
glDrawArrays(_drawingType, 0, _bufferPlotGraphSize);
if( self.shouldMirror ){
if (self.shouldMirror){
// Mirrored plot
[self.baseEffect prepareToDraw];
@@ -411,7 +414,7 @@
}
-(void)_drawRollingPlotWithView:(GLKView*)view drawInRect:(CGRect)rect {
if( _hasRollingPlotData ){
if (_hasRollingPlotData){
// Normal plot
glBindBuffer(GL_ARRAY_BUFFER, _rollingPlotVBO);
@@ -424,7 +427,7 @@
glDrawArrays(_drawingType, 0, _rollingPlotGraphSize);
if( self.shouldMirror ){
if (self.shouldMirror){
// Mirrored plot
[self.baseEffect prepareToDraw];
+427
View File
@@ -0,0 +1,427 @@
//
// EZAudioUtilities.h
// EZAudio
//
// Created by Syed Haris Ali on 6/23/15.
// Copyright (c) 2013 Syed Haris Ali. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import <Foundation/Foundation.h>
#import <AudioToolbox/AudioToolbox.h>
#import "TPCircularBuffer.h"
//------------------------------------------------------------------------------
#pragma mark - EZAudioUtilities
//------------------------------------------------------------------------------
/**
The EZAudioUtilities class provides a set of class-level utility methods used throughout EZAudio to handle common operations such as allocating audio buffers and structures, creating various types of AudioStreamBasicDescription structures, string helpers for formatting and debugging, various math utilities, a very handy check result function (used everywhere!), and helpers for dealing with circular buffers. These were previously on the EZAudio class, but as of the 0.1.0 release have been moved here so the whole EZAudio is not needed when using only certain modules.
*/
@interface EZAudioUtilities : NSObject
//------------------------------------------------------------------------------
#pragma mark - Debugging
//------------------------------------------------------------------------------
///-----------------------------------------------------------
/// @name Debugging EZAudio
///-----------------------------------------------------------
/**
Globally sets whether or not the program should exit if a `checkResult:operation:` operation fails. Currently the behavior on EZAudio is to quit if a `checkResult:operation:` fails, but this is not desirable in any production environment. Internally there are a lot of `checkResult:operation:` operations used on all the core classes. This should only ever be set to NO in production environments since a `checkResult:operation:` failing means something breaking has likely happened.
@param shouldExitOnCheckResultFail A BOOL indicating whether or not the running program should exist due to a `checkResult:operation:` fail.
*/
+ (void)setShouldExitOnCheckResultFail:(BOOL)shouldExitOnCheckResultFail;
//------------------------------------------------------------------------------
/**
Provides a flag indicating whether or not the program will exit if a `checkResult:operation:` fails.
@return A BOOL indicating whether or not the program will exit if a `checkResult:operation:` fails.
*/
+ (BOOL)shouldExitOnCheckResultFail;
//------------------------------------------------------------------------------
#pragma mark - AudioBufferList Utility
//------------------------------------------------------------------------------
///-----------------------------------------------------------
/// @name AudioBufferList Utility
///-----------------------------------------------------------
/**
Allocates an AudioBufferList structure. Make sure to call freeBufferList when done using AudioBufferList or it will leak.
@param frames The number of frames that will be stored within each audio buffer
@param channels The number of channels (e.g. 2 for stereo, 1 for mono, etc.)
@param interleaved Whether the samples will be interleaved (if not it will be assumed to be non-interleaved and each channel will have an AudioBuffer allocated)
@return An AudioBufferList struct that has been allocated in memory
*/
+ (AudioBufferList *)audioBufferListWithNumberOfFrames:(UInt32)frames
numberOfChannels:(UInt32)channels
interleaved:(BOOL)interleaved;
//------------------------------------------------------------------------------
/**
Allocates an array of float arrays given the number of frames needed to store in each float array.
@param frames A UInt32 representing the number of frames to store in each float buffer
@param channels A UInt32 representing the number of channels (i.e. the number of float arrays to allocate)
@return An array of float arrays, each the length of the number of frames specified
*/
+ (float **)floatBuffersWithNumberOfFrames:(UInt32)frames
numberOfChannels:(UInt32)channels;
//------------------------------------------------------------------------------
/**
Deallocates an AudioBufferList structure from memory.
@param bufferList A pointer to the buffer list you would like to free
*/
+ (void)freeBufferList:(AudioBufferList *)bufferList;
//------------------------------------------------------------------------------
/**
Deallocates an array of float buffers
@param buffers An array of float arrays
@param channels A UInt32 representing the number of channels (i.e. the number of float arrays to deallocate)
*/
+ (void)freeFloatBuffers:(float **)buffers numberOfChannels:(UInt32)channels;
//------------------------------------------------------------------------------
#pragma mark - AudioStreamBasicDescription Utilties
//------------------------------------------------------------------------------
///-----------------------------------------------------------
/// @name Creating An AudioStreamBasicDescription
///-----------------------------------------------------------
/**
Creates a signed-integer, interleaved AudioStreamBasicDescription for the number of channels specified for an AIFF format.
@param channels The desired number of channels
@param sampleRate A float representing the sample rate.
@return A new AudioStreamBasicDescription with the specified format.
*/
+ (AudioStreamBasicDescription)AIFFFormatWithNumberOfChannels:(UInt32)channels
sampleRate:(float)sampleRate;
//------------------------------------------------------------------------------
/**
Creates an AudioStreamBasicDescription for the iLBC narrow band speech codec.
@param sampleRate A float representing the sample rate.
@return A new AudioStreamBasicDescription with the specified format.
*/
+ (AudioStreamBasicDescription)iLBCFormatWithSampleRate:(float)sampleRate;
//------------------------------------------------------------------------------
/**
Creates a float-based, non-interleaved AudioStreamBasicDescription for the number of channels specified.
@param channels A UInt32 representing the number of channels.
@param sampleRate A float representing the sample rate.
@return A float-based AudioStreamBasicDescription with the number of channels specified.
*/
+ (AudioStreamBasicDescription)floatFormatWithNumberOfChannels:(UInt32)channels
sampleRate:(float)sampleRate;
//------------------------------------------------------------------------------
/**
Creates an AudioStreamBasicDescription for an M4A AAC format.
@param channels The desired number of channels
@param sampleRate A float representing the sample rate.
@return A new AudioStreamBasicDescription with the specified format.
*/
+ (AudioStreamBasicDescription)M4AFormatWithNumberOfChannels:(UInt32)channels
sampleRate:(float)sampleRate;
//------------------------------------------------------------------------------
/**
Creates a single-channel, float-based AudioStreamBasicDescription.
@param sampleRate A float representing the sample rate.
@return A new AudioStreamBasicDescription with the specified format.
*/
+ (AudioStreamBasicDescription)monoFloatFormatWithSampleRate:(float)sampleRate;
//------------------------------------------------------------------------------
/**
Creates a single-channel, float-based AudioStreamBasicDescription (as of 0.0.6 this is the same as `monoFloatFormatWithSampleRate:`).
@param sampleRate A float representing the sample rate.
@return A new AudioStreamBasicDescription with the specified format.
*/
+ (AudioStreamBasicDescription)monoCanonicalFormatWithSampleRate:(float)sampleRate;
//------------------------------------------------------------------------------
/**
Creates a two-channel, non-interleaved, float-based AudioStreamBasicDescription (as of 0.0.6 this is the same as `stereoFloatNonInterleavedFormatWithSampleRate:`).
@param sampleRate A float representing the sample rate.
@return A new AudioStreamBasicDescription with the specified format.
*/
+ (AudioStreamBasicDescription)stereoCanonicalNonInterleavedFormatWithSampleRate:(float)sampleRate;
//------------------------------------------------------------------------------
/**
Creates a two-channel, interleaved, float-based AudioStreamBasicDescription.
@param sampleRate A float representing the sample rate.
@return A new AudioStreamBasicDescription with the specified format.
*/
+ (AudioStreamBasicDescription)stereoFloatInterleavedFormatWithSampleRate:(float)sampleRate;
//------------------------------------------------------------------------------
/**
Creates a two-channel, non-interleaved, float-based AudioStreamBasicDescription.
@param sampleRate A float representing the sample rate.
@return A new AudioStreamBasicDescription with the specified format.
*/
+ (AudioStreamBasicDescription)stereoFloatNonInterleavedFormatWithSampleRate:(float)sameRate;
//------------------------------------------------------------------------------
// @name AudioStreamBasicDescription Helper Functions
//------------------------------------------------------------------------------
/**
Checks an AudioStreamBasicDescription to see if it is a float-based format (as opposed to a signed integer based format).
@param asbd A valid AudioStreamBasicDescription
@return A BOOL indicating whether or not the AudioStreamBasicDescription is a float format.
*/
+ (BOOL)isFloatFormat:(AudioStreamBasicDescription)asbd;
//------------------------------------------------------------------------------
/**
Checks an AudioStreamBasicDescription to check for an interleaved flag (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 a linear PCM format (uncompressed,
1 frame per packet)
@param asbd A valid AudioStreamBasicDescription
@return A BOOL indicating whether or not the AudioStreamBasicDescription is linear PCM.
*/
+ (BOOL)isLinearPCM:(AudioStreamBasicDescription)asbd;
///-----------------------------------------------------------
/// @name AudioStreamBasicDescription Utilities
///-----------------------------------------------------------
/**
Nicely logs out the contents of an AudioStreamBasicDescription struct
@param asbd The AudioStreamBasicDescription struct with content to print out
*/
+ (void)printASBD:(AudioStreamBasicDescription)asbd;
//------------------------------------------------------------------------------
/**
Converts seconds into a string formatted as MM:SS
@param seconds An NSTimeInterval representing the number of seconds
@return An NSString instance formatted as MM:SS from the seconds provided.
*/
+ (NSString *)displayTimeStringFromSeconds:(NSTimeInterval)seconds;
//------------------------------------------------------------------------------
/**
Creates a string to use when logging out the contents of an AudioStreamBasicDescription
@param asbd A valid AudioStreamBasicDescription struct.
@return An NSString representing the contents of the AudioStreamBasicDescription.
*/
+ (NSString *)stringForAudioStreamBasicDescription:(AudioStreamBasicDescription)asbd;
//------------------------------------------------------------------------------
/**
Just a wrapper around the setCanonical function provided in the Core Audio Utility C++ class.
@param asbd The AudioStreamBasicDescription structure to modify
@param nChannels The number of expected channels on the description
@param interleaved A flag indicating whether the stereo samples should be interleaved in the buffer
*/
+ (void)setCanonicalAudioStreamBasicDescription:(AudioStreamBasicDescription*)asbd
numberOfChannels:(UInt32)nChannels
interleaved:(BOOL)interleaved;
//------------------------------------------------------------------------------
#pragma mark - Math Utilities
//------------------------------------------------------------------------------
///-----------------------------------------------------------
/// @name Math Utilities
///-----------------------------------------------------------
/**
Appends an array of values to a history buffer and performs an internal shift to add the values to the tail and removes the same number of values from the head.
@param buffer A float array of values to append to the tail of the history buffer
@param bufferLength The length of the float array being appended to the history buffer
@param scrollHistory The target history buffer in which to append the values
@param scrollHistoryLength The length of the target history buffer
*/
+ (void)appendBufferAndShift:(float*)buffer
withBufferSize:(int)bufferLength
toScrollHistory:(float*)scrollHistory
withScrollHistorySize:(int)scrollHistoryLength;
//------------------------------------------------------------------------------
/**
Appends a value to a history buffer and performs an internal shift to add the value to the tail and remove the 0th value.
@param value The float value to append to the history array
@param scrollHistory The target history buffer in which to append the values
@param scrollHistoryLength The length of the target history buffer
*/
+(void) appendValue:(float)value
toScrollHistory:(float*)scrollHistory
withScrollHistorySize:(int)scrollHistoryLength;
//------------------------------------------------------------------------------
/**
Maps a value from one coordinate system into another one. Takes in the current value to map, the minimum and maximum values of the first coordinate system, and the minimum and maximum values of the second coordinate system and calculates the mapped value in the second coordinate system's constraints.
@param value The value expressed in the first coordinate system
@param leftMin The minimum of the first coordinate system
@param leftMax The maximum of the first coordinate system
@param rightMin The minimum of the second coordindate system
@param rightMax The maximum of the second coordinate system
@return The mapped value in terms of the second coordinate system
*/
+ (float)MAP:(float)value
leftMin:(float)leftMin
leftMax:(float)leftMax
rightMin:(float)rightMin
rightMax:(float)rightMax;
//------------------------------------------------------------------------------
/**
Calculates the root mean squared for a buffer.
@param buffer A float buffer array of values whose root mean squared to calculate
@param bufferSize The size of the float buffer
@return The root mean squared of the buffer
*/
+ (float)RMS:(float*)buffer length:(int)bufferSize;
//------------------------------------------------------------------------------
/**
Calculate the sign function sgn(x) =
{ -1 , x < 0,
{ 0 , x = 0,
{ 1 , x > 0
@param value The float value for which to use as x
@return The float sign value
*/
+ (float)SGN:(float)value;
//------------------------------------------------------------------------------
#pragma mark - OSStatus Utility
//------------------------------------------------------------------------------
///-----------------------------------------------------------
/// @name OSStatus Utility
///-----------------------------------------------------------
/**
Basic check result function useful for checking each step of the audio setup process
@param result The OSStatus representing the result of an operation
@param operation A string (const char, not NSString) describing the operation taking place (will print if fails)
*/
+ (void)checkResult:(OSStatus)result operation:(const char *)operation;
//------------------------------------------------------------------------------
/**
Provides a string representation of the often cryptic Core Audio error codes
@param code A UInt32 representing an error code
@return An NSString with a human readable version of the error code.
*/
+ (NSString *)stringFromUInt32Code:(UInt32)code;
//------------------------------------------------------------------------------
#pragma mark - Plot Utility
//------------------------------------------------------------------------------
///-----------------------------------------------------------
/// @name Plot Utility
///-----------------------------------------------------------
/**
Given a buffer representing a window of float history data this append the RMS of a buffer of incoming float data...This will likely be deprecated in a future version of EZAudio for a circular buffer based approach.
@param scrollHistory An array of float arrays being used to hold the history values for each channel.
@param scrollHistoryLength An int representing the length of the history window.
@param index An int pointer to the index of the current read index of the history buffer.
@param buffer A float array representing the incoming audio data.
@param bufferSize An int representing the length of the incoming audio data.
@param isChanging A BOOL pointer representing whether the resolution (length of the history window) is currently changing.
*/
+ (void)updateScrollHistory:(float **)scrollHistory
withLength:(int)scrollHistoryLength
atIndex:(int *)index
withBuffer:(float *)buffer
withBufferSize:(int)bufferSize
isResolutionChanging:(BOOL *)isChanging;
//------------------------------------------------------------------------------
#pragma mark - TPCircularBuffer Utility
//------------------------------------------------------------------------------
///-----------------------------------------------------------
/// @name TPCircularBuffer Utility
///-----------------------------------------------------------
/**
Appends the data from the audio buffer list to the circular buffer
@param circularBuffer Pointer to the instance of the TPCircularBuffer to add the audio data to
@param audioBufferList Pointer to the instance of the AudioBufferList with the audio data
*/
+ (void)appendDataToCircularBuffer:(TPCircularBuffer*)circularBuffer
fromAudioBufferList:(AudioBufferList*)audioBufferList;
//------------------------------------------------------------------------------
/**
Initializes the circular buffer (just a wrapper around the C method)
* @param circularBuffer Pointer to an instance of the TPCircularBuffer
* @param size The length of the TPCircularBuffer (usually 1024)
*/
+ (void)circularBuffer:(TPCircularBuffer*)circularBuffer
withSize:(int)size;
//------------------------------------------------------------------------------
/**
Frees a circular buffer
@param circularBuffer Pointer to the circular buffer to clear
*/
+ (void)freeCircularBuffer:(TPCircularBuffer*)circularBuffer;
//------------------------------------------------------------------------------
@end
+565
View File
@@ -0,0 +1,565 @@
//
// EZAudioUtilities.m
// EZAudio
//
// Created by Syed Haris Ali on 6/23/15.
// Copyright (c) 2013 Syed Haris Ali. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import "EZAudioUtilities.h"
BOOL __shouldExitOnCheckResultFail = YES;
@implementation EZAudioUtilities
//------------------------------------------------------------------------------
#pragma mark - Debugging
//------------------------------------------------------------------------------
+ (void)setShouldExitOnCheckResultFail:(BOOL)shouldExitOnCheckResultFail
{
__shouldExitOnCheckResultFail = shouldExitOnCheckResultFail;
}
//------------------------------------------------------------------------------
+ (BOOL)shouldExitOnCheckResultFail
{
return __shouldExitOnCheckResultFail;
}
//------------------------------------------------------------------------------
#pragma mark - AudioBufferList Utility
//------------------------------------------------------------------------------
+ (AudioBufferList *)audioBufferListWithNumberOfFrames:(UInt32)frames
numberOfChannels:(UInt32)channels
interleaved:(BOOL)interleaved
{
AudioBufferList *audioBufferList = (AudioBufferList*)malloc(sizeof(AudioBufferList) + sizeof(AudioBuffer) * (channels-1));
UInt32 outputBufferSize = 32 * frames; // 32 KB
audioBufferList->mNumberBuffers = interleaved ? 1 : channels;
for(int i = 0; i < audioBufferList->mNumberBuffers; i++)
{
audioBufferList->mBuffers[i].mNumberChannels = channels;
audioBufferList->mBuffers[i].mDataByteSize = channels * outputBufferSize;
audioBufferList->mBuffers[i].mData = (float *)malloc(channels * sizeof(float) *outputBufferSize);
}
return audioBufferList;
}
//------------------------------------------------------------------------------
+ (float **)floatBuffersWithNumberOfFrames:(UInt32)frames
numberOfChannels:(UInt32)channels
{
size_t size = sizeof(float *) * channels;
float **buffers = (float **)malloc(size);
for (int i = 0; i < channels; i++)
{
size = sizeof(float) * frames;
buffers[i] = (float *)malloc(size);
}
return buffers;
}
//------------------------------------------------------------------------------
+ (void)freeBufferList:(AudioBufferList *)bufferList
{
if (bufferList)
{
if (bufferList->mNumberBuffers)
{
for( int i = 0; i < bufferList->mNumberBuffers; i++)
{
if (bufferList->mBuffers[i].mData)
{
free(bufferList->mBuffers[i].mData);
}
}
}
free(bufferList);
}
bufferList = NULL;
}
//------------------------------------------------------------------------------
+ (void)freeFloatBuffers:(float **)buffers numberOfChannels:(UInt32)channels
{
for (int i = 0; i < channels; i++)
{
free(buffers[i]);
}
free(buffers);
}
//------------------------------------------------------------------------------
#pragma mark - AudioStreamBasicDescription Utility
//------------------------------------------------------------------------------
+ (AudioStreamBasicDescription)AIFFFormatWithNumberOfChannels:(UInt32)channels
sampleRate:(float)sampleRate
{
AudioStreamBasicDescription asbd;
memset(&asbd, 0, sizeof(asbd));
asbd.mFormatID = kAudioFormatLinearPCM;
asbd.mFormatFlags = kAudioFormatFlagIsBigEndian|kAudioFormatFlagIsPacked|kAudioFormatFlagIsSignedInteger;
asbd.mSampleRate = sampleRate;
asbd.mChannelsPerFrame = channels;
asbd.mBitsPerChannel = 32;
asbd.mBytesPerPacket = (asbd.mBitsPerChannel / 8) * asbd.mChannelsPerFrame;
asbd.mFramesPerPacket = 1;
asbd.mBytesPerFrame = (asbd.mBitsPerChannel / 8) * asbd.mChannelsPerFrame;
return asbd;
}
//------------------------------------------------------------------------------
+ (AudioStreamBasicDescription)iLBCFormatWithSampleRate:(float)sampleRate
{
AudioStreamBasicDescription asbd;
memset(&asbd, 0, sizeof(asbd));
asbd.mFormatID = kAudioFormatiLBC;
asbd.mChannelsPerFrame = 1;
asbd.mSampleRate = sampleRate;
// Fill in the rest of the descriptions using the Audio Format API
UInt32 propSize = sizeof(asbd);
[EZAudioUtilities checkResult:AudioFormatGetProperty(kAudioFormatProperty_FormatInfo,
0,
NULL,
&propSize,
&asbd)
operation:"Failed to fill out the rest of the m4a AudioStreamBasicDescription"];
return asbd;
}
//------------------------------------------------------------------------------
+ (AudioStreamBasicDescription)floatFormatWithNumberOfChannels:(UInt32)channels
sampleRate:(float)sampleRate
{
AudioStreamBasicDescription asbd;
UInt32 floatByteSize = sizeof(float);
asbd.mBitsPerChannel = 8 * floatByteSize;
asbd.mBytesPerFrame = floatByteSize;
asbd.mBytesPerPacket = floatByteSize;
asbd.mChannelsPerFrame = channels;
asbd.mFormatFlags = kAudioFormatFlagIsFloat|kAudioFormatFlagIsNonInterleaved;
asbd.mFormatID = kAudioFormatLinearPCM;
asbd.mFramesPerPacket = 1;
asbd.mSampleRate = sampleRate;
return asbd;
}
//------------------------------------------------------------------------------
+ (AudioStreamBasicDescription)M4AFormatWithNumberOfChannels:(UInt32)channels
sampleRate:(float)sampleRate
{
AudioStreamBasicDescription asbd;
memset(&asbd, 0, sizeof(asbd));
asbd.mFormatID = kAudioFormatMPEG4AAC;
asbd.mChannelsPerFrame = channels;
asbd.mSampleRate = sampleRate;
// Fill in the rest of the descriptions using the Audio Format API
UInt32 propSize = sizeof(asbd);
[EZAudioUtilities checkResult:AudioFormatGetProperty(kAudioFormatProperty_FormatInfo,
0,
NULL,
&propSize,
&asbd)
operation:"Failed to fill out the rest of the m4a AudioStreamBasicDescription"];
return asbd;
}
//------------------------------------------------------------------------------
+ (AudioStreamBasicDescription)monoFloatFormatWithSampleRate:(float)sampleRate
{
AudioStreamBasicDescription asbd;
UInt32 byteSize = sizeof(float);
asbd.mBitsPerChannel = 8 * byteSize;
asbd.mBytesPerFrame = byteSize;
asbd.mBytesPerPacket = byteSize;
asbd.mChannelsPerFrame = 1;
asbd.mFormatFlags = kAudioFormatFlagIsPacked|kAudioFormatFlagIsFloat;
asbd.mFormatID = kAudioFormatLinearPCM;
asbd.mFramesPerPacket = 1;
asbd.mSampleRate = sampleRate;
return asbd;
}
//------------------------------------------------------------------------------
+ (AudioStreamBasicDescription)monoCanonicalFormatWithSampleRate:(float)sampleRate
{
AudioStreamBasicDescription asbd;
UInt32 byteSize = sizeof(float);
asbd.mBitsPerChannel = 8 * byteSize;
asbd.mBytesPerFrame = byteSize;
asbd.mBytesPerPacket = byteSize;
asbd.mChannelsPerFrame = 1;
asbd.mFormatFlags = kAudioFormatFlagsNativeFloatPacked|kAudioFormatFlagIsNonInterleaved;
asbd.mFormatID = kAudioFormatLinearPCM;
asbd.mFramesPerPacket = 1;
asbd.mSampleRate = sampleRate;
return asbd;
}
//------------------------------------------------------------------------------
+ (AudioStreamBasicDescription)stereoCanonicalNonInterleavedFormatWithSampleRate:(float)sampleRate
{
AudioStreamBasicDescription asbd;
UInt32 byteSize = sizeof(float);
asbd.mBitsPerChannel = 8 * byteSize;
asbd.mBytesPerFrame = byteSize;
asbd.mBytesPerPacket = byteSize;
asbd.mChannelsPerFrame = 2;
asbd.mFormatFlags = kAudioFormatFlagsNativeFloatPacked|kAudioFormatFlagIsNonInterleaved;
asbd.mFormatID = kAudioFormatLinearPCM;
asbd.mFramesPerPacket = 1;
asbd.mSampleRate = sampleRate;
return asbd;
}
//------------------------------------------------------------------------------
+ (AudioStreamBasicDescription)stereoFloatInterleavedFormatWithSampleRate:(float)sampleRate
{
AudioStreamBasicDescription asbd;
UInt32 floatByteSize = sizeof(float);
asbd.mChannelsPerFrame = 2;
asbd.mBitsPerChannel = 8 * floatByteSize;
asbd.mBytesPerFrame = asbd.mChannelsPerFrame * floatByteSize;
asbd.mFramesPerPacket = 1;
asbd.mBytesPerPacket = asbd.mFramesPerPacket * asbd.mBytesPerFrame;
asbd.mFormatFlags = kAudioFormatFlagIsFloat;
asbd.mFormatID = kAudioFormatLinearPCM;
asbd.mSampleRate = sampleRate;
asbd.mReserved = 0;
return asbd;
}
//------------------------------------------------------------------------------
+ (AudioStreamBasicDescription)stereoFloatNonInterleavedFormatWithSampleRate:(float)sampleRate
{
AudioStreamBasicDescription asbd;
UInt32 floatByteSize = sizeof(float);
asbd.mBitsPerChannel = 8 * floatByteSize;
asbd.mBytesPerFrame = floatByteSize;
asbd.mChannelsPerFrame = 2;
asbd.mFormatFlags = kAudioFormatFlagIsFloat|kAudioFormatFlagIsNonInterleaved;
asbd.mFormatID = kAudioFormatLinearPCM;
asbd.mFramesPerPacket = 1;
asbd.mBytesPerPacket = asbd.mFramesPerPacket * asbd.mBytesPerFrame;
asbd.mSampleRate = sampleRate;
return asbd;
}
//------------------------------------------------------------------------------
+ (BOOL)isFloatFormat:(AudioStreamBasicDescription)asbd
{
return asbd.mFormatFlags & kAudioFormatFlagIsFloat;
}
//------------------------------------------------------------------------------
+ (BOOL)isInterleaved:(AudioStreamBasicDescription)asbd
{
return !(asbd.mFormatFlags & kAudioFormatFlagIsNonInterleaved);
}
//------------------------------------------------------------------------------
+ (BOOL)isLinearPCM:(AudioStreamBasicDescription)asbd
{
return asbd.mFormatID == kAudioFormatLinearPCM;
}
//------------------------------------------------------------------------------
+ (void)printASBD:(AudioStreamBasicDescription)asbd
{
char formatIDString[5];
UInt32 formatID = CFSwapInt32HostToBig(asbd.mFormatID);
bcopy (&formatID, formatIDString, 4);
formatIDString[4] = '\0';
NSLog (@" Sample Rate: %10.0f", asbd.mSampleRate);
NSLog (@" Format ID: %10s", formatIDString);
NSLog (@" Format Flags: %10X", (unsigned int)asbd.mFormatFlags);
NSLog (@" Bytes per Packet: %10d", (unsigned int)asbd.mBytesPerPacket);
NSLog (@" Frames per Packet: %10d", (unsigned int)asbd.mFramesPerPacket);
NSLog (@" Bytes per Frame: %10d", (unsigned int)asbd.mBytesPerFrame);
NSLog (@" Channels per Frame: %10d", (unsigned int)asbd.mChannelsPerFrame);
NSLog (@" Bits per Channel: %10d", (unsigned int)asbd.mBitsPerChannel);
}
//------------------------------------------------------------------------------
+ (NSString *)displayTimeStringFromSeconds:(NSTimeInterval)seconds
{
int totalSeconds = (int)ceil(seconds);
int secondsComponent = totalSeconds % 60;
int minutesComponent = (totalSeconds / 60) % 60;
return [NSString stringWithFormat:@"%02d:%02d", minutesComponent, secondsComponent];
}
//------------------------------------------------------------------------------
+ (NSString *)stringForAudioStreamBasicDescription:(AudioStreamBasicDescription)asbd
{
char formatIDString[5];
UInt32 formatID = CFSwapInt32HostToBig(asbd.mFormatID);
bcopy (&formatID, formatIDString, 4);
formatIDString[4] = '\0';
return [NSString stringWithFormat:
@"\nSample Rate: %10.0f,\n"
@"Format ID: %10s,\n"
@"Format Flags: %10X,\n"
@"Bytes per Packet: %10d,\n"
@"Frames per Packet: %10d,\n"
@"Bytes per Frame: %10d,\n"
@"Channels per Frame: %10d,\n"
@"Bits per Channel: %10d,\n"
@"IsInterleaved: %i,\n"
@"IsFloat: %i,",
asbd.mSampleRate,
formatIDString,
(unsigned int)asbd.mFormatFlags,
(unsigned int)asbd.mBytesPerPacket,
(unsigned int)asbd.mFramesPerPacket,
(unsigned int)asbd.mBytesPerFrame,
(unsigned int)asbd.mChannelsPerFrame,
(unsigned int)asbd.mBitsPerChannel,
[self isInterleaved:asbd],
[self isFloatFormat:asbd]];
}
//------------------------------------------------------------------------------
+ (void)setCanonicalAudioStreamBasicDescription:(AudioStreamBasicDescription*)asbd
numberOfChannels:(UInt32)nChannels
interleaved:(BOOL)interleaved
{
asbd->mFormatID = kAudioFormatLinearPCM;
#if TARGET_OS_IPHONE
int sampleSize = sizeof(float);
asbd->mFormatFlags = kAudioFormatFlagsNativeFloatPacked;
#elif TARGET_OS_MAC
int sampleSize = sizeof(Float32);
asbd->mFormatFlags = kAudioFormatFlagsNativeFloatPacked;
#endif
asbd->mBitsPerChannel = 8 * sampleSize;
asbd->mChannelsPerFrame = nChannels;
asbd->mFramesPerPacket = 1;
if (interleaved)
asbd->mBytesPerPacket = asbd->mBytesPerFrame = nChannels * sampleSize;
else {
asbd->mBytesPerPacket = asbd->mBytesPerFrame = sampleSize;
asbd->mFormatFlags |= kAudioFormatFlagIsNonInterleaved;
}
}
//------------------------------------------------------------------------------
#pragma mark - Math Utilities
//------------------------------------------------------------------------------
+ (void)appendBufferAndShift:(float*)buffer
withBufferSize:(int)bufferLength
toScrollHistory:(float*)scrollHistory
withScrollHistorySize:(int)scrollHistoryLength
{
int shiftLength = scrollHistoryLength - bufferLength;
size_t floatByteSize = sizeof(float);
size_t shiftByteSize = shiftLength * floatByteSize;
size_t bufferByteSize = bufferLength * floatByteSize;
memmove(&scrollHistory[0],
&scrollHistory[bufferLength],
shiftByteSize);
memmove(&scrollHistory[shiftLength],
&buffer[0],
bufferByteSize);
}
//------------------------------------------------------------------------------
+ (void) appendValue:(float)value
toScrollHistory:(float*)scrollHistory
withScrollHistorySize:(int)scrollHistoryLength
{
float val[1]; val[0] = value;
[self appendBufferAndShift:val
withBufferSize:1
toScrollHistory:scrollHistory
withScrollHistorySize:scrollHistoryLength];
}
//------------------------------------------------------------------------------
+(float)MAP:(float)value
leftMin:(float)leftMin
leftMax:(float)leftMax
rightMin:(float)rightMin
rightMax:(float)rightMax
{
float leftSpan = leftMax - leftMin;
float rightSpan = rightMax - rightMin;
float valueScaled = ( value - leftMin) / leftSpan;
return rightMin + (valueScaled * rightSpan);
}
//------------------------------------------------------------------------------
+(float)RMS:(float *)buffer
length:(int)bufferSize
{
float sum = 0.0;
for(int i = 0; i < bufferSize; i++)
sum += buffer[i] * buffer[i];
return sqrtf( sum / bufferSize);
}
//------------------------------------------------------------------------------
+(float)SGN:(float)value
{
return value < 0 ? -1.0f : ( value > 0 ? 1.0f : 0.0f);
}
//------------------------------------------------------------------------------
#pragma mark - OSStatus Utility
//------------------------------------------------------------------------------
+ (void)checkResult:(OSStatus)result operation:(const char *)operation
{
if (result == noErr) return;
char errorString[20];
// see if it appears to be a 4-char-code
*(UInt32 *)(errorString + 1) = CFSwapInt32HostToBig(result);
if (isprint(errorString[1]) && isprint(errorString[2]) && isprint(errorString[3]) && isprint(errorString[4]))
{
errorString[0] = errorString[5] = '\'';
errorString[6] = '\0';
} else
// no, format it as an integer
sprintf(errorString, "%d", (int)result);
fprintf(stderr, "Error: %s (%s)\n", operation, errorString);
if (__shouldExitOnCheckResultFail)
{
exit(-1);
}
}
//------------------------------------------------------------------------------
+ (NSString *)stringFromUInt32Code:(UInt32)code
{
char errorString[20];
// see if it appears to be a 4-char-code
*(UInt32 *)(errorString + 1) = CFSwapInt32HostToBig(code);
if (isprint(errorString[1]) &&
isprint(errorString[2]) &&
isprint(errorString[3]) &&
isprint(errorString[4]))
{
errorString[0] = errorString[5] = '\'';
errorString[6] = '\0';
}
return [NSString stringWithUTF8String:errorString];
}
//------------------------------------------------------------------------------
#pragma mark - Plot Utility
//------------------------------------------------------------------------------
+ (void)updateScrollHistory:(float **)scrollHistory
withLength:(int)scrollHistoryLength
atIndex:(int *)index
withBuffer:(float *)buffer
withBufferSize:(int)bufferSize
isResolutionChanging:(BOOL *)isChanging
{
//
size_t floatByteSize = sizeof(float);
if(*scrollHistory == NULL)
{
// Create the history buffer
*scrollHistory = (float *)calloc(8192, floatByteSize);
}
//
if(!*isChanging)
{
float rms = [EZAudioUtilities RMS:buffer length:bufferSize];
if(*index < scrollHistoryLength)
{
float *hist = *scrollHistory;
hist[*index] = rms;
(*index)++;
}
else
{
[EZAudioUtilities appendValue:rms
toScrollHistory:*scrollHistory
withScrollHistorySize:scrollHistoryLength];
}
}
}
//------------------------------------------------------------------------------
#pragma mark - TPCircularBuffer Utility
//------------------------------------------------------------------------------
+ (void)appendDataToCircularBuffer:(TPCircularBuffer *)circularBuffer
fromAudioBufferList:(AudioBufferList *)audioBufferList
{
TPCircularBufferProduceBytes(circularBuffer,
audioBufferList->mBuffers[0].mData,
audioBufferList->mBuffers[0].mDataByteSize);
}
//------------------------------------------------------------------------------
+ (void)circularBuffer:(TPCircularBuffer *)circularBuffer withSize:(int)size
{
TPCircularBufferInit(circularBuffer, size);
}
//------------------------------------------------------------------------------
+ (void)freeCircularBuffer:(TPCircularBuffer *)circularBuffer
{
TPCircularBufferClear(circularBuffer);
TPCircularBufferCleanup(circularBuffer);
}
//------------------------------------------------------------------------------
@end
+176 -48
View File
@@ -23,15 +23,18 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import <Foundation/Foundation.h>
#import <AudioToolbox/AudioToolbox.h>
#import "AEFloatConverter.h"
#import "TargetConditionals.h"
#import <Foundation/Foundation.h>
#import <AudioToolbox/AudioToolbox.h>
#import "TargetConditionals.h"
#import "EZAudioDevice.h"
#import "EZOutput.h"
@class EZAudio;
@class EZMicrophone;
//------------------------------------------------------------------------------
#pragma mark - EZMicrophoneDelegate
//------------------------------------------------------------------------------
/**
The delegate for the EZMicrophone provides a receiver for the incoming audio data events. When the microphone has been successfully internally configured it will try to send its delegate an AudioStreamBasicDescription describing the format of the incoming audio data.
@@ -51,13 +54,23 @@
/// @name Audio Data Description
///-----------------------------------------------------------
/**
Called anytime the input device changes on an `EZMicrophone` instance. Mac only.
@param microphone The instance of the EZMicrophone that triggered the event.
@param device The instance of the new EZAudioDevice the microphone is using to pull input.
@param notification Incase the device changed because of a notification (like from AVAudioSession) then we provide that notification to give the full context of the change.
*/
- (void)microphone:(EZMicrophone *)microphone changedDevice:(EZAudioDevice *)device;
//------------------------------------------------------------------------------
/**
Returns back the audio stream basic description as soon as it has been initialized. This is guaranteed to occur before the stream callbacks, `microphone:hasBufferList:withBufferSize:withNumberOfChannels:` or `microphone:hasAudioReceived:withBufferSize:withNumberOfChannels:`
@param microphone The instance of the EZMicrophone that triggered the event.
@param audioStreamBasicDescription The AudioStreamBasicDescription that was created for the microphone instance.
*/
-(void) microphone:(EZMicrophone *)microphone
hasAudioStreamBasicDescription:(AudioStreamBasicDescription)audioStreamBasicDescription;
- (void) microphone:(EZMicrophone *)microphone
hasAudioStreamBasicDescription:(AudioStreamBasicDescription)audioStreamBasicDescription;
///-----------------------------------------------------------
/// @name Audio Data Callbacks
@@ -71,10 +84,12 @@
@param numberOfChannels The number of channels for the incoming audio.
@warning This function executes on a background thread to avoid blocking any audio operations. If operations should be performed on any other thread (like the main thread) it should be performed within a dispatch block like so: dispatch_async(dispatch_get_main_queue(), ^{ ...Your Code... })
*/
-(void) microphone:(EZMicrophone*)microphone
hasAudioReceived:(float**)buffer
withBufferSize:(UInt32)bufferSize
withNumberOfChannels:(UInt32)numberOfChannels;
- (void) microphone:(EZMicrophone *)microphone
hasAudioReceived:(float **)buffer
withBufferSize:(UInt32)bufferSize
withNumberOfChannels:(UInt32)numberOfChannels;
//------------------------------------------------------------------------------
/**
Returns back the buffer list containing the audio received. This occurs on the background thread so any drawing code must explicity perform its functions on the main thread.
@@ -84,40 +99,69 @@
@param numberOfChannels The number of channels for the incoming audio.
@warning This function executes on a background thread to avoid blocking any audio operations. If operations should be performed on any other thread (like the main thread) it should be performed within a dispatch block like so: dispatch_async(dispatch_get_main_queue(), ^{ ...Your Code... })
*/
-(void) microphone:(EZMicrophone*)microphone
hasBufferList:(AudioBufferList*)bufferList
withBufferSize:(UInt32)bufferSize
withNumberOfChannels:(UInt32)numberOfChannels;
- (void) microphone:(EZMicrophone *)microphone
hasBufferList:(AudioBufferList *)bufferList
withBufferSize:(UInt32)bufferSize
withNumberOfChannels:(UInt32)numberOfChannels;
@end
//------------------------------------------------------------------------------
#pragma mark - EZMicrophone
//------------------------------------------------------------------------------
/**
The EZMicrophone provides a component to get audio data from the default device microphone. On OSX this is the default selected input device in the system preferences while on iOS this defaults to use the default RemoteIO audio unit. The microphone data is converted to a float buffer array and returned back to the caller via the EZMicrophoneDelegate protocol.
*/
@interface EZMicrophone : NSObject
@interface EZMicrophone : NSObject <EZOutputDataSource>
//------------------------------------------------------------------------------
/**
The EZMicrophoneDelegate for which to handle the microphone callbacks
*/
@property (nonatomic,assign) id<EZMicrophoneDelegate> microphoneDelegate;
@property (nonatomic, weak) id<EZMicrophoneDelegate> delegate;
//------------------------------------------------------------------------------
/**
A bool describing whether the microphone is on and passing back audio data to its delegate.
The EZAudioDevice being used to pull the microphone data.
- On iOS this can be any of the available microphones on the iPhone/iPad devices (usually there are 3). Defaults to the first microphone found (bottom mic)
- On OSX this can be any of the plugged in devices that Core Audio can detect (see kAudioUnitSubType_HALOutput for more information)
System Preferences -> Sound for the available inputs)
*/
@property (nonatomic,assign) BOOL microphoneOn;
@property (nonatomic, strong) EZAudioDevice *device;
//------------------------------------------------------------------------------
/**
A BOOL describing whether the microphone is on and passing back audio data to its delegate.
*/
@property (nonatomic, assign) BOOL microphoneOn;
//------------------------------------------------------------------------------
/**
An EZOutput to use for porting the microphone input out (passthrough).
*/
@property (nonatomic, strong) EZOutput *output;
//------------------------------------------------------------------------------
#pragma mark - Initializers
//------------------------------------------------------------------------------
///-----------------------------------------------------------
/// @name Initializers
///-----------------------------------------------------------
/**
Creates an instance of the EZMicrophone with a delegate to respond to the audioReceived callback. This will not start fetching the audio until startFetchingAudio has been called. Use initWithMicrophoneDelegate:startsImmediately: to instantiate this class and immediately start fetching audio data.
@param microphoneDelegate A EZMicrophoneDelegate delegate that will receive the audioReceived callback.
@param delegate A EZMicrophoneDelegate delegate that will receive the audioReceived callback.
@return An instance of the EZMicrophone class. This should be strongly retained.
*/
-(EZMicrophone*)initWithMicrophoneDelegate:(id<EZMicrophoneDelegate>)microphoneDelegate;
- (EZMicrophone *)initWithMicrophoneDelegate:(id<EZMicrophoneDelegate>)delegate;
//------------------------------------------------------------------------------
/**
Creates an instance of the EZMicrophone with a custom AudioStreamBasicDescription and provides the caller to specify a delegate to respond to the audioReceived callback. This will not start fetching the audio until startFetchingAudio has been called. Use initWithMicrophoneDelegate:startsImmediately: to instantiate this class and immediately start fetching audio data.
@@ -125,49 +169,60 @@
@param audioStreamBasicDescription A custom AudioStreamBasicFormat for the microphone input.
@return An instance of the EZMicrophone class. This should be strongly retained.
*/
-(EZMicrophone*)initWithMicrophoneDelegate:(id<EZMicrophoneDelegate>)microphoneDelegate
withAudioStreamBasicDescription:(AudioStreamBasicDescription)audioStreamBasicDescription;
-(EZMicrophone *)initWithMicrophoneDelegate:(id<EZMicrophoneDelegate>)delegate
withAudioStreamBasicDescription:(AudioStreamBasicDescription)audioStreamBasicDescription;
//------------------------------------------------------------------------------
/**
Creates an instance of the EZMicrophone with a delegate to respond to the audioReceived callback and allows the caller to specify whether they'd immediately like to start fetching the audio data.
@param microphoneDelegate A EZMicrophoneDelegate delegate that will receive the audioReceived callback.
@param delegate A EZMicrophoneDelegate delegate that will receive the audioReceived callback.
@param startsImmediately A boolean indicating whether to start fetching the data immediately. IF YES, the delegate's audioReceived callback will immediately start getting called.
@return An instance of the EZMicrophone class. This should be strongly retained.
*/
-(EZMicrophone*)initWithMicrophoneDelegate:(id<EZMicrophoneDelegate>)microphoneDelegate
startsImmediately:(BOOL)startsImmediately;
- (EZMicrophone *)initWithMicrophoneDelegate:(id<EZMicrophoneDelegate>)delegate
startsImmediately:(BOOL)startsImmediately;
//------------------------------------------------------------------------------
/**
Creates an instance of the EZMicrophone with a custom AudioStreamBasicDescription and provides the caller with a delegate to respond to the audioReceived callback and allows the caller to specify whether they'd immediately like to start fetching the audio data.
@param microphoneDelegate A EZMicrophoneDelegate delegate that will receive the audioReceived callback.
@param delegate A EZMicrophoneDelegate delegate that will receive the audioReceived callback.
@param audioStreamBasicDescription A custom AudioStreamBasicFormat for the microphone input.
@param startsImmediately A boolean indicating whether to start fetching the data immediately. IF YES, the delegate's audioReceived callback will immediately start getting called.
@return An instance of the EZMicrophone class. This should be strongly retained.
*/
-(EZMicrophone*)initWithMicrophoneDelegate:(id<EZMicrophoneDelegate>)microphoneDelegate
withAudioStreamBasicDescription:(AudioStreamBasicDescription)audioStreamBasicDescription
startsImmediately:(BOOL)startsImmediately;
- (EZMicrophone *)initWithMicrophoneDelegate:(id<EZMicrophoneDelegate>)delegate
withAudioStreamBasicDescription:(AudioStreamBasicDescription)audioStreamBasicDescription
startsImmediately:(BOOL)startsImmediately;
//------------------------------------------------------------------------------
#pragma mark - Class Initializers
//------------------------------------------------------------------------------
///-----------------------------------------------------------
/// @name Class Initializers
///-----------------------------------------------------------
/**
Creates an instance of the EZMicrophone with a delegate to respond to the audioReceived callback. This will not start fetching the audio until startFetchingAudio has been called. Use microphoneWithDelegate:startsImmediately: to instantiate this class and immediately start fetching audio data.
@param microphoneDelegate A EZMicrophoneDelegate delegate that will receive the audioReceived callback.
@param delegate A EZMicrophoneDelegate delegate that will receive the audioReceived callback.
@return An instance of the EZMicrophone class. This should be declared as a strong property!
*/
+(EZMicrophone*)microphoneWithDelegate:(id<EZMicrophoneDelegate>)microphoneDelegate;
+ (EZMicrophone *)microphoneWithDelegate:(id<EZMicrophoneDelegate>)delegate;
//------------------------------------------------------------------------------
/**
Creates an instance of the EZMicrophone with a delegate to respond to the audioReceived callback. This will not start fetching the audio until startFetchingAudio has been called. Use microphoneWithDelegate:startsImmediately: to instantiate this class and immediately start fetching audio data.
@param microphoneDelegate A EZMicrophoneDelegate delegate that will receive the audioReceived callback.
@param delegate A EZMicrophoneDelegate delegate that will receive the audioReceived callback.
@param audioStreamBasicDescription A custom AudioStreamBasicFormat for the microphone input.
@return An instance of the EZMicrophone class. This should be declared as a strong property!
*/
+(EZMicrophone*)microphoneWithDelegate:(id<EZMicrophoneDelegate>)microphoneDelegate
withAudioStreamBasicDescription:(AudioStreamBasicDescription)audioStreamBasicDescription;
+ (EZMicrophone *)microphoneWithDelegate:(id<EZMicrophoneDelegate>)delegate
withAudioStreamBasicDescription:(AudioStreamBasicDescription)audioStreamBasicDescription;
//------------------------------------------------------------------------------
/**
Creates an instance of the EZMicrophone with a delegate to respond to the audioReceived callback and allows the caller to specify whether they'd immediately like to start fetching the audio data.
@@ -176,8 +231,10 @@
@param startsImmediately A boolean indicating whether to start fetching the data immediately. IF YES, the delegate's audioReceived callback will immediately start getting called.
@return An instance of the EZMicrophone class. This should be strongly retained.
*/
+(EZMicrophone*)microphoneWithDelegate:(id<EZMicrophoneDelegate>)microphoneDelegate
startsImmediately:(BOOL)startsImmediately;
+ (EZMicrophone *)microphoneWithDelegate:(id<EZMicrophoneDelegate>)delegate
startsImmediately:(BOOL)startsImmediately;
//------------------------------------------------------------------------------
/**
Creates an instance of the EZMicrophone with a delegate to respond to the audioReceived callback and allows the caller to specify whether they'd immediately like to start fetching the audio data.
@@ -187,11 +244,14 @@
@param startsImmediately A boolean indicating whether to start fetching the data immediately. IF YES, the delegate's audioReceived callback will immediately start getting called.
@return An instance of the EZMicrophone class. This should be strongly retained.
*/
+(EZMicrophone*)microphoneWithDelegate:(id<EZMicrophoneDelegate>)microphoneDelegate
withAudioStreamBasicDescription:(AudioStreamBasicDescription)audioStreamBasicDescription
startsImmediately:(BOOL)startsImmediately;
+ (EZMicrophone *)microphoneWithDelegate:(id<EZMicrophoneDelegate>)delegate
withAudioStreamBasicDescription:(AudioStreamBasicDescription)audioStreamBasicDescription
startsImmediately:(BOOL)startsImmediately;
//------------------------------------------------------------------------------
#pragma mark - Shared Instance
//------------------------------------------------------------------------------
#pragma mark - Singleton
///-----------------------------------------------------------
/// @name Shared Instance
///-----------------------------------------------------------
@@ -200,9 +260,12 @@
A shared instance of the microphone component. Most applications will only need to use one instance of the microphone component across multiple views. Make sure to call the `startFetchingAudio` method to receive the audio data in the microphone delegate.
@return A shared instance of the `EZAudioMicrophone` component.
*/
+(EZMicrophone*)sharedMicrophone;
+ (EZMicrophone *)sharedMicrophone;
//------------------------------------------------------------------------------
#pragma mark - Events
//------------------------------------------------------------------------------
///-----------------------------------------------------------
/// @name Starting/Stopping The Microphone
///-----------------------------------------------------------
@@ -210,14 +273,19 @@
/**
Starts fetching audio from the default microphone. Will notify delegate with audioReceived callback.
*/
-(void)startFetchingAudio;
- (void)startFetchingAudio;
//------------------------------------------------------------------------------
/**
Stops fetching audio. Will stop notifying the delegate's audioReceived callback.
*/
-(void)stopFetchingAudio;
- (void)stopFetchingAudio;
//------------------------------------------------------------------------------
#pragma mark - Getters
//------------------------------------------------------------------------------
///-----------------------------------------------------------
/// @name Getting The Microphone's Audio Format
///-----------------------------------------------------------
@@ -226,18 +294,78 @@
Provides the AudioStreamBasicDescription structure containing the format of the microphone's audio.
@return An AudioStreamBasicDescription structure describing the format of the microphone's audio.
*/
-(AudioStreamBasicDescription)audioStreamBasicDescription;
- (AudioStreamBasicDescription)audioStreamBasicDescription;
//------------------------------------------------------------------------------
/**
Provides the underlying Audio Unit that is being used to fetch the audio.
@return The AudioUnit used for the microphone
*/
- (AudioUnit *)audioUnit;
#pragma mark - Setters
///-----------------------------------------------------------
/// @name Customizing The Microphone Input Format
/// @name Customizing The Microphone Stream Format
///-----------------------------------------------------------
/**
Sets the AudioStreamBasicDescription on the microphone input.
Sets the AudioStreamBasicDescription on the microphone input. Must be linear PCM and must be the same sample rate as the stream format coming in (check the current `audioStreamBasicDescription` before setting).
@warning Do not set this while fetching audio (startFetchingAudio)
@param asbd The new AudioStreamBasicDescription to use in place of the current audio format description.
*/
-(void)setAudioStreamBasicDescription:(AudioStreamBasicDescription)asbd;
- (void)setAudioStreamBasicDescription:(AudioStreamBasicDescription)asbd;
///-----------------------------------------------------------
/// @name Setting The Microphone's Hardware Device
///-----------------------------------------------------------
/**
Sets the EZAudioDevice being used to pull the microphone data.
- On iOS this can be any of the available microphones on the iPhone/iPad devices (usually there are 3). Defaults to the first microphone found (bottom mic)
- On OSX this can be any of the plugged in devices that Core Audio can detect (see kAudioUnitSubType_HALOutput for more information)
System Preferences -> Sound for the available inputs)
@param device An EZAudioDevice instance that should be used to fetch the microphone data.
*/
- (void)setDevice:(EZAudioDevice *)device;
//------------------------------------------------------------------------------
#pragma mark - Direct Output
//------------------------------------------------------------------------------
///-----------------------------------------------------------
/// @name Setting The Microphone's Output (Direct Out)
///-----------------------------------------------------------
/**
When set this will pipe out the contents of the microphone into an EZOutput. This is known as a passthrough or direct out that will simply pipe the microphone input to an output.
@param output An EZOutput instance that the microphone will use to output its audio data to the speaker.
*/
- (void)setOutput:(EZOutput *)output;
//------------------------------------------------------------------------------
#pragma mark - Subclass Methods
//------------------------------------------------------------------------------
///-----------------------------------------------------------
/// @name Subclass
///-----------------------------------------------------------
/**
The default AudioStreamBasicDescription set as the stream format of the microphone if no custom description is set. Defaults to a non-interleaved float format with the number of channels specified by the `numberOfChannels` method.
@return An AudioStreamBasicDescription that will be used as the default stream format.
*/
- (AudioStreamBasicDescription)defaultStreamFormat;
//------------------------------------------------------------------------------
/**
The number of channels the input microphone is expected to have. Defaults to 1 (assumes microphone is mono).
@return A UInt32 representing the number of channels expected for the microphone.
*/
- (UInt32)numberOfChannels;
//------------------------------------------------------------------------------
@end
+519 -508
View File
File diff suppressed because it is too large Load Diff
+36 -37
View File
@@ -24,8 +24,7 @@
// THE SOFTWARE.
#import "EZOutput.h"
#import "EZAudio.h"
#import "EZAudioUtilities.h"
@interface EZOutput (){
BOOL _customASBD;
@@ -49,7 +48,7 @@ static OSStatus OutputRenderCallback(void *inRefCon,
EZOutput *output = (__bridge EZOutput*)inRefCon;
// Manual override
if( [output.outputDataSource respondsToSelector:@selector(output:callbackWithActionFlags:inTimeStamp:inBusNumber:inNumberFrames:ioData:)] ){
if ([output.outputDataSource respondsToSelector:@selector(output:callbackWithActionFlags:inTimeStamp:inBusNumber:inNumberFrames:ioData:)]){
[output.outputDataSource output:output
callbackWithActionFlags:ioActionFlags
inTimeStamp:inTimeStamp
@@ -57,13 +56,13 @@ static OSStatus OutputRenderCallback(void *inRefCon,
inNumberFrames:inNumberFrames
ioData:ioData];
}
else if( [output.outputDataSource respondsToSelector:@selector(outputShouldUseCircularBuffer:)] ){
else if ([output.outputDataSource respondsToSelector:@selector(outputShouldUseCircularBuffer:)]){
TPCircularBuffer *circularBuffer = [output.outputDataSource outputShouldUseCircularBuffer:output];
if( !circularBuffer ){
if (!circularBuffer){
float *left = (float*)ioData->mBuffers[0].mData;
float *right = (float*)ioData->mBuffers[1].mData;
for(int i = 0; i < inNumberFrames; i++ ){
for(int i = 0; i < inNumberFrames; i++){
left[ i ] = 0.0f;
right[ i ] = 0.0f;
}
@@ -85,15 +84,15 @@ static OSStatus OutputRenderCallback(void *inRefCon,
// Ideally we'd have all the bytes to be copied, but compare it against the available bytes (get min)
int32_t amount = MIN(bytesToCopy,availableBytes);
memcpy( left, buffer, amount );
memcpy( right, buffer, amount );
memcpy( left, buffer, amount);
memcpy( right, buffer, amount);
// Consume those bytes ( this will internally push the head of the circular buffer )
// Consume those bytes ( this will internally push the head of the circular buffer)
TPCircularBufferConsume(circularBuffer,amount);
}
// Provided an AudioBufferList (defaults to silence)
else if( [output.outputDataSource respondsToSelector:@selector(output:shouldFillAudioBufferList:withNumberOfFrames:)] ) {
else if ([output.outputDataSource respondsToSelector:@selector(output:shouldFillAudioBufferList:withNumberOfFrames:)]) {
[output.outputDataSource output:output
shouldFillAudioBufferList:ioData
withNumberOfFrames:inNumberFrames];
@@ -170,14 +169,14 @@ static OSStatus OutputRenderCallback(void *inRefCon,
-(AudioComponent)_getOutputComponentWithAudioComponentDescription:(AudioComponentDescription)outputComponentDescription {
// Try and find the component
AudioComponent outputComponent = AudioComponentFindNext( NULL , &outputComponentDescription );
AudioComponent outputComponent = AudioComponentFindNext( NULL , &outputComponentDescription);
NSAssert(outputComponent,@"Couldn't get input component unit!");
return outputComponent;
}
-(void)_createNewInstanceForOutputComponent:(AudioComponent)outputComponent {
//
[EZAudio checkResult:AudioComponentInstanceNew( outputComponent, &_outputUnit )
[EZAudioUtilities checkResult:AudioComponentInstanceNew( outputComponent, &_outputUnit)
operation:"Failed to open component for output unit"];
}
@@ -209,13 +208,13 @@ static OSStatus OutputRenderCallback(void *inRefCon,
//
AudioComponent comp = AudioComponentFindNext(NULL,&outputcd);
[EZAudio checkResult:AudioComponentInstanceNew(comp,&_outputUnit)
[EZAudioUtilities checkResult:AudioComponentInstanceNew(comp,&_outputUnit)
operation:"Failed to get output unit"];
// Setup the output unit for playback
UInt32 oneFlag = 1;
AudioUnitElement bus0 = 0;
[EZAudio checkResult:AudioUnitSetProperty(_outputUnit,
[EZAudioUtilities checkResult:AudioUnitSetProperty(_outputUnit,
kAudioOutputUnitProperty_EnableIO,
kAudioUnitScope_Output,
bus0,
@@ -230,12 +229,12 @@ static OSStatus OutputRenderCallback(void *inRefCon,
#endif
// Setup an ASBD in canonical format by default
if( !_customASBD ){
_outputASBD = [EZAudio stereoCanonicalNonInterleavedFormatWithSampleRate:hardwareSampleRate];
if (!_customASBD){
_outputASBD = [EZAudioUtilities stereoCanonicalNonInterleavedFormatWithSampleRate:hardwareSampleRate];
}
// Set the format for output
[EZAudio checkResult:AudioUnitSetProperty(_outputUnit,
[EZAudioUtilities checkResult:AudioUnitSetProperty(_outputUnit,
kAudioUnitProperty_StreamFormat,
kAudioUnitScope_Input,
bus0,
@@ -247,7 +246,7 @@ static OSStatus OutputRenderCallback(void *inRefCon,
AURenderCallbackStruct input;
input.inputProc = OutputRenderCallback;
input.inputProcRefCon = (__bridge void *)self;
[EZAudio checkResult:AudioUnitSetProperty(_outputUnit,
[EZAudioUtilities checkResult:AudioUnitSetProperty(_outputUnit,
kAudioUnitProperty_SetRenderCallback,
kAudioUnitScope_Input,
bus0,
@@ -256,7 +255,7 @@ static OSStatus OutputRenderCallback(void *inRefCon,
operation:"Failed to set the render callback on the output unit"];
//
[EZAudio checkResult:AudioUnitInitialize(_outputUnit)
[EZAudioUtilities checkResult:AudioUnitInitialize(_outputUnit)
operation:"Couldn't initialize output unit"];
@@ -271,22 +270,22 @@ static OSStatus OutputRenderCallback(void *inRefCon,
outputcd.componentManufacturer = kAudioUnitManufacturer_Apple;
//
AudioComponent comp = AudioComponentFindNext(NULL,&outputcd);
if( comp == NULL ){
AudioComponent comp = AudioComponentFindNext(NULL, &outputcd);
if (comp == NULL){
NSLog(@"Failed to get output unit");
exit(-1);
}
[EZAudio checkResult:AudioComponentInstanceNew(comp,&_outputUnit)
[EZAudioUtilities checkResult:AudioComponentInstanceNew(comp, &_outputUnit)
operation:"Failed to open component for output unit"];
// Setup an ASBD in canonical format by default
if( !_customASBD ){
_outputASBD = [EZAudio stereoFloatNonInterleavedFormatWithSampleRate:44100];
if (!_customASBD){
_outputASBD = [EZAudioUtilities stereoFloatNonInterleavedFormatWithSampleRate:44100];
}
// Set the format for output
[EZAudio checkResult:AudioUnitSetProperty(_outputUnit,
[EZAudioUtilities checkResult:AudioUnitSetProperty(_outputUnit,
kAudioUnitProperty_StreamFormat,
kAudioUnitScope_Input,
0,
@@ -298,7 +297,7 @@ static OSStatus OutputRenderCallback(void *inRefCon,
AURenderCallbackStruct input;
input.inputProc = OutputRenderCallback;
input.inputProcRefCon = (__bridge void *)(self);
[EZAudio checkResult:AudioUnitSetProperty(_outputUnit,
[EZAudioUtilities checkResult:AudioUnitSetProperty(_outputUnit,
kAudioUnitProperty_SetRenderCallback,
kAudioUnitScope_Input,
0,
@@ -307,7 +306,7 @@ static OSStatus OutputRenderCallback(void *inRefCon,
operation:"Failed to set the render callback on the output unit"];
//
[EZAudio checkResult:AudioUnitInitialize(_outputUnit)
[EZAudioUtilities checkResult:AudioUnitInitialize(_outputUnit)
operation:"Couldn't initialize output unit"];
}
@@ -315,16 +314,16 @@ static OSStatus OutputRenderCallback(void *inRefCon,
#pragma mark - Events
-(void)startPlayback {
if( !_isPlaying ){
[EZAudio checkResult:AudioOutputUnitStart(_outputUnit)
if (!_isPlaying){
[EZAudioUtilities checkResult:AudioOutputUnitStart(_outputUnit)
operation:"Failed to start output unit"];
_isPlaying = YES;
}
}
-(void)stopPlayback {
if( _isPlaying ){
[EZAudio checkResult:AudioOutputUnitStop(_outputUnit)
if (_isPlaying){
[EZAudioUtilities checkResult:AudioOutputUnitStop(_outputUnit)
operation:"Failed to stop output unit"];
_isPlaying = NO;
}
@@ -342,32 +341,32 @@ static OSStatus OutputRenderCallback(void *inRefCon,
#pragma mark - Setters
-(void)setAudioStreamBasicDescription:(AudioStreamBasicDescription)asbd {
BOOL wasPlaying = NO;
if( self.isPlaying ){
if (self.isPlaying){
[self stopPlayback];
wasPlaying = YES;
}
_customASBD = YES;
_outputASBD = asbd;
// Set the format for output
[EZAudio checkResult:AudioUnitSetProperty(_outputUnit,
[EZAudioUtilities checkResult:AudioUnitSetProperty(_outputUnit,
kAudioUnitProperty_StreamFormat,
kAudioUnitScope_Input,
0,
&_outputASBD,
sizeof(_outputASBD))
operation:"Couldn't set the ASBD for input scope/bos 0"];
if( wasPlaying )
if (wasPlaying)
{
[self startPlayback];
}
}
-(void)dealloc {
[EZAudio checkResult:AudioOutputUnitStop(_outputUnit)
[EZAudioUtilities checkResult:AudioOutputUnitStop(_outputUnit)
operation:"Failed to uninitialize output unit"];
[EZAudio checkResult:AudioUnitUninitialize(_outputUnit)
[EZAudioUtilities checkResult:AudioUnitUninitialize(_outputUnit)
operation:"Failed to uninitialize output unit"];
[EZAudio checkResult:AudioComponentInstanceDispose(_outputUnit)
[EZAudioUtilities checkResult:AudioComponentInstanceDispose(_outputUnit)
operation:"Failed to uninitialize output unit"];
}
+2
View File
@@ -23,6 +23,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import <Foundation/Foundation.h>
#pragma mark - Enumerations
///-----------------------------------------------------------
/// @name Plot Types
-4
View File
@@ -25,10 +25,6 @@
#import "EZPlot.h"
@interface EZPlot ()
@end
@implementation EZPlot
#pragma mark - Clearing
+15 -16
View File
@@ -24,8 +24,7 @@
// THE SOFTWARE.
#import "EZRecorder.h"
#import "EZAudio.h"
#import "EZAudioUtilities.h"
@interface EZRecorder (){
ExtAudioFileRef _destinationFile;
@@ -45,7 +44,7 @@
destinationFileType:(EZRecorderFileType)destinationFileType
{
self = [super init];
if( self )
if (self)
{
// Set defaults
_destinationFile = NULL;
@@ -77,23 +76,23 @@
withSourceFormat:(AudioStreamBasicDescription)sourceFormat
{
AudioStreamBasicDescription asbd;
switch ( fileType )
switch ( fileType)
{
case EZRecorderFileTypeAIFF:
asbd = [EZAudio AIFFFormatWithNumberOfChannels:sourceFormat.mChannelsPerFrame
asbd = [EZAudioUtilities AIFFFormatWithNumberOfChannels:sourceFormat.mChannelsPerFrame
sampleRate:sourceFormat.mSampleRate];
break;
case EZRecorderFileTypeM4A:
asbd = [EZAudio M4AFormatWithNumberOfChannels:sourceFormat.mChannelsPerFrame
asbd = [EZAudioUtilities M4AFormatWithNumberOfChannels:sourceFormat.mChannelsPerFrame
sampleRate:sourceFormat.mSampleRate];
break;
case EZRecorderFileTypeWAV:
asbd = [EZAudio stereoFloatInterleavedFormatWithSampleRate:sourceFormat.mSampleRate];
asbd = [EZAudioUtilities stereoFloatInterleavedFormatWithSampleRate:sourceFormat.mSampleRate];
break;
default:
asbd = [EZAudio stereoCanonicalNonInterleavedFormatWithSampleRate:sourceFormat.mSampleRate];
asbd = [EZAudioUtilities stereoCanonicalNonInterleavedFormatWithSampleRate:sourceFormat.mSampleRate];
break;
}
return asbd;
@@ -103,7 +102,7 @@
withSourceFormat:(AudioStreamBasicDescription)sourceFormat
{
AudioFileTypeID audioFileTypeID;
switch ( fileType )
switch ( fileType)
{
case EZRecorderFileTypeAIFF:
audioFileTypeID = kAudioFileAIFFType;
@@ -128,7 +127,7 @@
{
// Finish filling out the destination format description
UInt32 propSize = sizeof(_destinationFormat);
[EZAudio checkResult:AudioFormatGetProperty(kAudioFormatProperty_FormatInfo,
[EZAudioUtilities checkResult:AudioFormatGetProperty(kAudioFormatProperty_FormatInfo,
0,
NULL,
&propSize,
@@ -136,7 +135,7 @@
operation:"Failed to fill out rest of destination format"];
// Create the audio file
[EZAudio checkResult:ExtAudioFileCreateWithURL(_destinationFileURL,
[EZAudioUtilities checkResult:ExtAudioFileCreateWithURL(_destinationFileURL,
_destinationFileTypeID,
&_destinationFormat,
NULL,
@@ -145,7 +144,7 @@
operation:"Failed to create audio file"];
// Set the client format (which should be equal to the source format)
[EZAudio checkResult:ExtAudioFileSetProperty(_destinationFile,
[EZAudioUtilities checkResult:ExtAudioFileSetProperty(_destinationFile,
kExtAudioFileProperty_ClientDataFormat,
sizeof(_sourceFormat),
&_sourceFormat)
@@ -157,9 +156,9 @@
-(void)appendDataFromBufferList:(AudioBufferList *)bufferList
withBufferSize:(UInt32)bufferSize
{
if( _destinationFile )
if (_destinationFile)
{
[EZAudio checkResult:ExtAudioFileWriteAsync(_destinationFile,
[EZAudioUtilities checkResult:ExtAudioFileWriteAsync(_destinationFile,
bufferSize,
bufferList)
operation:"Failed to write audio data to recorded audio file"];
@@ -168,10 +167,10 @@
-(void)closeAudioFile
{
if( _destinationFile )
if (_destinationFile)
{
// Dispose of the audio file reference
[EZAudio checkResult:ExtAudioFileDispose(_destinationFile)
[EZAudioUtilities checkResult:ExtAudioFileDispose(_destinationFile)
operation:"Failed to close audio file"];
// Null out the file reference
+11 -11
View File
@@ -33,7 +33,7 @@
#define reportResult(result,operation) (_reportResult((result),(operation),strrchr(__FILE__, '/')+1,__LINE__))
static inline bool _reportResult(kern_return_t result, const char *operation, const char* file, int line) {
if ( result != ERR_SUCCESS ) {
if (result != ERR_SUCCESS) {
printf("%s:%d: %s: %s\n", file, line, operation, mach_error_string(result));
return false;
}
@@ -44,7 +44,7 @@ bool TPCircularBufferInit(TPCircularBuffer *buffer, int length) {
// Keep trying until we get our buffer, needed to handle race conditions
int retries = 3;
while ( true ) {
while ( true) {
buffer->length = (int32_t)round_page(length); // We need whole page sizes
@@ -55,8 +55,8 @@ bool TPCircularBufferInit(TPCircularBuffer *buffer, int length) {
&bufferAddress,
buffer->length * 2,
VM_FLAGS_ANYWHERE); // allocate anywhere it'll fit
if ( result != ERR_SUCCESS ) {
if ( retries-- == 0 ) {
if (result != ERR_SUCCESS) {
if (retries-- == 0) {
reportResult(result, "Buffer allocation");
return false;
}
@@ -68,8 +68,8 @@ bool TPCircularBufferInit(TPCircularBuffer *buffer, int length) {
result = vm_deallocate(mach_task_self(),
bufferAddress + buffer->length,
buffer->length);
if ( result != ERR_SUCCESS ) {
if ( retries-- == 0 ) {
if (result != ERR_SUCCESS) {
if (retries-- == 0) {
reportResult(result, "Buffer deallocation");
return false;
}
@@ -92,8 +92,8 @@ bool TPCircularBufferInit(TPCircularBuffer *buffer, int length) {
&cur_prot, // unused protection struct
&max_prot, // unused protection struct
VM_INHERIT_DEFAULT);
if ( result != ERR_SUCCESS ) {
if ( retries-- == 0 ) {
if (result != ERR_SUCCESS) {
if (retries-- == 0) {
reportResult(result, "Remap buffer memory");
return false;
}
@@ -102,9 +102,9 @@ bool TPCircularBufferInit(TPCircularBuffer *buffer, int length) {
continue;
}
if ( virtualAddress != bufferAddress+buffer->length ) {
if (virtualAddress != bufferAddress+buffer->length) {
// If the memory is not contiguous, clean up both allocated buffers and try again
if ( retries-- == 0 ) {
if (retries-- == 0) {
printf("Couldn't map buffer memory to end of buffer\n");
return false;
}
@@ -130,7 +130,7 @@ void TPCircularBufferCleanup(TPCircularBuffer *buffer) {
void TPCircularBufferClear(TPCircularBuffer *buffer) {
int32_t fillCount;
if ( TPCircularBufferTail(buffer, &fillCount) ) {
if (TPCircularBufferTail(buffer, &fillCount)) {
TPCircularBufferConsume(buffer, fillCount);
}
}
+3 -3
View File
@@ -101,7 +101,7 @@ void TPCircularBufferClear(TPCircularBuffer *buffer);
*/
static __inline__ __attribute__((always_inline)) void* TPCircularBufferTail(TPCircularBuffer *buffer, int32_t* availableBytes) {
*availableBytes = buffer->fillCount;
if ( *availableBytes == 0 ) return NULL;
if (*availableBytes == 0) return NULL;
return (void*)((char*)buffer->buffer + buffer->tail);
}
@@ -140,7 +140,7 @@ static __inline__ __attribute__((always_inline)) void TPCircularBufferConsumeNoB
*/
static __inline__ __attribute__((always_inline)) void* TPCircularBufferHead(TPCircularBuffer *buffer, int32_t* availableBytes) {
*availableBytes = (buffer->length - buffer->fillCount);
if ( *availableBytes == 0 ) return NULL;
if (*availableBytes == 0) return NULL;
return (void*)((char*)buffer->buffer + buffer->head);
}
@@ -182,7 +182,7 @@ static __inline__ __attribute__((always_inline)) void TPCircularBufferProduceNoB
static __inline__ __attribute__((always_inline)) bool TPCircularBufferProduceBytes(TPCircularBuffer *buffer, const void* src, int32_t len) {
int32_t space;
void *ptr = TPCircularBufferHead(buffer, &space);
if ( space < len ) return false;
if (space < len) return false;
memcpy(ptr, src, len);
TPCircularBufferProduce(buffer, len);
return true;
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
@@ -21,21 +21,26 @@
/* End PBXAggregateTarget section */
/* Begin PBXBuildFile section */
665956E81B38B256003E97A1 /* AEFloatConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 665956C61B38B256003E97A1 /* AEFloatConverter.m */; };
665956E91B38B256003E97A1 /* EZAudio.m in Sources */ = {isa = PBXBuildFile; fileRef = 665956C81B38B256003E97A1 /* EZAudio.m */; };
665956EA1B38B256003E97A1 /* EZAudioDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = 665956CA1B38B256003E97A1 /* EZAudioDevice.m */; };
665956EB1B38B256003E97A1 /* EZAudioFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 665956CC1B38B256003E97A1 /* EZAudioFile.m */; };
665956EC1B38B256003E97A1 /* EZAudioFloatConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 665956CE1B38B256003E97A1 /* EZAudioFloatConverter.m */; };
665956ED1B38B256003E97A1 /* EZAudioFloatData.m in Sources */ = {isa = PBXBuildFile; fileRef = 665956D01B38B256003E97A1 /* EZAudioFloatData.m */; };
665956EE1B38B256003E97A1 /* EZAudioPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 665956D21B38B256003E97A1 /* EZAudioPlayer.m */; };
665956EF1B38B256003E97A1 /* EZAudioPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 665956D41B38B256003E97A1 /* EZAudioPlot.m */; };
665956F01B38B256003E97A1 /* EZAudioPlotGL.m in Sources */ = {isa = PBXBuildFile; fileRef = 665956D61B38B256003E97A1 /* EZAudioPlotGL.m */; };
665956F11B38B256003E97A1 /* EZAudioPlotGLKViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 665956D81B38B256003E97A1 /* EZAudioPlotGLKViewController.m */; };
665956F21B38B256003E97A1 /* EZAudioUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = 665956DA1B38B256003E97A1 /* EZAudioUtilities.m */; };
665956F31B38B256003E97A1 /* EZMicrophone.m in Sources */ = {isa = PBXBuildFile; fileRef = 665956DC1B38B256003E97A1 /* EZMicrophone.m */; };
665956F41B38B256003E97A1 /* EZOutput.m in Sources */ = {isa = PBXBuildFile; fileRef = 665956DE1B38B256003E97A1 /* EZOutput.m */; };
665956F51B38B256003E97A1 /* EZPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 665956E01B38B256003E97A1 /* EZPlot.m */; };
665956F61B38B256003E97A1 /* EZRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 665956E21B38B256003E97A1 /* EZRecorder.m */; };
665956F71B38B256003E97A1 /* TPCircularBuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 665956E31B38B256003E97A1 /* TPCircularBuffer.c */; };
665956F81B38B256003E97A1 /* CHANGELOG in Resources */ = {isa = PBXBuildFile; fileRef = 665956E61B38B256003E97A1 /* CHANGELOG */; };
665956F91B38B256003E97A1 /* VERSION in Resources */ = {isa = PBXBuildFile; fileRef = 665956E71B38B256003E97A1 /* VERSION */; };
94056D88185B97E300EB94BA /* CoreGraphicsWaveformViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 94056D86185B97E300EB94BA /* CoreGraphicsWaveformViewController.m */; };
94056D89185B97E300EB94BA /* CoreGraphicsWaveformViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 94056D87185B97E300EB94BA /* CoreGraphicsWaveformViewController.xib */; };
9417A6F01867DC8300D9D37B /* AEFloatConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A6D81867DC8300D9D37B /* AEFloatConverter.m */; };
9417A6F11867DC8300D9D37B /* EZAudio.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A6DA1867DC8300D9D37B /* EZAudio.m */; };
9417A6F21867DC8300D9D37B /* EZAudioFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A6DC1867DC8300D9D37B /* EZAudioFile.m */; };
9417A6F31867DC8300D9D37B /* EZAudioPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A6DE1867DC8300D9D37B /* EZAudioPlot.m */; };
9417A6F41867DC8300D9D37B /* EZAudioPlotGL.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A6E01867DC8300D9D37B /* EZAudioPlotGL.m */; };
9417A6F51867DC8300D9D37B /* EZAudioPlotGLKViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A6E21867DC8300D9D37B /* EZAudioPlotGLKViewController.m */; };
9417A6F61867DC8300D9D37B /* EZMicrophone.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A6E41867DC8300D9D37B /* EZMicrophone.m */; };
9417A6F71867DC8300D9D37B /* EZOutput.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A6E61867DC8300D9D37B /* EZOutput.m */; };
9417A6F81867DC8300D9D37B /* EZPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A6E81867DC8300D9D37B /* EZPlot.m */; };
9417A6F91867DC8300D9D37B /* EZRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A6EA1867DC8300D9D37B /* EZRecorder.m */; };
9417A6FA1867DC8300D9D37B /* TPCircularBuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 9417A6EB1867DC8300D9D37B /* TPCircularBuffer.c */; };
9417A6FB1867DC8300D9D37B /* CHANGELOG in Resources */ = {isa = PBXBuildFile; fileRef = 9417A6EE1867DC8300D9D37B /* CHANGELOG */; };
9417A6FC1867DC8300D9D37B /* VERSION in Resources */ = {isa = PBXBuildFile; fileRef = 9417A6EF1867DC8300D9D37B /* VERSION */; };
94373025185B931C00F315F0 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 94373024185B931C00F315F0 /* Cocoa.framework */; };
9437302F185B931C00F315F0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 9437302D185B931C00F315F0 /* InfoPlist.strings */; };
94373031185B931C00F315F0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 94373030185B931C00F315F0 /* main.m */; };
@@ -66,33 +71,43 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
665956C51B38B256003E97A1 /* AEFloatConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AEFloatConverter.h; sourceTree = "<group>"; };
665956C61B38B256003E97A1 /* AEFloatConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AEFloatConverter.m; sourceTree = "<group>"; };
665956C71B38B256003E97A1 /* EZAudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudio.h; sourceTree = "<group>"; };
665956C81B38B256003E97A1 /* EZAudio.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudio.m; sourceTree = "<group>"; };
665956C91B38B256003E97A1 /* EZAudioDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioDevice.h; sourceTree = "<group>"; };
665956CA1B38B256003E97A1 /* EZAudioDevice.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioDevice.m; sourceTree = "<group>"; };
665956CB1B38B256003E97A1 /* EZAudioFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFile.h; sourceTree = "<group>"; };
665956CC1B38B256003E97A1 /* EZAudioFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFile.m; sourceTree = "<group>"; };
665956CD1B38B256003E97A1 /* EZAudioFloatConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFloatConverter.h; sourceTree = "<group>"; };
665956CE1B38B256003E97A1 /* EZAudioFloatConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFloatConverter.m; sourceTree = "<group>"; };
665956CF1B38B256003E97A1 /* EZAudioFloatData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFloatData.h; sourceTree = "<group>"; };
665956D01B38B256003E97A1 /* EZAudioFloatData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFloatData.m; sourceTree = "<group>"; };
665956D11B38B256003E97A1 /* EZAudioPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlayer.h; sourceTree = "<group>"; };
665956D21B38B256003E97A1 /* EZAudioPlayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlayer.m; sourceTree = "<group>"; };
665956D31B38B256003E97A1 /* EZAudioPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlot.h; sourceTree = "<group>"; };
665956D41B38B256003E97A1 /* EZAudioPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlot.m; sourceTree = "<group>"; };
665956D51B38B256003E97A1 /* EZAudioPlotGL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGL.h; sourceTree = "<group>"; };
665956D61B38B256003E97A1 /* EZAudioPlotGL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGL.m; sourceTree = "<group>"; };
665956D71B38B256003E97A1 /* EZAudioPlotGLKViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGLKViewController.h; sourceTree = "<group>"; };
665956D81B38B256003E97A1 /* EZAudioPlotGLKViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGLKViewController.m; sourceTree = "<group>"; };
665956D91B38B256003E97A1 /* EZAudioUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioUtilities.h; sourceTree = "<group>"; };
665956DA1B38B256003E97A1 /* EZAudioUtilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioUtilities.m; sourceTree = "<group>"; };
665956DB1B38B256003E97A1 /* EZMicrophone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZMicrophone.h; sourceTree = "<group>"; };
665956DC1B38B256003E97A1 /* EZMicrophone.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZMicrophone.m; sourceTree = "<group>"; };
665956DD1B38B256003E97A1 /* EZOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZOutput.h; sourceTree = "<group>"; };
665956DE1B38B256003E97A1 /* EZOutput.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZOutput.m; sourceTree = "<group>"; };
665956DF1B38B256003E97A1 /* EZPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZPlot.h; sourceTree = "<group>"; };
665956E01B38B256003E97A1 /* EZPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZPlot.m; sourceTree = "<group>"; };
665956E11B38B256003E97A1 /* EZRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZRecorder.h; sourceTree = "<group>"; };
665956E21B38B256003E97A1 /* EZRecorder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZRecorder.m; sourceTree = "<group>"; };
665956E31B38B256003E97A1 /* TPCircularBuffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = TPCircularBuffer.c; sourceTree = "<group>"; };
665956E41B38B256003E97A1 /* TPCircularBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TPCircularBuffer.h; sourceTree = "<group>"; };
665956E61B38B256003E97A1 /* CHANGELOG */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CHANGELOG; sourceTree = "<group>"; };
665956E71B38B256003E97A1 /* VERSION */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VERSION; sourceTree = "<group>"; };
94056D85185B97E300EB94BA /* CoreGraphicsWaveformViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = CoreGraphicsWaveformViewController.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
94056D86185B97E300EB94BA /* CoreGraphicsWaveformViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CoreGraphicsWaveformViewController.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
94056D87185B97E300EB94BA /* CoreGraphicsWaveformViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CoreGraphicsWaveformViewController.xib; sourceTree = "<group>"; };
9417A6D71867DC8300D9D37B /* AEFloatConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AEFloatConverter.h; sourceTree = "<group>"; };
9417A6D81867DC8300D9D37B /* AEFloatConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AEFloatConverter.m; sourceTree = "<group>"; };
9417A6D91867DC8300D9D37B /* EZAudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudio.h; sourceTree = "<group>"; };
9417A6DA1867DC8300D9D37B /* EZAudio.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudio.m; sourceTree = "<group>"; };
9417A6DB1867DC8300D9D37B /* EZAudioFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFile.h; sourceTree = "<group>"; };
9417A6DC1867DC8300D9D37B /* EZAudioFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFile.m; sourceTree = "<group>"; };
9417A6DD1867DC8300D9D37B /* EZAudioPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlot.h; sourceTree = "<group>"; };
9417A6DE1867DC8300D9D37B /* EZAudioPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlot.m; sourceTree = "<group>"; };
9417A6DF1867DC8300D9D37B /* EZAudioPlotGL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGL.h; sourceTree = "<group>"; };
9417A6E01867DC8300D9D37B /* EZAudioPlotGL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGL.m; sourceTree = "<group>"; };
9417A6E11867DC8300D9D37B /* EZAudioPlotGLKViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGLKViewController.h; sourceTree = "<group>"; };
9417A6E21867DC8300D9D37B /* EZAudioPlotGLKViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGLKViewController.m; sourceTree = "<group>"; };
9417A6E31867DC8300D9D37B /* EZMicrophone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZMicrophone.h; sourceTree = "<group>"; };
9417A6E41867DC8300D9D37B /* EZMicrophone.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZMicrophone.m; sourceTree = "<group>"; };
9417A6E51867DC8300D9D37B /* EZOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZOutput.h; sourceTree = "<group>"; };
9417A6E61867DC8300D9D37B /* EZOutput.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZOutput.m; sourceTree = "<group>"; };
9417A6E71867DC8300D9D37B /* EZPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZPlot.h; sourceTree = "<group>"; };
9417A6E81867DC8300D9D37B /* EZPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZPlot.m; sourceTree = "<group>"; };
9417A6E91867DC8300D9D37B /* EZRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZRecorder.h; sourceTree = "<group>"; };
9417A6EA1867DC8300D9D37B /* EZRecorder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZRecorder.m; sourceTree = "<group>"; };
9417A6EB1867DC8300D9D37B /* TPCircularBuffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = TPCircularBuffer.c; sourceTree = "<group>"; };
9417A6EC1867DC8300D9D37B /* TPCircularBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TPCircularBuffer.h; sourceTree = "<group>"; };
9417A6EE1867DC8300D9D37B /* CHANGELOG */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CHANGELOG; sourceTree = "<group>"; };
9417A6EF1867DC8300D9D37B /* VERSION */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VERSION; sourceTree = "<group>"; };
94373021185B931C00F315F0 /* EZAudioCoreGraphicsWaveformExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = EZAudioCoreGraphicsWaveformExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
94373024185B931C00F315F0 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
94373027185B931C00F315F0 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
@@ -147,42 +162,52 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
9417A6D61867DC8300D9D37B /* EZAudio */ = {
665956C41B38B256003E97A1 /* EZAudio */ = {
isa = PBXGroup;
children = (
9417A6D71867DC8300D9D37B /* AEFloatConverter.h */,
9417A6D81867DC8300D9D37B /* AEFloatConverter.m */,
9417A6D91867DC8300D9D37B /* EZAudio.h */,
9417A6DA1867DC8300D9D37B /* EZAudio.m */,
9417A6DB1867DC8300D9D37B /* EZAudioFile.h */,
9417A6DC1867DC8300D9D37B /* EZAudioFile.m */,
9417A6DD1867DC8300D9D37B /* EZAudioPlot.h */,
9417A6DE1867DC8300D9D37B /* EZAudioPlot.m */,
9417A6DF1867DC8300D9D37B /* EZAudioPlotGL.h */,
9417A6E01867DC8300D9D37B /* EZAudioPlotGL.m */,
9417A6E11867DC8300D9D37B /* EZAudioPlotGLKViewController.h */,
9417A6E21867DC8300D9D37B /* EZAudioPlotGLKViewController.m */,
9417A6E31867DC8300D9D37B /* EZMicrophone.h */,
9417A6E41867DC8300D9D37B /* EZMicrophone.m */,
9417A6E51867DC8300D9D37B /* EZOutput.h */,
9417A6E61867DC8300D9D37B /* EZOutput.m */,
9417A6E71867DC8300D9D37B /* EZPlot.h */,
9417A6E81867DC8300D9D37B /* EZPlot.m */,
9417A6E91867DC8300D9D37B /* EZRecorder.h */,
9417A6EA1867DC8300D9D37B /* EZRecorder.m */,
9417A6EB1867DC8300D9D37B /* TPCircularBuffer.c */,
9417A6EC1867DC8300D9D37B /* TPCircularBuffer.h */,
9417A6ED1867DC8300D9D37B /* VERSION */,
665956C51B38B256003E97A1 /* AEFloatConverter.h */,
665956C61B38B256003E97A1 /* AEFloatConverter.m */,
665956C71B38B256003E97A1 /* EZAudio.h */,
665956C81B38B256003E97A1 /* EZAudio.m */,
665956C91B38B256003E97A1 /* EZAudioDevice.h */,
665956CA1B38B256003E97A1 /* EZAudioDevice.m */,
665956CB1B38B256003E97A1 /* EZAudioFile.h */,
665956CC1B38B256003E97A1 /* EZAudioFile.m */,
665956CD1B38B256003E97A1 /* EZAudioFloatConverter.h */,
665956CE1B38B256003E97A1 /* EZAudioFloatConverter.m */,
665956CF1B38B256003E97A1 /* EZAudioFloatData.h */,
665956D01B38B256003E97A1 /* EZAudioFloatData.m */,
665956D11B38B256003E97A1 /* EZAudioPlayer.h */,
665956D21B38B256003E97A1 /* EZAudioPlayer.m */,
665956D31B38B256003E97A1 /* EZAudioPlot.h */,
665956D41B38B256003E97A1 /* EZAudioPlot.m */,
665956D51B38B256003E97A1 /* EZAudioPlotGL.h */,
665956D61B38B256003E97A1 /* EZAudioPlotGL.m */,
665956D71B38B256003E97A1 /* EZAudioPlotGLKViewController.h */,
665956D81B38B256003E97A1 /* EZAudioPlotGLKViewController.m */,
665956D91B38B256003E97A1 /* EZAudioUtilities.h */,
665956DA1B38B256003E97A1 /* EZAudioUtilities.m */,
665956DB1B38B256003E97A1 /* EZMicrophone.h */,
665956DC1B38B256003E97A1 /* EZMicrophone.m */,
665956DD1B38B256003E97A1 /* EZOutput.h */,
665956DE1B38B256003E97A1 /* EZOutput.m */,
665956DF1B38B256003E97A1 /* EZPlot.h */,
665956E01B38B256003E97A1 /* EZPlot.m */,
665956E11B38B256003E97A1 /* EZRecorder.h */,
665956E21B38B256003E97A1 /* EZRecorder.m */,
665956E31B38B256003E97A1 /* TPCircularBuffer.c */,
665956E41B38B256003E97A1 /* TPCircularBuffer.h */,
665956E51B38B256003E97A1 /* VERSION */,
);
name = EZAudio;
path = ../../../../EZAudio;
sourceTree = "<group>";
};
9417A6ED1867DC8300D9D37B /* VERSION */ = {
665956E51B38B256003E97A1 /* VERSION */ = {
isa = PBXGroup;
children = (
9417A6EE1867DC8300D9D37B /* CHANGELOG */,
9417A6EF1867DC8300D9D37B /* VERSION */,
665956E61B38B256003E97A1 /* CHANGELOG */,
665956E71B38B256003E97A1 /* VERSION */,
);
path = VERSION;
sourceTree = "<group>";
@@ -235,7 +260,7 @@
9437302A185B931C00F315F0 /* EZAudioCoreGraphicsWaveformExample */ = {
isa = PBXGroup;
children = (
9417A6D61867DC8300D9D37B /* EZAudio */,
665956C41B38B256003E97A1 /* EZAudio */,
94373036185B931C00F315F0 /* AppDelegate.h */,
94373037185B931C00F315F0 /* AppDelegate.m */,
94056D85185B97E300EB94BA /* CoreGraphicsWaveformViewController.h */,
@@ -356,12 +381,12 @@
buildActionMask = 2147483647;
files = (
9437302F185B931C00F315F0 /* InfoPlist.strings in Resources */,
9417A6FC1867DC8300D9D37B /* VERSION in Resources */,
665956F91B38B256003E97A1 /* VERSION in Resources */,
9437303D185B931C00F315F0 /* Images.xcassets in Resources */,
94373035185B931C00F315F0 /* Credits.rtf in Resources */,
94056D89185B97E300EB94BA /* CoreGraphicsWaveformViewController.xib in Resources */,
9437303B185B931C00F315F0 /* MainMenu.xib in Resources */,
9417A6FB1867DC8300D9D37B /* CHANGELOG in Resources */,
665956F81B38B256003E97A1 /* CHANGELOG in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -396,20 +421,25 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9417A6FA1867DC8300D9D37B /* TPCircularBuffer.c in Sources */,
9417A6F71867DC8300D9D37B /* EZOutput.m in Sources */,
9417A6F51867DC8300D9D37B /* EZAudioPlotGLKViewController.m in Sources */,
665956F61B38B256003E97A1 /* EZRecorder.m in Sources */,
94056D88185B97E300EB94BA /* CoreGraphicsWaveformViewController.m in Sources */,
9417A6F01867DC8300D9D37B /* AEFloatConverter.m in Sources */,
665956EC1B38B256003E97A1 /* EZAudioFloatConverter.m in Sources */,
665956ED1B38B256003E97A1 /* EZAudioFloatData.m in Sources */,
665956E81B38B256003E97A1 /* AEFloatConverter.m in Sources */,
665956EB1B38B256003E97A1 /* EZAudioFile.m in Sources */,
665956F41B38B256003E97A1 /* EZOutput.m in Sources */,
665956F01B38B256003E97A1 /* EZAudioPlotGL.m in Sources */,
665956F71B38B256003E97A1 /* TPCircularBuffer.c in Sources */,
665956EF1B38B256003E97A1 /* EZAudioPlot.m in Sources */,
94373038185B931C00F315F0 /* AppDelegate.m in Sources */,
9417A6F31867DC8300D9D37B /* EZAudioPlot.m in Sources */,
9417A6F21867DC8300D9D37B /* EZAudioFile.m in Sources */,
9417A6F41867DC8300D9D37B /* EZAudioPlotGL.m in Sources */,
665956F31B38B256003E97A1 /* EZMicrophone.m in Sources */,
665956EE1B38B256003E97A1 /* EZAudioPlayer.m in Sources */,
665956EA1B38B256003E97A1 /* EZAudioDevice.m in Sources */,
94373031185B931C00F315F0 /* main.m in Sources */,
9417A6F81867DC8300D9D37B /* EZPlot.m in Sources */,
9417A6F61867DC8300D9D37B /* EZMicrophone.m in Sources */,
9417A6F91867DC8300D9D37B /* EZRecorder.m in Sources */,
9417A6F11867DC8300D9D37B /* EZAudio.m in Sources */,
665956F51B38B256003E97A1 /* EZPlot.m in Sources */,
665956E91B38B256003E97A1 /* EZAudio.m in Sources */,
665956F21B38B256003E97A1 /* EZAudioUtilities.m in Sources */,
665956F11B38B256003E97A1 /* EZAudioPlotGLKViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -652,6 +682,7 @@
94F8DF4C18C84204005C4CBD /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
@@ -31,7 +31,7 @@
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
// Swap in our view controller in the window's content view
self.coreGraphicsWaveformViewController = [[CoreGraphicsWaveformViewController alloc] init];
self.coreGraphicsWaveformViewController = [[CoreGraphicsWaveformViewController alloc] initWithNibName:NSStringFromClass(CoreGraphicsWaveformViewController.class) bundle:nil];
// Resize view controller to content view's current size
self.coreGraphicsWaveformViewController.view.frame = [self.window.contentView frame];
// Add resizing flags to make the view controller resize with the window
@@ -1,100 +1,17 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="4439" systemVersion="13A451" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="7702" systemVersion="14C109" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="4439"/>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="7702"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
<connections>
<action selector="orderFrontStandardAboutPanel:" destination="58" id="142"/>
<outlet property="delegate" destination="494" id="495"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder">
<connections>
<action selector="alignCenter:" destination="499" id="518"/>
<action selector="alignJustified:" destination="500" id="523"/>
<action selector="alignLeft:" destination="498" id="524"/>
<action selector="alignRight:" destination="501" id="521"/>
<action selector="arrangeInFront:" destination="5" id="39"/>
<action selector="capitalizeWord:" destination="466" id="467"/>
<action selector="centerSelectionInVisibleArea:" destination="210" id="245"/>
<action selector="checkSpelling:" destination="201" id="225"/>
<action selector="clearRecentDocuments:" destination="126" id="127"/>
<action selector="copy:" destination="197" id="224"/>
<action selector="copyFont:" destination="403" id="428"/>
<action selector="copyRuler:" destination="506" id="522"/>
<action selector="cut:" destination="199" id="228"/>
<action selector="delete:" destination="202" id="235"/>
<action selector="hide:" destination="134" id="367"/>
<action selector="hideOtherApplications:" destination="145" id="368"/>
<action selector="loosenKerning:" destination="419" id="435"/>
<action selector="lowerBaseline:" destination="410" id="427"/>
<action selector="lowercaseWord:" destination="465" id="468"/>
<action selector="makeBaseWritingDirectionLeftToRight:" destination="511" id="526"/>
<action selector="makeBaseWritingDirectionNatural:" destination="510" id="525"/>
<action selector="makeBaseWritingDirectionRightToLeft:" destination="512" id="527"/>
<action selector="makeTextWritingDirectionLeftToRight:" destination="516" id="529"/>
<action selector="makeTextWritingDirectionNatural:" destination="515" id="528"/>
<action selector="makeTextWritingDirectionRightToLeft:" destination="517" id="530"/>
<action selector="newDocument:" destination="82" id="373"/>
<action selector="openDocument:" destination="72" id="374"/>
<action selector="orderFrontColorPanel:" destination="401" id="433"/>
<action selector="orderFrontSubstitutionsPanel:" destination="457" id="458"/>
<action selector="paste:" destination="203" id="226"/>
<action selector="pasteAsPlainText:" destination="485" id="486"/>
<action selector="pasteFont:" destination="404" id="436"/>
<action selector="pasteRuler:" destination="507" id="519"/>
<action selector="performClose:" destination="73" id="193"/>
<action selector="performFindPanelAction:" destination="209" id="241"/>
<action selector="performFindPanelAction:" destination="208" id="487"/>
<action selector="performFindPanelAction:" destination="213" id="488"/>
<action selector="performFindPanelAction:" destination="221" id="489"/>
<action selector="performFindPanelAction:" destination="534" id="535"/>
<action selector="performMiniaturize:" destination="23" id="37"/>
<action selector="performZoom:" destination="239" id="240"/>
<action selector="print:" destination="78" id="86"/>
<action selector="raiseBaseline:" destination="409" id="426"/>
<action selector="redo:" destination="215" id="231"/>
<action selector="revertDocumentToSaved:" destination="112" id="364"/>
<action selector="runPageLayout:" destination="77" id="87"/>
<action selector="runToolbarCustomizationPalette:" destination="298" id="365"/>
<action selector="saveDocument:" destination="75" id="362"/>
<action selector="selectAll:" destination="198" id="232"/>
<action selector="showGuessPanel:" destination="204" id="230"/>
<action selector="showHelp:" destination="492" id="493"/>
<action selector="startSpeaking:" destination="196" id="233"/>
<action selector="stopSpeaking:" destination="195" id="227"/>
<action selector="subscript:" destination="408" id="429"/>
<action selector="superscript:" destination="407" id="430"/>
<action selector="tightenKerning:" destination="418" id="431"/>
<action selector="toggleAutomaticDashSubstitution:" destination="460" id="461"/>
<action selector="toggleAutomaticLinkDetection:" destination="354" id="357"/>
<action selector="toggleAutomaticQuoteSubstitution:" destination="351" id="356"/>
<action selector="toggleAutomaticSpellingCorrection:" destination="454" id="456"/>
<action selector="toggleAutomaticTextReplacement:" destination="462" id="463"/>
<action selector="toggleContinuousSpellChecking:" destination="219" id="222"/>
<action selector="toggleGrammarChecking:" destination="346" id="347"/>
<action selector="toggleRuler:" destination="505" id="520"/>
<action selector="toggleSmartInsertDelete:" destination="350" id="355"/>
<action selector="toggleToolbarShown:" destination="297" id="366"/>
<action selector="turnOffKerning:" destination="417" id="441"/>
<action selector="turnOffLigatures:" destination="413" id="440"/>
<action selector="underline:" destination="392" id="432"/>
<action selector="undo:" destination="207" id="223"/>
<action selector="unhideAllApplications:" destination="150" id="370"/>
<action selector="unscript:" destination="406" id="437"/>
<action selector="uppercaseWord:" destination="452" id="464"/>
<action selector="useAllLigatures:" destination="414" id="434"/>
<action selector="useStandardKerning:" destination="416" id="438"/>
<action selector="useStandardLigatures:" destination="412" id="439"/>
</connections>
</customObject>
<customObject id="-3" userLabel="Application">
<connections>
<action selector="terminate:" destination="136" id="449"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<menu title="AMainMenu" systemMenu="main" id="29">
<items>
<menuItem title="EZAudioCoreGraphicsWaveformExample" id="56">
@@ -102,6 +19,9 @@
<items>
<menuItem title="About EZAudioCoreGraphicsWaveformExample" id="58">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="orderFrontStandardAboutPanel:" target="-2" id="142"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="236">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
@@ -116,95 +36,211 @@
<menuItem isSeparatorItem="YES" id="144">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Hide EZAudioCoreGraphicsWaveformExample" keyEquivalent="h" id="134"/>
<menuItem title="Hide EZAudioCoreGraphicsWaveformExample" keyEquivalent="h" id="134">
<connections>
<action selector="hide:" target="-1" id="367"/>
</connections>
</menuItem>
<menuItem title="Hide Others" keyEquivalent="h" id="145">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="hideOtherApplications:" target="-1" id="368"/>
</connections>
</menuItem>
<menuItem title="Show All" id="150">
<connections>
<action selector="unhideAllApplications:" target="-1" id="370"/>
</connections>
</menuItem>
<menuItem title="Show All" id="150"/>
<menuItem isSeparatorItem="YES" id="149">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Quit EZAudioCoreGraphicsWaveformExample" keyEquivalent="q" id="136"/>
<menuItem title="Quit EZAudioCoreGraphicsWaveformExample" keyEquivalent="q" id="136">
<connections>
<action selector="terminate:" target="-3" id="449"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="File" id="83">
<menu key="submenu" title="File" id="81">
<items>
<menuItem title="New" keyEquivalent="n" id="82"/>
<menuItem title="Open…" keyEquivalent="o" id="72"/>
<menuItem title="New" keyEquivalent="n" id="82">
<connections>
<action selector="newDocument:" target="-1" id="373"/>
</connections>
</menuItem>
<menuItem title="Open…" keyEquivalent="o" id="72">
<connections>
<action selector="openDocument:" target="-1" id="374"/>
</connections>
</menuItem>
<menuItem title="Open Recent" id="124">
<menu key="submenu" title="Open Recent" systemMenu="recentDocuments" id="125">
<items>
<menuItem title="Clear Menu" id="126"/>
<menuItem title="Clear Menu" id="126">
<connections>
<action selector="clearRecentDocuments:" target="-1" id="127"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem isSeparatorItem="YES" id="79">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Close" keyEquivalent="w" id="73"/>
<menuItem title="Save…" keyEquivalent="s" id="75"/>
<menuItem title="Close" keyEquivalent="w" id="73">
<connections>
<action selector="performClose:" target="-1" id="193"/>
</connections>
</menuItem>
<menuItem title="Save…" keyEquivalent="s" id="75">
<connections>
<action selector="saveDocument:" target="-1" id="362"/>
</connections>
</menuItem>
<menuItem title="Revert to Saved" id="112">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="revertDocumentToSaved:" target="-1" id="364"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="74">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Page Setup..." keyEquivalent="P" id="77">
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
<connections>
<action selector="runPageLayout:" target="-1" id="87"/>
</connections>
</menuItem>
<menuItem title="Print…" keyEquivalent="p" id="78">
<connections>
<action selector="print:" target="-1" id="86"/>
</connections>
</menuItem>
<menuItem title="Print…" keyEquivalent="p" id="78"/>
</items>
</menu>
</menuItem>
<menuItem title="Edit" id="217">
<menu key="submenu" title="Edit" id="205">
<items>
<menuItem title="Undo" keyEquivalent="z" id="207"/>
<menuItem title="Undo" keyEquivalent="z" id="207">
<connections>
<action selector="undo:" target="-1" id="223"/>
</connections>
</menuItem>
<menuItem title="Redo" keyEquivalent="Z" id="215">
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
<connections>
<action selector="redo:" target="-1" id="231"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="206">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Cut" keyEquivalent="x" id="199"/>
<menuItem title="Copy" keyEquivalent="c" id="197"/>
<menuItem title="Paste" keyEquivalent="v" id="203"/>
<menuItem title="Cut" keyEquivalent="x" id="199">
<connections>
<action selector="cut:" target="-1" id="228"/>
</connections>
</menuItem>
<menuItem title="Copy" keyEquivalent="c" id="197">
<connections>
<action selector="copy:" target="-1" id="224"/>
</connections>
</menuItem>
<menuItem title="Paste" keyEquivalent="v" id="203">
<connections>
<action selector="paste:" target="-1" id="226"/>
</connections>
</menuItem>
<menuItem title="Paste and Match Style" keyEquivalent="V" id="485">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="pasteAsPlainText:" target="-1" id="486"/>
</connections>
</menuItem>
<menuItem title="Delete" id="202">
<connections>
<action selector="delete:" target="-1" id="235"/>
</connections>
</menuItem>
<menuItem title="Select All" keyEquivalent="a" id="198">
<connections>
<action selector="selectAll:" target="-1" id="232"/>
</connections>
</menuItem>
<menuItem title="Delete" id="202"/>
<menuItem title="Select All" keyEquivalent="a" id="198"/>
<menuItem isSeparatorItem="YES" id="214">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Find" id="218">
<menu key="submenu" title="Find" id="220">
<items>
<menuItem title="Find…" tag="1" keyEquivalent="f" id="209"/>
<menuItem title="Find…" tag="1" keyEquivalent="f" id="209">
<connections>
<action selector="performFindPanelAction:" target="-1" id="241"/>
</connections>
</menuItem>
<menuItem title="Find and Replace…" tag="12" keyEquivalent="f" id="534">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="performFindPanelAction:" target="-1" id="535"/>
</connections>
</menuItem>
<menuItem title="Find Next" tag="2" keyEquivalent="g" id="208">
<connections>
<action selector="performFindPanelAction:" target="-1" id="487"/>
</connections>
</menuItem>
<menuItem title="Find Next" tag="2" keyEquivalent="g" id="208"/>
<menuItem title="Find Previous" tag="3" keyEquivalent="G" id="213">
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
<connections>
<action selector="performFindPanelAction:" target="-1" id="488"/>
</connections>
</menuItem>
<menuItem title="Use Selection for Find" tag="7" keyEquivalent="e" id="221">
<connections>
<action selector="performFindPanelAction:" target="-1" id="489"/>
</connections>
</menuItem>
<menuItem title="Jump to Selection" keyEquivalent="j" id="210">
<connections>
<action selector="centerSelectionInVisibleArea:" target="-1" id="245"/>
</connections>
</menuItem>
<menuItem title="Use Selection for Find" tag="7" keyEquivalent="e" id="221"/>
<menuItem title="Jump to Selection" keyEquivalent="j" id="210"/>
</items>
</menu>
</menuItem>
<menuItem title="Spelling and Grammar" id="216">
<menu key="submenu" title="Spelling and Grammar" id="200">
<items>
<menuItem title="Show Spelling and Grammar" keyEquivalent=":" id="204"/>
<menuItem title="Check Document Now" keyEquivalent=";" id="201"/>
<menuItem title="Show Spelling and Grammar" keyEquivalent=":" id="204">
<connections>
<action selector="showGuessPanel:" target="-1" id="230"/>
</connections>
</menuItem>
<menuItem title="Check Document Now" keyEquivalent=";" id="201">
<connections>
<action selector="checkSpelling:" target="-1" id="225"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="453"/>
<menuItem title="Check Spelling While Typing" id="219"/>
<menuItem title="Check Grammar With Spelling" id="346"/>
<menuItem title="Check Spelling While Typing" id="219">
<connections>
<action selector="toggleContinuousSpellChecking:" target="-1" id="222"/>
</connections>
</menuItem>
<menuItem title="Check Grammar With Spelling" id="346">
<connections>
<action selector="toggleGrammarChecking:" target="-1" id="347"/>
</connections>
</menuItem>
<menuItem title="Correct Spelling Automatically" id="454">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleAutomaticSpellingCorrection:" target="-1" id="456"/>
</connections>
</menuItem>
</items>
</menu>
@@ -214,18 +250,38 @@
<items>
<menuItem title="Show Substitutions" id="457">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="orderFrontSubstitutionsPanel:" target="-1" id="458"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="459"/>
<menuItem title="Smart Copy/Paste" tag="1" keyEquivalent="f" id="350"/>
<menuItem title="Smart Quotes" tag="2" keyEquivalent="g" id="351"/>
<menuItem title="Smart Copy/Paste" tag="1" keyEquivalent="f" id="350">
<connections>
<action selector="toggleSmartInsertDelete:" target="-1" id="355"/>
</connections>
</menuItem>
<menuItem title="Smart Quotes" tag="2" keyEquivalent="g" id="351">
<connections>
<action selector="toggleAutomaticQuoteSubstitution:" target="-1" id="356"/>
</connections>
</menuItem>
<menuItem title="Smart Dashes" id="460">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleAutomaticDashSubstitution:" target="-1" id="461"/>
</connections>
</menuItem>
<menuItem title="Smart Links" tag="3" keyEquivalent="G" id="354">
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
<connections>
<action selector="toggleAutomaticLinkDetection:" target="-1" id="357"/>
</connections>
</menuItem>
<menuItem title="Text Replacement" id="462">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleAutomaticTextReplacement:" target="-1" id="463"/>
</connections>
</menuItem>
</items>
</menu>
@@ -236,12 +292,21 @@
<items>
<menuItem title="Make Upper Case" id="452">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="uppercaseWord:" target="-1" id="464"/>
</connections>
</menuItem>
<menuItem title="Make Lower Case" id="465">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="lowercaseWord:" target="-1" id="468"/>
</connections>
</menuItem>
<menuItem title="Capitalize" id="466">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="capitalizeWord:" target="-1" id="467"/>
</connections>
</menuItem>
</items>
</menu>
@@ -249,8 +314,16 @@
<menuItem title="Speech" id="211">
<menu key="submenu" title="Speech" id="212">
<items>
<menuItem title="Start Speaking" id="196"/>
<menuItem title="Stop Speaking" id="195"/>
<menuItem title="Start Speaking" id="196">
<connections>
<action selector="startSpeaking:" target="-1" id="233"/>
</connections>
</menuItem>
<menuItem title="Stop Speaking" id="195">
<connections>
<action selector="stopSpeaking:" target="-1" id="227"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
@@ -265,13 +338,37 @@
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Font" systemMenu="font" id="388">
<items>
<menuItem title="Show Fonts" keyEquivalent="t" id="389"/>
<menuItem title="Bold" tag="2" keyEquivalent="b" id="390"/>
<menuItem title="Italic" tag="1" keyEquivalent="i" id="391"/>
<menuItem title="Underline" keyEquivalent="u" id="392"/>
<menuItem title="Show Fonts" keyEquivalent="t" id="389">
<connections>
<action selector="orderFrontFontPanel:" target="420" id="424"/>
</connections>
</menuItem>
<menuItem title="Bold" tag="2" keyEquivalent="b" id="390">
<connections>
<action selector="addFontTrait:" target="420" id="421"/>
</connections>
</menuItem>
<menuItem title="Italic" tag="1" keyEquivalent="i" id="391">
<connections>
<action selector="addFontTrait:" target="420" id="422"/>
</connections>
</menuItem>
<menuItem title="Underline" keyEquivalent="u" id="392">
<connections>
<action selector="underline:" target="-1" id="432"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="393"/>
<menuItem title="Bigger" tag="3" keyEquivalent="+" id="394"/>
<menuItem title="Smaller" tag="4" keyEquivalent="-" id="395"/>
<menuItem title="Bigger" tag="3" keyEquivalent="+" id="394">
<connections>
<action selector="modifyFont:" target="420" id="425"/>
</connections>
</menuItem>
<menuItem title="Smaller" tag="4" keyEquivalent="-" id="395">
<connections>
<action selector="modifyFont:" target="420" id="423"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="396"/>
<menuItem title="Kern" id="397">
<modifierMask key="keyEquivalentModifierMask"/>
@@ -279,15 +376,27 @@
<items>
<menuItem title="Use Default" id="416">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="useStandardKerning:" target="-1" id="438"/>
</connections>
</menuItem>
<menuItem title="Use None" id="417">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="turnOffKerning:" target="-1" id="441"/>
</connections>
</menuItem>
<menuItem title="Tighten" id="418">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="tightenKerning:" target="-1" id="431"/>
</connections>
</menuItem>
<menuItem title="Loosen" id="419">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="loosenKerning:" target="-1" id="435"/>
</connections>
</menuItem>
</items>
</menu>
@@ -298,12 +407,21 @@
<items>
<menuItem title="Use Default" id="412">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="useStandardLigatures:" target="-1" id="439"/>
</connections>
</menuItem>
<menuItem title="Use None" id="413">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="turnOffLigatures:" target="-1" id="440"/>
</connections>
</menuItem>
<menuItem title="Use All" id="414">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="useAllLigatures:" target="-1" id="434"/>
</connections>
</menuItem>
</items>
</menu>
@@ -314,30 +432,55 @@
<items>
<menuItem title="Use Default" id="406">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="unscript:" target="-1" id="437"/>
</connections>
</menuItem>
<menuItem title="Superscript" id="407">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="superscript:" target="-1" id="430"/>
</connections>
</menuItem>
<menuItem title="Subscript" id="408">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="subscript:" target="-1" id="429"/>
</connections>
</menuItem>
<menuItem title="Raise" id="409">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="raiseBaseline:" target="-1" id="426"/>
</connections>
</menuItem>
<menuItem title="Lower" id="410">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="lowerBaseline:" target="-1" id="427"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem isSeparatorItem="YES" id="400"/>
<menuItem title="Show Colors" keyEquivalent="C" id="401"/>
<menuItem title="Show Colors" keyEquivalent="C" id="401">
<connections>
<action selector="orderFrontColorPanel:" target="-1" id="433"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="402"/>
<menuItem title="Copy Style" keyEquivalent="c" id="403">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="copyFont:" target="-1" id="428"/>
</connections>
</menuItem>
<menuItem title="Paste Style" keyEquivalent="v" id="404">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="pasteFont:" target="-1" id="436"/>
</connections>
</menuItem>
</items>
</menu>
@@ -346,12 +489,27 @@
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Text" id="497">
<items>
<menuItem title="Align Left" keyEquivalent="{" id="498"/>
<menuItem title="Center" keyEquivalent="|" id="499"/>
<menuItem title="Align Left" keyEquivalent="{" id="498">
<connections>
<action selector="alignLeft:" target="-1" id="524"/>
</connections>
</menuItem>
<menuItem title="Center" keyEquivalent="|" id="499">
<connections>
<action selector="alignCenter:" target="-1" id="518"/>
</connections>
</menuItem>
<menuItem title="Justify" id="500">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="alignJustified:" target="-1" id="523"/>
</connections>
</menuItem>
<menuItem title="Align Right" keyEquivalent="}" id="501">
<connections>
<action selector="alignRight:" target="-1" id="521"/>
</connections>
</menuItem>
<menuItem title="Align Right" keyEquivalent="}" id="501"/>
<menuItem isSeparatorItem="YES" id="502"/>
<menuItem title="Writing Direction" id="503">
<modifierMask key="keyEquivalentModifierMask"/>
@@ -363,14 +521,23 @@
<menuItem id="510">
<string key="title"> Default</string>
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="makeBaseWritingDirectionNatural:" target="-1" id="525"/>
</connections>
</menuItem>
<menuItem id="511">
<string key="title"> Left to Right</string>
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="makeBaseWritingDirectionLeftToRight:" target="-1" id="526"/>
</connections>
</menuItem>
<menuItem id="512">
<string key="title"> Right to Left</string>
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="makeBaseWritingDirectionRightToLeft:" target="-1" id="527"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="513"/>
<menuItem title="Selection" enabled="NO" id="514">
@@ -379,14 +546,23 @@
<menuItem id="515">
<string key="title"> Default</string>
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="makeTextWritingDirectionNatural:" target="-1" id="528"/>
</connections>
</menuItem>
<menuItem id="516">
<string key="title"> Left to Right</string>
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="makeTextWritingDirectionLeftToRight:" target="-1" id="529"/>
</connections>
</menuItem>
<menuItem id="517">
<string key="title"> Right to Left</string>
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="makeTextWritingDirectionRightToLeft:" target="-1" id="530"/>
</connections>
</menuItem>
</items>
</menu>
@@ -394,12 +570,21 @@
<menuItem isSeparatorItem="YES" id="504"/>
<menuItem title="Show Ruler" id="505">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleRuler:" target="-1" id="520"/>
</connections>
</menuItem>
<menuItem title="Copy Ruler" keyEquivalent="c" id="506">
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
<connections>
<action selector="copyRuler:" target="-1" id="522"/>
</connections>
</menuItem>
<menuItem title="Paste Ruler" keyEquivalent="v" id="507">
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
<connections>
<action selector="pasteRuler:" target="-1" id="519"/>
</connections>
</menuItem>
</items>
</menu>
@@ -412,20 +597,39 @@
<items>
<menuItem title="Show Toolbar" keyEquivalent="t" id="297">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="toggleToolbarShown:" target="-1" id="366"/>
</connections>
</menuItem>
<menuItem title="Customize Toolbar…" id="298">
<connections>
<action selector="runToolbarCustomizationPalette:" target="-1" id="365"/>
</connections>
</menuItem>
<menuItem title="Customize Toolbar…" id="298"/>
</items>
</menu>
</menuItem>
<menuItem title="Window" id="19">
<menu key="submenu" title="Window" systemMenu="window" id="24">
<items>
<menuItem title="Minimize" keyEquivalent="m" id="23"/>
<menuItem title="Zoom" id="239"/>
<menuItem title="Minimize" keyEquivalent="m" id="23">
<connections>
<action selector="performMiniaturize:" target="-1" id="37"/>
</connections>
</menuItem>
<menuItem title="Zoom" id="239">
<connections>
<action selector="performZoom:" target="-1" id="240"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="92">
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
</menuItem>
<menuItem title="Bring All to Front" id="5"/>
<menuItem title="Bring All to Front" id="5">
<connections>
<action selector="arrangeInFront:" target="-1" id="39"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
@@ -433,7 +637,11 @@
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Help" systemMenu="help" id="491">
<items>
<menuItem title="EZAudioCoreGraphicsWaveformExample Help" keyEquivalent="?" id="492"/>
<menuItem title="EZAudioCoreGraphicsWaveformExample Help" keyEquivalent="?" id="492">
<connections>
<action selector="showHelp:" target="-1" id="493"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
@@ -443,7 +651,7 @@
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="335" y="390" width="480" height="360"/>
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1418"/>
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="877"/>
<view key="contentView" id="372">
<rect key="frame" x="0.0" y="0.0" width="480" height="360"/>
<autoresizingMask key="autoresizingMask"/>
@@ -454,14 +662,6 @@
<outlet property="window" destination="371" id="532"/>
</connections>
</customObject>
<customObject id="420" customClass="NSFontManager">
<connections>
<action selector="addFontTrait:" destination="390" id="421"/>
<action selector="addFontTrait:" destination="391" id="422"/>
<action selector="modifyFont:" destination="395" id="423"/>
<action selector="modifyFont:" destination="394" id="425"/>
<action selector="orderFrontFontPanel:" destination="389" id="424"/>
</connections>
</customObject>
<customObject id="420" customClass="NSFontManager"/>
</objects>
</document>
@@ -33,18 +33,34 @@
*/
@interface CoreGraphicsWaveformViewController : NSViewController <EZMicrophoneDelegate>
//------------------------------------------------------------------------------
#pragma mark - Components
//------------------------------------------------------------------------------
/**
The CoreGraphics based audio plot
*/
@property (nonatomic,weak) IBOutlet EZAudioPlot *audioPlot;
@property (nonatomic, weak) IBOutlet EZAudioPlot *audioPlot;
/**
The microphone component
*/
@property (nonatomic,strong) EZMicrophone *microphone;
@property (nonatomic, strong) EZMicrophone *microphone;
/**
The microphone pop up button (contains the menu for choosing a microphone input)
*/
@property (nonatomic, weak) IBOutlet NSPopUpButton *microphoneInputPopUpButton;
/**
The microphone input channel pop up button (contains the menu for choosing a microphone input channel)
*/
@property (nonatomic, weak) IBOutlet NSPopUpButton *microphoneInputChannelPopUpButton;
//------------------------------------------------------------------------------
#pragma mark - Actions
//------------------------------------------------------------------------------
/**
Switches the plot drawing type between a buffer plot (visualizes the current stream of audio data from the update function) or a rolling plot (visualizes the audio data over time, this is the classic waveform look)
*/
@@ -25,140 +25,223 @@
#import "CoreGraphicsWaveformViewController.h"
@interface CoreGraphicsWaveformViewController ()
@end
@implementation CoreGraphicsWaveformViewController
#pragma mark - Initialization
-(id)init {
self = [super initWithNibName:NSStringFromClass(self.class) bundle:nil];
if(self){
[self initializeViewController];
}
return self;
}
-(id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithNibName:NSStringFromClass(self.class) bundle:nil];
if(self){
[self initializeViewController];
}
return self;
}
-(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:NSStringFromClass(self.class) bundle:nil];
if(self){
[self initializeViewController];
}
return self;
}
#pragma mark - Initialize View Controller
-(void)initializeViewController {
// Create an instance of the microphone and tell it to use this view controller instance as the delegate
self.microphone = [EZMicrophone microphoneWithDelegate:self];
}
//------------------------------------------------------------------------------
#pragma mark - Customize the Audio Plot
-(void)awakeFromNib {
/*
Customizing the audio plot's look
*/
// Background color
self.audioPlot.backgroundColor = [NSColor colorWithCalibratedRed: 0.984 green: 0.471 blue: 0.525 alpha: 1];
// Waveform color
self.audioPlot.color = [NSColor colorWithCalibratedRed: 1.000 green: 1.000 blue: 1.000 alpha: 1];
// Plot type
self.audioPlot.plotType = EZPlotTypeBuffer;
/*
Start the microphone
*/
[self.microphone startFetchingAudio];
//------------------------------------------------------------------------------
- (void)awakeFromNib
{
//
// Customizing the audio plot's look
//
// Background color
self.audioPlot.backgroundColor = [NSColor colorWithCalibratedRed: 0.984 green: 0.471 blue: 0.525 alpha: 1];
// Waveform color
self.audioPlot.color = [NSColor colorWithCalibratedRed: 1.000 green: 1.000 blue: 1.000 alpha: 1];
// Plot type
self.audioPlot.plotType = EZPlotTypeBuffer;
//
// Create the microphone
//
self.microphone = [EZMicrophone microphoneWithDelegate:self];
//
// Start the microphone
//
[self.microphone startFetchingAudio];
}
//------------------------------------------------------------------------------
#pragma mark - Setup
//------------------------------------------------------------------------------
- (void) reloadMicrophoneInputPopUpButtonMenu
{
NSArray *inputDevices = [EZAudioDevice inputDevices];
NSMenu *menu = [[NSMenu alloc] init];
NSMenuItem *defaultInputMenuItem;
for (EZAudioDevice *device in inputDevices)
{
NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:device.name
action:@selector(changedInput:)
keyEquivalent:@""];
item.representedObject = device;
item.target = self;
[menu addItem:item];
// If this device is the same one the microphone is using then
// we will use this menu item as the currently selected item
// in the microphone input popup button's list of items. For instance,
// if you are connected to an external display by default the external
// display's microphone might be used instead of the mac's built in
// mic.
if ([device isEqual:self.microphone.device])
{
defaultInputMenuItem = item;
}
}
self.microphoneInputPopUpButton.menu = menu;
//
// Set the selected device to the current selection on the
// microphone input popup button
//
[self.microphoneInputPopUpButton selectItem:defaultInputMenuItem];
}
//------------------------------------------------------------------------------
- (void) reloadMicrophoneInputChannelPopUpButtonMenu
{
NSMenu *menu = [[NSMenu alloc] init];
for (int i = 0; i < self.microphone.device.inputChannelCount; i++)
{
NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:@(i).stringValue
action:@selector(changedInputChannel:)
keyEquivalent:@""];
item.representedObject = @(i);
item.target = self;
[menu addItem:item];
}
self.microphoneInputChannelPopUpButton.menu = menu;
[self.microphoneInputChannelPopUpButton selectItemAtIndex:0];
}
//------------------------------------------------------------------------------
#pragma mark - Actions
-(void)changePlotType:(id)sender {
NSInteger selectedSegment = [sender selectedSegment];
switch(selectedSegment){
case 0:
[self drawBufferPlot];
break;
case 1:
[self drawRollingPlot];
break;
default:
break;
}
//------------------------------------------------------------------------------
- (void)changedInput:(id)sender
{
EZAudioDevice *device = [sender representedObject];
[self.microphone setDevice:device];
}
-(void)toggleMicrophone:(id)sender {
switch([sender state]){
case NSOffState:
[self.microphone stopFetchingAudio];
break;
case NSOnState:
[self.microphone startFetchingAudio];
break;
default:
break;
}
//------------------------------------------------------------------------------
- (void)changedInputChannel:(id)sender
{
}
//------------------------------------------------------------------------------
- (void)changePlotType:(id)sender
{
NSInteger selectedSegment = [sender selectedSegment];
switch(selectedSegment)
{
case 0:
[self drawBufferPlot];
break;
case 1:
[self drawRollingPlot];
break;
default:
break;
}
}
//------------------------------------------------------------------------------
- (void)toggleMicrophone:(id)sender
{
switch([sender state])
{
case NSOffState:
[self.microphone stopFetchingAudio];
break;
case NSOnState:
[self.microphone startFetchingAudio];
break;
default:
break;
}
}
#pragma mark - Action Extensions
/*
Give the visualization of the current buffer (this is almost exactly the openFrameworks audio input eample)
*/
-(void)drawBufferPlot {
// Change the plot type to the buffer plot
self.audioPlot.plotType = EZPlotTypeBuffer;
// Don't mirror over the x-axis
self.audioPlot.shouldMirror = NO;
// Don't fill
self.audioPlot.shouldFill = NO;
- (void)drawBufferPlot
{
self.audioPlot.plotType = EZPlotTypeBuffer;
self.audioPlot.shouldMirror = NO;
self.audioPlot.shouldFill = NO;
}
//------------------------------------------------------------------------------
/*
Give the classic mirrored, rolling waveform look
*/
-(void)drawRollingPlot {
self.audioPlot.plotType = EZPlotTypeRolling;
self.audioPlot.shouldFill = YES;
self.audioPlot.shouldMirror = YES;
- (void)drawRollingPlot
{
self.audioPlot.plotType = EZPlotTypeRolling;
self.audioPlot.shouldFill = YES;
self.audioPlot.shouldMirror = YES;
}
#pragma mark - EZMicrophoneDelegate
#warning Thread Safety
// Note that any callback that provides streamed audio data (like streaming microphone input) happens on a separate audio thread that should not be blocked. When we feed audio data into any of the UI components we need to explicity create a GCD block on the main thread to properly get the UI to work.
-(void)microphone:(EZMicrophone *)microphone
hasAudioReceived:(float **)buffer
withBufferSize:(UInt32)bufferSize
withNumberOfChannels:(UInt32)numberOfChannels {
// Getting audio data as an array of float buffer arrays. What does that mean? Because the audio is coming in as a stereo signal the data is split into a left and right channel. So buffer[0] corresponds to the float* data for the left channel while buffer[1] corresponds to the float* data for the right channel.
// See the Thread Safety warning above, but in a nutshell these callbacks happen on a separate audio thread. We wrap any UI updating in a GCD block on the main thread to avoid blocking that audio flow.
dispatch_async(dispatch_get_main_queue(),^{
- (void)microphone:(EZMicrophone *)microphone
hasAudioReceived:(float **)buffer
withBufferSize:(UInt32)bufferSize
withNumberOfChannels:(UInt32)numberOfChannels
{
// See the Thread Safety warning above, but in a nutshell these callbacks happen on a separate audio thread. We wrap any UI updating in a GCD block on the main thread to avoid blocking that audio flow.
__weak typeof(self) weakSelf = self;
dispatch_async(dispatch_get_main_queue(),^{
// All the audio plot needs is the buffer data (float*) and the size. Internally the audio plot will handle all the drawing related code, history management, and freeing its own resources. Hence, one badass line of code gets you a pretty plot :)
[self.audioPlot updateBuffer:buffer[0] withBufferSize:bufferSize];
});
NSInteger channel = [weakSelf.microphoneInputChannelPopUpButton indexOfSelectedItem];
[weakSelf.audioPlot updateBuffer:buffer[channel] withBufferSize:bufferSize];
});
}
-(void)microphone:(EZMicrophone *)microphone hasAudioStreamBasicDescription:(AudioStreamBasicDescription)audioStreamBasicDescription {
// The AudioStreamBasicDescription of the microphone stream. This is useful when configuring the EZRecorder or telling another component what audio format type to expect.
// Here's a print function to allow you to inspect it a little easier
[EZAudio printASBD:audioStreamBasicDescription];
//------------------------------------------------------------------------------
- (void)microphone:(EZMicrophone *)microphone hasAudioStreamBasicDescription:(AudioStreamBasicDescription)audioStreamBasicDescription
{
// The AudioStreamBasicDescription of the microphone stream. This is useful when configuring the EZRecorder or telling another component what audio format type to expect.
// Here's a print function to allow you to inspect it a little easier
[EZAudioUtilities printASBD:audioStreamBasicDescription];
}
-(void)microphone:(EZMicrophone *)microphone
hasBufferList:(AudioBufferList *)bufferList
withBufferSize:(UInt32)bufferSize
withNumberOfChannels:(UInt32)numberOfChannels {
//------------------------------------------------------------------------------
- (void)microphone:(EZMicrophone *)microphone
hasBufferList:(AudioBufferList *)bufferList
withBufferSize:(UInt32)bufferSize
withNumberOfChannels:(UInt32)numberOfChannels
{
// Getting audio data as a buffer list that can be directly fed into the EZRecorder or EZOutput. Say whattt...
}
//------------------------------------------------------------------------------
- (void)microphone:(EZMicrophone *)microphone
changedDevice:(EZAudioDevice *)device
{
dispatch_async(dispatch_get_main_queue(), ^{
//
// Set up the microphone input popup button's items to select
// between different microphone inputs
//
[self reloadMicrophoneInputPopUpButtonMenu];
//
// Set up the microphone input popup button's items to select
// between different microphone input channels
//
[self reloadMicrophoneInputChannelPopUpButtonMenu];
});
}
//------------------------------------------------------------------------------
@end
@@ -1,66 +1,117 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="4514" systemVersion="13A603" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="7702" systemVersion="14C109" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment version="1070" identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="4514"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="7702"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="CoreGraphicsWaveformViewController">
<connections>
<outlet property="audioPlot" destination="1uw-Yi-HM2" id="64z-gn-hPW"/>
<outlet property="view" destination="1" id="2"/>
<outlet property="audioPlot" destination="wpL-Ou-GSb" id="OME-Hf-I27"/>
<outlet property="microphoneInputChannelPopUpButton" destination="Yi6-fS-Cob" id="pLg-4c-klV"/>
<outlet property="microphoneInputPopUpButton" destination="SjR-qx-mWV" id="NuN-SS-ESg"/>
<outlet property="view" destination="wpL-Ou-GSb" id="oxJ-iT-SKO"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application"/>
<customView id="1">
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customView id="wpL-Ou-GSb" customClass="EZAudioPlot">
<rect key="frame" x="0.0" y="0.0" width="480" height="272"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="1uw-Yi-HM2" customClass="EZAudioPlot">
<rect key="frame" x="0.0" y="0.0" width="480" height="272"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<button translatesAutoresizingMaskIntoConstraints="NO" id="bst-4p-f4H">
<rect key="frame" x="18" y="18" width="119" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Microphone On" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="X83-kX-Oau">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="toggleMicrophone:" target="-2" id="WUF-aw-GV2"/>
</connections>
</button>
<segmentedControl verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="xVu-eW-fRp">
<rect key="frame" x="333" y="15" width="129" height="24"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<segmentedCell key="cell" alignment="left" style="rounded" trackingMode="selectOne" id="mpa-RS-2hy">
<font key="font" metaFont="system"/>
<segments>
<segment label="Buffer" selected="YES"/>
<segment label="Rolling" tag="1"/>
</segments>
</segmentedCell>
<connections>
<action selector="changePlotType:" target="-2" id="IsT-Sq-sKO"/>
</connections>
</segmentedControl>
</subviews>
<button translatesAutoresizingMaskIntoConstraints="NO" id="kAI-gs-c31">
<rect key="frame" x="339" y="44" width="123" height="18"/>
<constraints>
<constraint firstItem="bst-4p-f4H" firstAttribute="leading" secondItem="1uw-Yi-HM2" secondAttribute="leading" constant="20" id="OEK-K5-KgC"/>
<constraint firstAttribute="bottom" secondItem="bst-4p-f4H" secondAttribute="bottom" constant="20" id="Xb8-Oc-8K5"/>
<constraint firstAttribute="bottom" secondItem="xVu-eW-fRp" secondAttribute="bottom" constant="17" id="gPn-xu-hrZ"/>
<constraint firstAttribute="trailing" secondItem="xVu-eW-fRp" secondAttribute="trailing" constant="20" id="tHh-2L-ypE"/>
<constraint firstAttribute="width" constant="119" id="FP4-Wg-HAb"/>
</constraints>
</customView>
<buttonCell key="cell" type="check" title="Microphone On" bezelStyle="regularSquare" imagePosition="right" state="on" inset="2" id="Aml-Gg-JmL">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="toggleMicrophone:" target="-2" id="sFe-vk-GLb"/>
</connections>
</button>
<segmentedControl verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="HTa-6n-EPo">
<rect key="frame" x="335" y="15" width="127" height="24"/>
<segmentedCell key="cell" borderStyle="border" alignment="left" style="rounded" trackingMode="selectOne" id="bLT-tl-mJ6">
<font key="font" metaFont="system"/>
<segments>
<segment label="Buffer" selected="YES"/>
<segment label="Rolling" tag="1"/>
</segments>
</segmentedCell>
<connections>
<action selector="changePlotType:" target="-2" id="JTN-f7-xiC"/>
</connections>
</segmentedControl>
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="SjR-qx-mWV" userLabel="microphoneInputPopUpButton">
<rect key="frame" x="18" y="14" width="180" height="26"/>
<constraints>
<constraint firstAttribute="width" constant="175" id="qhz-1c-cOR"/>
</constraints>
<popUpButtonCell key="cell" type="push" title="Item 1" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="4Kz-CU-9wA" id="Ifz-u8-4sz">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
<menu key="menu" id="si8-Yh-kZX">
<items>
<menuItem title="Item 1" state="on" id="4Kz-CU-9wA"/>
<menuItem title="Item 2" id="XbC-Uc-PrQ"/>
<menuItem title="Item 3" id="aao-3c-s5T"/>
</items>
</menu>
</popUpButtonCell>
</popUpButton>
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Yi6-fS-Cob" userLabel="microphoneInputChannelPopUpButton">
<rect key="frame" x="204" y="14" width="79" height="26"/>
<constraints>
<constraint firstAttribute="width" constant="74" id="w4n-SY-B3n"/>
</constraints>
<popUpButtonCell key="cell" type="push" title="1" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="K3K-bf-PA5" id="mM3-bX-3dm">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
<menu key="menu" id="u3a-FE-6Wo">
<items>
<menuItem title="1" state="on" id="K3K-bf-PA5"/>
<menuItem title="Item 2" id="gAP-8p-hIp"/>
<menuItem title="Item 3" id="5ds-DC-X9S"/>
</items>
</menu>
</popUpButtonCell>
</popUpButton>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="fi6-Uh-bvr">
<rect key="frame" x="18" y="43" width="31" height="14"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Input" id="Png-Pk-fMc">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="HVN-Im-3J1">
<rect key="frame" x="204" y="43" width="48" height="14"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Channel" id="lkh-zp-WCY">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
<constraints>
<constraint firstItem="1uw-Yi-HM2" firstAttribute="leading" secondItem="1" secondAttribute="leading" id="Fcx-zY-IPv"/>
<constraint firstItem="1uw-Yi-HM2" firstAttribute="top" secondItem="1" secondAttribute="top" id="Sfu-lR-KCJ"/>
<constraint firstAttribute="trailing" secondItem="1uw-Yi-HM2" secondAttribute="trailing" id="bjW-C2-2Mw"/>
<constraint firstAttribute="bottom" secondItem="1uw-Yi-HM2" secondAttribute="bottom" id="f1L-xR-BaI"/>
<constraint firstAttribute="bottom" secondItem="SjR-qx-mWV" secondAttribute="bottom" constant="17" id="1kd-d1-9WR"/>
<constraint firstAttribute="bottom" secondItem="HTa-6n-EPo" secondAttribute="bottom" constant="17" id="47V-Zg-MD0"/>
<constraint firstAttribute="bottom" secondItem="Yi6-fS-Cob" secondAttribute="bottom" constant="17" id="B2R-Tc-cz7"/>
<constraint firstItem="Yi6-fS-Cob" firstAttribute="top" secondItem="HVN-Im-3J1" secondAttribute="bottom" constant="5" id="DoN-81-ICT"/>
<constraint firstItem="HTa-6n-EPo" firstAttribute="top" secondItem="kAI-gs-c31" secondAttribute="bottom" constant="8" id="GLf-f7-seC"/>
<constraint firstItem="Yi6-fS-Cob" firstAttribute="leading" secondItem="SjR-qx-mWV" secondAttribute="trailing" constant="11" id="Pqx-7E-osx"/>
<constraint firstItem="Yi6-fS-Cob" firstAttribute="leading" secondItem="HVN-Im-3J1" secondAttribute="leading" id="Ux9-Kd-07J"/>
<constraint firstItem="SjR-qx-mWV" firstAttribute="leading" secondItem="wpL-Ou-GSb" secondAttribute="leading" constant="20" id="b29-6j-MdI"/>
<constraint firstAttribute="trailing" secondItem="kAI-gs-c31" secondAttribute="trailing" constant="20" id="bR5-ru-Lto"/>
<constraint firstItem="fi6-Uh-bvr" firstAttribute="leading" secondItem="wpL-Ou-GSb" secondAttribute="leading" constant="20" id="gqn-qW-0CY"/>
<constraint firstItem="HTa-6n-EPo" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Yi6-fS-Cob" secondAttribute="trailing" constant="11" id="qGD-Te-9IQ"/>
<constraint firstItem="SjR-qx-mWV" firstAttribute="top" secondItem="fi6-Uh-bvr" secondAttribute="bottom" constant="5" id="qkS-wp-O0d"/>
<constraint firstAttribute="trailing" secondItem="HTa-6n-EPo" secondAttribute="trailing" constant="20" id="rGZ-5W-ZDN"/>
</constraints>
<point key="canvasLocation" x="178" y="314"/>
</customView>
</objects>
</document>
</document>
@@ -1,41 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>C3083F0E-46EF-4F95-B26F-149C34EA858B</string>
<key>IDESourceControlProjectName</key>
<string>EZAudioExamplesOSX</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>9D6FF97A89F512CD81EAE1A971A1D2EB03E03F7C</key>
<string>https://github.com/syedhali/EZAudio.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>EZAudioExamples/OSX/EZAudioExamplesOSX.xcworkspace</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>9D6FF97A89F512CD81EAE1A971A1D2EB03E03F7C</key>
<string>../../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>https://github.com/syedhali/EZAudio.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>111</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>9D6FF97A89F512CD81EAE1A971A1D2EB03E03F7C</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>9D6FF97A89F512CD81EAE1A971A1D2EB03E03F7C</string>
<key>IDESourceControlWCCName</key>
<string>EZAudio</string>
</dict>
</array>
</dict>
</plist>
@@ -7,6 +7,24 @@
objects = {
/* Begin PBXBuildFile section */
6628E2C61B3A1CCE00020E56 /* AEFloatConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E2A41B3A1CCE00020E56 /* AEFloatConverter.m */; };
6628E2C71B3A1CCE00020E56 /* EZAudio.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E2A61B3A1CCE00020E56 /* EZAudio.m */; };
6628E2C81B3A1CCE00020E56 /* EZAudioDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E2A81B3A1CCE00020E56 /* EZAudioDevice.m */; };
6628E2C91B3A1CCE00020E56 /* EZAudioFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E2AA1B3A1CCE00020E56 /* EZAudioFile.m */; };
6628E2CA1B3A1CCE00020E56 /* EZAudioFloatConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E2AC1B3A1CCE00020E56 /* EZAudioFloatConverter.m */; };
6628E2CB1B3A1CCE00020E56 /* EZAudioFloatData.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E2AE1B3A1CCE00020E56 /* EZAudioFloatData.m */; };
6628E2CC1B3A1CCE00020E56 /* EZAudioPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E2B01B3A1CCE00020E56 /* EZAudioPlayer.m */; };
6628E2CD1B3A1CCE00020E56 /* EZAudioPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E2B21B3A1CCE00020E56 /* EZAudioPlot.m */; };
6628E2CE1B3A1CCE00020E56 /* EZAudioPlotGL.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E2B41B3A1CCE00020E56 /* EZAudioPlotGL.m */; };
6628E2CF1B3A1CCE00020E56 /* EZAudioPlotGLKViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E2B61B3A1CCE00020E56 /* EZAudioPlotGLKViewController.m */; };
6628E2D01B3A1CCE00020E56 /* EZAudioUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E2B81B3A1CCE00020E56 /* EZAudioUtilities.m */; };
6628E2D11B3A1CCE00020E56 /* EZMicrophone.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E2BA1B3A1CCE00020E56 /* EZMicrophone.m */; };
6628E2D21B3A1CCE00020E56 /* EZOutput.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E2BC1B3A1CCE00020E56 /* EZOutput.m */; };
6628E2D31B3A1CCE00020E56 /* EZPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E2BE1B3A1CCE00020E56 /* EZPlot.m */; };
6628E2D41B3A1CCE00020E56 /* EZRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E2C01B3A1CCE00020E56 /* EZRecorder.m */; };
6628E2D51B3A1CCE00020E56 /* TPCircularBuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 6628E2C11B3A1CCE00020E56 /* TPCircularBuffer.c */; };
6628E2D61B3A1CCE00020E56 /* CHANGELOG in Resources */ = {isa = PBXBuildFile; fileRef = 6628E2C41B3A1CCE00020E56 /* CHANGELOG */; };
6628E2D71B3A1CCE00020E56 /* VERSION in Resources */ = {isa = PBXBuildFile; fileRef = 6628E2C51B3A1CCE00020E56 /* VERSION */; };
9417A8F71871492000D9D37B /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9417A8F61871492000D9D37B /* Cocoa.framework */; };
9417A9011871492000D9D37B /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 9417A8FF1871492000D9D37B /* InfoPlist.strings */; };
9417A9031871492000D9D37B /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A9021871492000D9D37B /* main.m */; };
@@ -18,19 +36,6 @@
9417A9171871492100D9D37B /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9417A8F61871492000D9D37B /* Cocoa.framework */; };
9417A91F1871492100D9D37B /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 9417A91D1871492100D9D37B /* InfoPlist.strings */; };
9417A9211871492100D9D37B /* EZAudioFFTExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A9201871492100D9D37B /* EZAudioFFTExampleTests.m */; };
9417A9441871493900D9D37B /* AEFloatConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A92C1871493900D9D37B /* AEFloatConverter.m */; };
9417A9451871493900D9D37B /* EZAudio.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A92E1871493900D9D37B /* EZAudio.m */; };
9417A9461871493900D9D37B /* EZAudioFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A9301871493900D9D37B /* EZAudioFile.m */; };
9417A9471871493900D9D37B /* EZAudioPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A9321871493900D9D37B /* EZAudioPlot.m */; };
9417A9481871493900D9D37B /* EZAudioPlotGL.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A9341871493900D9D37B /* EZAudioPlotGL.m */; };
9417A9491871493900D9D37B /* EZAudioPlotGLKViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A9361871493900D9D37B /* EZAudioPlotGLKViewController.m */; };
9417A94A1871493900D9D37B /* EZMicrophone.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A9381871493900D9D37B /* EZMicrophone.m */; };
9417A94B1871493900D9D37B /* EZOutput.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A93A1871493900D9D37B /* EZOutput.m */; };
9417A94C1871493900D9D37B /* EZPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A93C1871493900D9D37B /* EZPlot.m */; };
9417A94D1871493900D9D37B /* EZRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A93E1871493900D9D37B /* EZRecorder.m */; };
9417A94E1871493900D9D37B /* TPCircularBuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 9417A93F1871493900D9D37B /* TPCircularBuffer.c */; };
9417A94F1871493900D9D37B /* CHANGELOG in Resources */ = {isa = PBXBuildFile; fileRef = 9417A9421871493900D9D37B /* CHANGELOG */; };
9417A9501871493900D9D37B /* VERSION in Resources */ = {isa = PBXBuildFile; fileRef = 9417A9431871493900D9D37B /* VERSION */; };
9417A954187149EA00D9D37B /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9417A951187149EA00D9D37B /* AudioToolbox.framework */; };
9417A955187149EA00D9D37B /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9417A952187149EA00D9D37B /* AudioUnit.framework */; };
9417A956187149EA00D9D37B /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9417A953187149EA00D9D37B /* CoreAudio.framework */; };
@@ -53,6 +58,40 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
6628E2A31B3A1CCE00020E56 /* AEFloatConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AEFloatConverter.h; sourceTree = "<group>"; };
6628E2A41B3A1CCE00020E56 /* AEFloatConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AEFloatConverter.m; sourceTree = "<group>"; };
6628E2A51B3A1CCE00020E56 /* EZAudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudio.h; sourceTree = "<group>"; };
6628E2A61B3A1CCE00020E56 /* EZAudio.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudio.m; sourceTree = "<group>"; };
6628E2A71B3A1CCE00020E56 /* EZAudioDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioDevice.h; sourceTree = "<group>"; };
6628E2A81B3A1CCE00020E56 /* EZAudioDevice.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioDevice.m; sourceTree = "<group>"; };
6628E2A91B3A1CCE00020E56 /* EZAudioFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFile.h; sourceTree = "<group>"; };
6628E2AA1B3A1CCE00020E56 /* EZAudioFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFile.m; sourceTree = "<group>"; };
6628E2AB1B3A1CCE00020E56 /* EZAudioFloatConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFloatConverter.h; sourceTree = "<group>"; };
6628E2AC1B3A1CCE00020E56 /* EZAudioFloatConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFloatConverter.m; sourceTree = "<group>"; };
6628E2AD1B3A1CCE00020E56 /* EZAudioFloatData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFloatData.h; sourceTree = "<group>"; };
6628E2AE1B3A1CCE00020E56 /* EZAudioFloatData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFloatData.m; sourceTree = "<group>"; };
6628E2AF1B3A1CCE00020E56 /* EZAudioPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlayer.h; sourceTree = "<group>"; };
6628E2B01B3A1CCE00020E56 /* EZAudioPlayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlayer.m; sourceTree = "<group>"; };
6628E2B11B3A1CCE00020E56 /* EZAudioPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlot.h; sourceTree = "<group>"; };
6628E2B21B3A1CCE00020E56 /* EZAudioPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlot.m; sourceTree = "<group>"; };
6628E2B31B3A1CCE00020E56 /* EZAudioPlotGL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGL.h; sourceTree = "<group>"; };
6628E2B41B3A1CCE00020E56 /* EZAudioPlotGL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGL.m; sourceTree = "<group>"; };
6628E2B51B3A1CCE00020E56 /* EZAudioPlotGLKViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGLKViewController.h; sourceTree = "<group>"; };
6628E2B61B3A1CCE00020E56 /* EZAudioPlotGLKViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGLKViewController.m; sourceTree = "<group>"; };
6628E2B71B3A1CCE00020E56 /* EZAudioUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioUtilities.h; sourceTree = "<group>"; };
6628E2B81B3A1CCE00020E56 /* EZAudioUtilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioUtilities.m; sourceTree = "<group>"; };
6628E2B91B3A1CCE00020E56 /* EZMicrophone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZMicrophone.h; sourceTree = "<group>"; };
6628E2BA1B3A1CCE00020E56 /* EZMicrophone.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZMicrophone.m; sourceTree = "<group>"; };
6628E2BB1B3A1CCE00020E56 /* EZOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZOutput.h; sourceTree = "<group>"; };
6628E2BC1B3A1CCE00020E56 /* EZOutput.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZOutput.m; sourceTree = "<group>"; };
6628E2BD1B3A1CCE00020E56 /* EZPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZPlot.h; sourceTree = "<group>"; };
6628E2BE1B3A1CCE00020E56 /* EZPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZPlot.m; sourceTree = "<group>"; };
6628E2BF1B3A1CCE00020E56 /* EZRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZRecorder.h; sourceTree = "<group>"; };
6628E2C01B3A1CCE00020E56 /* EZRecorder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZRecorder.m; sourceTree = "<group>"; };
6628E2C11B3A1CCE00020E56 /* TPCircularBuffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = TPCircularBuffer.c; sourceTree = "<group>"; };
6628E2C21B3A1CCE00020E56 /* TPCircularBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TPCircularBuffer.h; sourceTree = "<group>"; };
6628E2C41B3A1CCE00020E56 /* CHANGELOG */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CHANGELOG; sourceTree = "<group>"; };
6628E2C51B3A1CCE00020E56 /* VERSION */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VERSION; sourceTree = "<group>"; };
9417A8F31871492000D9D37B /* EZAudioFFTExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = EZAudioFFTExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
9417A8F61871492000D9D37B /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
9417A8F91871492000D9D37B /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
@@ -72,30 +111,6 @@
9417A91C1871492100D9D37B /* EZAudioFFTExampleTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "EZAudioFFTExampleTests-Info.plist"; sourceTree = "<group>"; };
9417A91E1871492100D9D37B /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
9417A9201871492100D9D37B /* EZAudioFFTExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = EZAudioFFTExampleTests.m; sourceTree = "<group>"; };
9417A92B1871493900D9D37B /* AEFloatConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AEFloatConverter.h; sourceTree = "<group>"; };
9417A92C1871493900D9D37B /* AEFloatConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AEFloatConverter.m; sourceTree = "<group>"; };
9417A92D1871493900D9D37B /* EZAudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudio.h; sourceTree = "<group>"; };
9417A92E1871493900D9D37B /* EZAudio.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudio.m; sourceTree = "<group>"; };
9417A92F1871493900D9D37B /* EZAudioFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFile.h; sourceTree = "<group>"; };
9417A9301871493900D9D37B /* EZAudioFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFile.m; sourceTree = "<group>"; };
9417A9311871493900D9D37B /* EZAudioPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlot.h; sourceTree = "<group>"; };
9417A9321871493900D9D37B /* EZAudioPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlot.m; sourceTree = "<group>"; };
9417A9331871493900D9D37B /* EZAudioPlotGL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGL.h; sourceTree = "<group>"; };
9417A9341871493900D9D37B /* EZAudioPlotGL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGL.m; sourceTree = "<group>"; };
9417A9351871493900D9D37B /* EZAudioPlotGLKViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGLKViewController.h; sourceTree = "<group>"; };
9417A9361871493900D9D37B /* EZAudioPlotGLKViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGLKViewController.m; sourceTree = "<group>"; };
9417A9371871493900D9D37B /* EZMicrophone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZMicrophone.h; sourceTree = "<group>"; };
9417A9381871493900D9D37B /* EZMicrophone.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZMicrophone.m; sourceTree = "<group>"; };
9417A9391871493900D9D37B /* EZOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZOutput.h; sourceTree = "<group>"; };
9417A93A1871493900D9D37B /* EZOutput.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZOutput.m; sourceTree = "<group>"; };
9417A93B1871493900D9D37B /* EZPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZPlot.h; sourceTree = "<group>"; };
9417A93C1871493900D9D37B /* EZPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZPlot.m; sourceTree = "<group>"; };
9417A93D1871493900D9D37B /* EZRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZRecorder.h; sourceTree = "<group>"; };
9417A93E1871493900D9D37B /* EZRecorder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZRecorder.m; sourceTree = "<group>"; };
9417A93F1871493900D9D37B /* TPCircularBuffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = TPCircularBuffer.c; sourceTree = "<group>"; };
9417A9401871493900D9D37B /* TPCircularBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TPCircularBuffer.h; sourceTree = "<group>"; };
9417A9421871493900D9D37B /* CHANGELOG */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CHANGELOG; sourceTree = "<group>"; };
9417A9431871493900D9D37B /* VERSION */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VERSION; sourceTree = "<group>"; };
9417A951187149EA00D9D37B /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
9417A952187149EA00D9D37B /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = System/Library/Frameworks/AudioUnit.framework; sourceTree = SDKROOT; };
9417A953187149EA00D9D37B /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = System/Library/Frameworks/CoreAudio.framework; sourceTree = SDKROOT; };
@@ -136,6 +151,56 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
6628E2A21B3A1CCE00020E56 /* EZAudio */ = {
isa = PBXGroup;
children = (
6628E2A31B3A1CCE00020E56 /* AEFloatConverter.h */,
6628E2A41B3A1CCE00020E56 /* AEFloatConverter.m */,
6628E2A51B3A1CCE00020E56 /* EZAudio.h */,
6628E2A61B3A1CCE00020E56 /* EZAudio.m */,
6628E2A71B3A1CCE00020E56 /* EZAudioDevice.h */,
6628E2A81B3A1CCE00020E56 /* EZAudioDevice.m */,
6628E2A91B3A1CCE00020E56 /* EZAudioFile.h */,
6628E2AA1B3A1CCE00020E56 /* EZAudioFile.m */,
6628E2AB1B3A1CCE00020E56 /* EZAudioFloatConverter.h */,
6628E2AC1B3A1CCE00020E56 /* EZAudioFloatConverter.m */,
6628E2AD1B3A1CCE00020E56 /* EZAudioFloatData.h */,
6628E2AE1B3A1CCE00020E56 /* EZAudioFloatData.m */,
6628E2AF1B3A1CCE00020E56 /* EZAudioPlayer.h */,
6628E2B01B3A1CCE00020E56 /* EZAudioPlayer.m */,
6628E2B11B3A1CCE00020E56 /* EZAudioPlot.h */,
6628E2B21B3A1CCE00020E56 /* EZAudioPlot.m */,
6628E2B31B3A1CCE00020E56 /* EZAudioPlotGL.h */,
6628E2B41B3A1CCE00020E56 /* EZAudioPlotGL.m */,
6628E2B51B3A1CCE00020E56 /* EZAudioPlotGLKViewController.h */,
6628E2B61B3A1CCE00020E56 /* EZAudioPlotGLKViewController.m */,
6628E2B71B3A1CCE00020E56 /* EZAudioUtilities.h */,
6628E2B81B3A1CCE00020E56 /* EZAudioUtilities.m */,
6628E2B91B3A1CCE00020E56 /* EZMicrophone.h */,
6628E2BA1B3A1CCE00020E56 /* EZMicrophone.m */,
6628E2BB1B3A1CCE00020E56 /* EZOutput.h */,
6628E2BC1B3A1CCE00020E56 /* EZOutput.m */,
6628E2BD1B3A1CCE00020E56 /* EZPlot.h */,
6628E2BE1B3A1CCE00020E56 /* EZPlot.m */,
6628E2BF1B3A1CCE00020E56 /* EZRecorder.h */,
6628E2C01B3A1CCE00020E56 /* EZRecorder.m */,
6628E2C11B3A1CCE00020E56 /* TPCircularBuffer.c */,
6628E2C21B3A1CCE00020E56 /* TPCircularBuffer.h */,
6628E2C31B3A1CCE00020E56 /* VERSION */,
);
name = EZAudio;
path = ../../../../EZAudio;
sourceTree = "<group>";
};
6628E2C31B3A1CCE00020E56 /* VERSION */ = {
isa = PBXGroup;
children = (
6628E2C41B3A1CCE00020E56 /* CHANGELOG */,
6628E2C51B3A1CCE00020E56 /* VERSION */,
);
path = VERSION;
sourceTree = "<group>";
};
9417A8EA1871492000D9D37B = {
isa = PBXGroup;
children = (
@@ -185,7 +250,7 @@
9417A8FC1871492000D9D37B /* EZAudioFFTExample */ = {
isa = PBXGroup;
children = (
9417A92A1871493900D9D37B /* EZAudio */,
6628E2A21B3A1CCE00020E56 /* EZAudio */,
9417A9081871492100D9D37B /* AppDelegate.h */,
9417A9091871492100D9D37B /* AppDelegate.m */,
9417A9D31872130200D9D37B /* FFTViewController.h */,
@@ -228,46 +293,6 @@
name = "Supporting Files";
sourceTree = "<group>";
};
9417A92A1871493900D9D37B /* EZAudio */ = {
isa = PBXGroup;
children = (
9417A92B1871493900D9D37B /* AEFloatConverter.h */,
9417A92C1871493900D9D37B /* AEFloatConverter.m */,
9417A92D1871493900D9D37B /* EZAudio.h */,
9417A92E1871493900D9D37B /* EZAudio.m */,
9417A92F1871493900D9D37B /* EZAudioFile.h */,
9417A9301871493900D9D37B /* EZAudioFile.m */,
9417A9311871493900D9D37B /* EZAudioPlot.h */,
9417A9321871493900D9D37B /* EZAudioPlot.m */,
9417A9331871493900D9D37B /* EZAudioPlotGL.h */,
9417A9341871493900D9D37B /* EZAudioPlotGL.m */,
9417A9351871493900D9D37B /* EZAudioPlotGLKViewController.h */,
9417A9361871493900D9D37B /* EZAudioPlotGLKViewController.m */,
9417A9371871493900D9D37B /* EZMicrophone.h */,
9417A9381871493900D9D37B /* EZMicrophone.m */,
9417A9391871493900D9D37B /* EZOutput.h */,
9417A93A1871493900D9D37B /* EZOutput.m */,
9417A93B1871493900D9D37B /* EZPlot.h */,
9417A93C1871493900D9D37B /* EZPlot.m */,
9417A93D1871493900D9D37B /* EZRecorder.h */,
9417A93E1871493900D9D37B /* EZRecorder.m */,
9417A93F1871493900D9D37B /* TPCircularBuffer.c */,
9417A9401871493900D9D37B /* TPCircularBuffer.h */,
9417A9411871493900D9D37B /* VERSION */,
);
name = EZAudio;
path = ../../../../EZAudio;
sourceTree = "<group>";
};
9417A9411871493900D9D37B /* VERSION */ = {
isa = PBXGroup;
children = (
9417A9421871493900D9D37B /* CHANGELOG */,
9417A9431871493900D9D37B /* VERSION */,
);
path = VERSION;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -345,12 +370,12 @@
buildActionMask = 2147483647;
files = (
9417A9011871492000D9D37B /* InfoPlist.strings in Resources */,
6628E2D71B3A1CCE00020E56 /* VERSION in Resources */,
9417A9D71872130200D9D37B /* FFTViewController.xib in Resources */,
9417A90F1871492100D9D37B /* Images.xcassets in Resources */,
9417A9071871492100D9D37B /* Credits.rtf in Resources */,
9417A9501871493900D9D37B /* VERSION in Resources */,
9417A90D1871492100D9D37B /* MainMenu.xib in Resources */,
9417A94F1871493900D9D37B /* CHANGELOG in Resources */,
6628E2D61B3A1CCE00020E56 /* CHANGELOG in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -369,20 +394,25 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9417A94D1871493900D9D37B /* EZRecorder.m in Sources */,
9417A9471871493900D9D37B /* EZAudioPlot.m in Sources */,
9417A94C1871493900D9D37B /* EZPlot.m in Sources */,
6628E2D41B3A1CCE00020E56 /* EZRecorder.m in Sources */,
9417A9D61872130200D9D37B /* FFTViewController.m in Sources */,
9417A9441871493900D9D37B /* AEFloatConverter.m in Sources */,
9417A94A1871493900D9D37B /* EZMicrophone.m in Sources */,
9417A94B1871493900D9D37B /* EZOutput.m in Sources */,
9417A9451871493900D9D37B /* EZAudio.m in Sources */,
9417A94E1871493900D9D37B /* TPCircularBuffer.c in Sources */,
9417A9481871493900D9D37B /* EZAudioPlotGL.m in Sources */,
9417A9461871493900D9D37B /* EZAudioFile.m in Sources */,
6628E2CA1B3A1CCE00020E56 /* EZAudioFloatConverter.m in Sources */,
6628E2CB1B3A1CCE00020E56 /* EZAudioFloatData.m in Sources */,
6628E2C61B3A1CCE00020E56 /* AEFloatConverter.m in Sources */,
6628E2C91B3A1CCE00020E56 /* EZAudioFile.m in Sources */,
6628E2D21B3A1CCE00020E56 /* EZOutput.m in Sources */,
6628E2CE1B3A1CCE00020E56 /* EZAudioPlotGL.m in Sources */,
6628E2D51B3A1CCE00020E56 /* TPCircularBuffer.c in Sources */,
6628E2CD1B3A1CCE00020E56 /* EZAudioPlot.m in Sources */,
9417A90A1871492100D9D37B /* AppDelegate.m in Sources */,
9417A9491871493900D9D37B /* EZAudioPlotGLKViewController.m in Sources */,
6628E2D11B3A1CCE00020E56 /* EZMicrophone.m in Sources */,
6628E2CC1B3A1CCE00020E56 /* EZAudioPlayer.m in Sources */,
6628E2C81B3A1CCE00020E56 /* EZAudioDevice.m in Sources */,
9417A9031871492000D9D37B /* main.m in Sources */,
6628E2D31B3A1CCE00020E56 /* EZPlot.m in Sources */,
6628E2C71B3A1CCE00020E56 /* EZAudio.m in Sources */,
6628E2D01B3A1CCE00020E56 /* EZAudioUtilities.m in Sources */,
6628E2CF1B3A1CCE00020E56 /* EZAudioPlotGLKViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="4514" systemVersion="13A603" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="5053" systemVersion="13C64" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="4514"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="5053"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
@@ -654,26 +654,13 @@
<view key="contentView" id="372">
<rect key="frame" x="0.0" y="0.0" width="480" height="360"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="PCv-Jm-jzO" customClass="EZAudioPlot">
<rect key="frame" x="0.0" y="0.0" width="480" height="360"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
</customView>
</subviews>
<constraints>
<constraint firstAttribute="trailing" secondItem="PCv-Jm-jzO" secondAttribute="trailing" id="A2i-gs-EWe"/>
<constraint firstItem="PCv-Jm-jzO" firstAttribute="leading" secondItem="372" secondAttribute="leading" id="Gex-TR-aqy"/>
<constraint firstAttribute="bottom" secondItem="PCv-Jm-jzO" secondAttribute="bottom" id="Kqa-V4-EDP"/>
<constraint firstItem="PCv-Jm-jzO" firstAttribute="top" secondItem="372" secondAttribute="top" id="MeC-7d-nwe"/>
</constraints>
</view>
</window>
<customObject id="494" customClass="AppDelegate">
<connections>
<outlet property="audioPlot" destination="PCv-Jm-jzO" id="aGl-Mf-G6W"/>
<outlet property="window" destination="371" id="532"/>
</connections>
</customObject>
<customObject id="420" customClass="NSFontManager"/>
</objects>
</document>
</document>
@@ -44,12 +44,12 @@
/**
EZAudioPlot for frequency plot
*/
@property (nonatomic,weak) IBOutlet EZAudioPlot *audioPlotFreq;
@property (nonatomic,weak) IBOutlet EZAudioPlotGL *audioPlotFreq;
/**
EZAudioPlot for time plot
*/
@property (nonatomic,weak) IBOutlet EZAudioPlotGL *audioPlotTime;
@property (nonatomic,weak) IBOutlet EZAudioPlot *audioPlotTime;
/**
Microphone
@@ -25,152 +25,180 @@
#import "FFTViewController.h"
@interface FFTViewController (){
COMPLEX_SPLIT _A;
FFTSetup _FFTSetup;
BOOL _isFFTSetup;
vDSP_Length _log2n;
}
@interface FFTViewController ()
@property (nonatomic, assign) COMPLEX_SPLIT *A;
@property (nonatomic, assign) FFTSetup FFTSetup;
@property (nonatomic, assign) vDSP_Length log2n;
@property (nonatomic, assign) BOOL isFFTSetup;
@end
@implementation FFTViewController
@synthesize audioPlotFreq;
@synthesize audioPlotTime;
@synthesize microphone;
#pragma mark - Initialization
-(id)init {
self = [super initWithNibName:NSStringFromClass(self.class) bundle:nil];
if(self){
[self initializeViewController];
}
return self;
}
-(id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithNibName:NSStringFromClass(self.class) bundle:nil];
if(self){
[self initializeViewController];
}
return self;
}
-(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:NSStringFromClass(self.class) bundle:nil];
if(self){
[self initializeViewController];
}
return self;
}
#pragma mark - Initialize View Controller
-(void)initializeViewController {
// Create an instance of the microphone and tell it to use this view controller instance as the delegate
self.microphone = [EZMicrophone microphoneWithDelegate:self
startsImmediately:YES];
//------------------------------------------------------------------------------
#pragma mark - Dealloc
//------------------------------------------------------------------------------
- (void)dealloc
{
vDSP_destroy_fftsetup(self.FFTSetup);
free(self.A);
}
//------------------------------------------------------------------------------
#pragma mark - Customize the Audio Plot
-(void)awakeFromNib {
// Setup time domain audio plot
self.audioPlotTime.backgroundColor = [NSColor colorWithCalibratedRed: 0.569 green: 0.82 blue: 0.478 alpha: 1];
self.audioPlotTime.color = [NSColor colorWithCalibratedRed:1.0 green:1.0 blue:1.0 alpha:1.0];
self.audioPlotTime.shouldFill = YES;
self.audioPlotTime.shouldMirror = YES;
self.audioPlotTime.plotType = EZPlotTypeRolling;
// Setup frequency domain audio plot
self.audioPlotFreq.backgroundColor = [NSColor colorWithCalibratedRed: 0.984 green: 0.471 blue: 0.525 alpha: 1];
self.audioPlotFreq.color = [NSColor colorWithCalibratedRed:1.0 green:1.0 blue:1.0 alpha:1.0];
self.audioPlotFreq.shouldFill = YES;
self.audioPlotFreq.plotType = EZPlotTypeBuffer;
//------------------------------------------------------------------------------
- (void)awakeFromNib
{
//
// Setup time domain audio plot
//
self.audioPlotTime.backgroundColor = [NSColor colorWithCalibratedRed: 0.569 green: 0.82 blue: 0.478 alpha: 1];
self.audioPlotTime.color = [NSColor colorWithCalibratedRed:1.0 green:1.0 blue:1.0 alpha:1.0];
self.audioPlotTime.shouldFill = YES;
self.audioPlotTime.shouldMirror = YES;
self.audioPlotTime.plotType = EZPlotTypeRolling;
//
// Setup frequency domain audio plot
//
self.audioPlotFreq.backgroundColor = [NSColor colorWithCalibratedRed: 0.984 green: 0.471 blue: 0.525 alpha: 1];
self.audioPlotFreq.color = [NSColor colorWithCalibratedRed:1.0 green:1.0 blue:1.0 alpha:1.0];
self.audioPlotFreq.shouldFill = YES;
self.audioPlotFreq.plotType = EZPlotTypeBuffer;
//
// Create an instance of the microphone and tell it to use this view controller instance as the delegate
//
self.microphone = [EZMicrophone microphoneWithDelegate:self
startsImmediately:YES];
}
//------------------------------------------------------------------------------
#pragma mark - FFT
//------------------------------------------------------------------------------
/**
Adapted from http://batmobile.blogs.ilrt.org/fourier-transforms-on-an-iphone/
*/
-(void)createFFTWithBufferSize:(float)bufferSize withAudioData:(float*)data {
// Setup the length
_log2n = log2f(bufferSize);
// Calculate the weights array. This is a one-off operation.
_FFTSetup = vDSP_create_fftsetup(_log2n, FFT_RADIX2);
// For an FFT, numSamples must be a power of 2, i.e. is always even
int nOver2 = bufferSize/2;
// Populate *window with the values for a hamming window function
float *window = (float *)malloc(sizeof(float)*bufferSize);
vDSP_hamm_window(window, bufferSize, 0);
// Window the samples
vDSP_vmul(data, 1, window, 1, data, 1, bufferSize);
// Define complex buffer
_A.realp = (float *) malloc(nOver2*sizeof(float));
_A.imagp = (float *) malloc(nOver2*sizeof(float));
- (void)createFFTWithBufferSize:(float)bufferSize
withAudioData:(float *)data
{
//
// Setup the length
//
self.log2n = log2f(bufferSize);
//
// Calculate the weights array. This is a one-off operation.
//
_FFTSetup = vDSP_create_fftsetup(self.log2n, FFT_RADIX2);
//
// For an FFT, numSamples must be a power of 2, i.e. is always even
//
int nOver2 = bufferSize/2;
//
// Populate *window with the values for a hamming window function
//
float *window = (float *)malloc(sizeof(float) * bufferSize);
vDSP_hamm_window(window, bufferSize, 0);
//
// Window the samples
//
vDSP_vmul(data, 1, window, 1, data, 1, bufferSize);
//
// Define complex buffer
//
self.A = malloc(sizeof(COMPLEX_SPLIT));
self.A->realp = (float *) malloc(nOver2 * sizeof(float));
self.A->imagp = (float *) malloc(nOver2 * sizeof(float));
}
-(void)updateFFTWithBufferSize:(float)bufferSize withAudioData:(float*)data {
// For an FFT, numSamples must be a power of 2, i.e. is always even
int nOver2 = bufferSize/2;
// Pack samples:
// C(re) -> A[n], C(im) -> A[n+1]
vDSP_ctoz((COMPLEX*)data, 2, &_A, 1, nOver2);
// Perform a forward FFT using fftSetup and A
// Results are returned in A
vDSP_fft_zrip(_FFTSetup, &_A, 1, _log2n, FFT_FORWARD);
// Convert COMPLEX_SPLIT A result to magnitudes
float amp[nOver2];
float maxMag = 0;
for(int i=0; i<nOver2; i++) {
// Calculate the magnitude
float mag = _A.realp[i]*_A.realp[i]+_A.imagp[i]*_A.imagp[i];
maxMag = mag > maxMag ? mag : maxMag;
}
for(int i=0; i<nOver2; i++) {
// Calculate the magnitude
float mag = _A.realp[i]*_A.realp[i]+_A.imagp[i]*_A.imagp[i];
// Bind the value to be less than 1.0 to fit in the graph
amp[i] = [EZAudio MAP:mag leftMin:0.0 leftMax:maxMag rightMin:0.0 rightMax:1.0];
}
// Update the frequency domain plot
[self.audioPlotFreq updateBuffer:amp
withBufferSize:nOver2];
//------------------------------------------------------------------------------
- (void)updateFFTWithBufferSize:(float)bufferSize
withAudioData:(float*)data
{
//
// For an FFT, numSamples must be a power of 2, i.e. is always even
//
int nOver2 = bufferSize / 2;
//
// Pack samples:
// C(re) -> A[n], C(im) -> A[n+1]
//
vDSP_ctoz((COMPLEX *)data, 2, self.A, 1, nOver2);
//
// Perform a forward FFT using fftSetup and A
// Results are returned in A
//
vDSP_fft_zrip(_FFTSetup, self.A, 1, self.log2n, FFT_FORWARD);
//
// Convert COMPLEX_SPLIT A result to magnitudes
//
float amp[nOver2];
float maxMag = 0;
for(int i = 0; i < nOver2; i++)
{
// Calculate the magnitude
float mag = self.A->realp[i]*self.A->realp[i]+self.A->imagp[i]*self.A->imagp[i];
maxMag = mag > maxMag ? mag : maxMag;
}
for(int i=0; i < nOver2; i++)
{
// Calculate the magnitude
float mag = self.A->realp[i]*self.A->realp[i]+self.A->imagp[i]*self.A->imagp[i];
// Bind the value to be less than 1.0 to fit in the graph
amp[i] = [EZAudioUtilities MAP:mag leftMin:0.0 leftMax:maxMag rightMin:0.0 rightMax:1.0];
}
//
// Update the frequency domain plot
//
[self.audioPlotFreq updateBuffer:amp withBufferSize:nOver2];
}
//------------------------------------------------------------------------------
#pragma mark - EZMicrophoneDelegate
//------------------------------------------------------------------------------
-(void) microphone:(EZMicrophone *)microphone
hasAudioReceived:(float **)buffer
withBufferSize:(UInt32)bufferSize
withNumberOfChannels:(UInt32)numberOfChannels {
dispatch_async(dispatch_get_main_queue(), ^{
withNumberOfChannels:(UInt32)numberOfChannels
{
__weak typeof (self) weakSelf = self;
dispatch_async(dispatch_get_main_queue(), ^{
//
// Update time domain plot
//
[weakSelf.audioPlotTime updateBuffer:buffer[0]
withBufferSize:bufferSize];
//
// Lazily perform the FFT setup
//
if (!weakSelf.isFFTSetup)
{
[weakSelf createFFTWithBufferSize:bufferSize withAudioData:buffer[0]];
weakSelf.isFFTSetup = YES;
}
// Update time domain plot
[self.audioPlotTime updateBuffer:buffer[0]
withBufferSize:bufferSize];
// Setup the FFT if it's not already setup
if( !_isFFTSetup ){
[self createFFTWithBufferSize:bufferSize withAudioData:buffer[0]];
_isFFTSetup = YES;
}
// Get the FFT data
[self updateFFTWithBufferSize:bufferSize withAudioData:buffer[0]];
});
//
// Perform FFT and update FFT graph
//
[weakSelf updateFFTWithBufferSize:bufferSize
withAudioData:buffer[0]];
});
}
@end
//------------------------------------------------------------------------------
@end
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="4514" systemVersion="13A603" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="7702" systemVersion="14C109" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment version="1070" identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="4514"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="7702"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="FFTViewController">
@@ -13,20 +13,19 @@
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customView id="1">
<rect key="frame" x="0.0" y="0.0" width="480" height="272"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<splitView dividerStyle="thin" translatesAutoresizingMaskIntoConstraints="NO" id="78b-rz-Bpl">
<rect key="frame" x="0.0" y="0.0" width="480" height="272"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<customView fixedFrame="YES" id="Zcc-CT-67u" customClass="EZAudioPlotGL">
<customView fixedFrame="YES" id="Zcc-CT-67u" customClass="EZAudioPlot">
<rect key="frame" x="0.0" y="0.0" width="480" height="132"/>
<autoresizingMask key="autoresizingMask"/>
</customView>
<customView fixedFrame="YES" id="4V2-1I-w64" customClass="EZAudioPlot">
<customView fixedFrame="YES" id="4V2-1I-w64" customClass="EZAudioPlotGL">
<rect key="frame" x="0.0" y="133" width="480" height="139"/>
<autoresizingMask key="autoresizingMask"/>
</customView>
@@ -45,4 +44,4 @@
</constraints>
</customView>
</objects>
</document>
</document>
@@ -7,6 +7,24 @@
objects = {
/* Begin PBXBuildFile section */
665957541B38B2B4003E97A1 /* AEFloatConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 665957321B38B2B4003E97A1 /* AEFloatConverter.m */; };
665957551B38B2B4003E97A1 /* EZAudio.m in Sources */ = {isa = PBXBuildFile; fileRef = 665957341B38B2B4003E97A1 /* EZAudio.m */; };
665957561B38B2B4003E97A1 /* EZAudioDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = 665957361B38B2B4003E97A1 /* EZAudioDevice.m */; };
665957571B38B2B4003E97A1 /* EZAudioFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 665957381B38B2B4003E97A1 /* EZAudioFile.m */; };
665957581B38B2B4003E97A1 /* EZAudioFloatConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 6659573A1B38B2B4003E97A1 /* EZAudioFloatConverter.m */; };
665957591B38B2B4003E97A1 /* EZAudioFloatData.m in Sources */ = {isa = PBXBuildFile; fileRef = 6659573C1B38B2B4003E97A1 /* EZAudioFloatData.m */; };
6659575A1B38B2B4003E97A1 /* EZAudioPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 6659573E1B38B2B4003E97A1 /* EZAudioPlayer.m */; };
6659575B1B38B2B4003E97A1 /* EZAudioPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 665957401B38B2B4003E97A1 /* EZAudioPlot.m */; };
6659575C1B38B2B4003E97A1 /* EZAudioPlotGL.m in Sources */ = {isa = PBXBuildFile; fileRef = 665957421B38B2B4003E97A1 /* EZAudioPlotGL.m */; };
6659575D1B38B2B4003E97A1 /* EZAudioPlotGLKViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 665957441B38B2B4003E97A1 /* EZAudioPlotGLKViewController.m */; };
6659575E1B38B2B4003E97A1 /* EZAudioUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = 665957461B38B2B4003E97A1 /* EZAudioUtilities.m */; };
6659575F1B38B2B4003E97A1 /* EZMicrophone.m in Sources */ = {isa = PBXBuildFile; fileRef = 665957481B38B2B4003E97A1 /* EZMicrophone.m */; };
665957601B38B2B4003E97A1 /* EZOutput.m in Sources */ = {isa = PBXBuildFile; fileRef = 6659574A1B38B2B4003E97A1 /* EZOutput.m */; };
665957611B38B2B4003E97A1 /* EZPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 6659574C1B38B2B4003E97A1 /* EZPlot.m */; };
665957621B38B2B4003E97A1 /* EZRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 6659574E1B38B2B4003E97A1 /* EZRecorder.m */; };
665957631B38B2B4003E97A1 /* TPCircularBuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 6659574F1B38B2B4003E97A1 /* TPCircularBuffer.c */; };
665957641B38B2B4003E97A1 /* CHANGELOG in Resources */ = {isa = PBXBuildFile; fileRef = 665957521B38B2B4003E97A1 /* CHANGELOG */; };
665957651B38B2B4003E97A1 /* VERSION in Resources */ = {isa = PBXBuildFile; fileRef = 665957531B38B2B4003E97A1 /* VERSION */; };
94056D97185BB0BC00EB94BA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 94056D96185BB0BC00EB94BA /* Cocoa.framework */; };
94056DA1185BB0BC00EB94BA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 94056D9F185BB0BC00EB94BA /* InfoPlist.strings */; };
94056DA3185BB0BC00EB94BA /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 94056DA2185BB0BC00EB94BA /* main.m */; };
@@ -26,19 +44,6 @@
94056DD8185BB0F400EB94BA /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 94056DD5185BB0F400EB94BA /* AudioToolbox.framework */; };
94056DD9185BB0F400EB94BA /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 94056DD6185BB0F400EB94BA /* AudioUnit.framework */; };
94056DDA185BB0F400EB94BA /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 94056DD7185BB0F400EB94BA /* CoreAudio.framework */; };
9417A7171867DD2800D9D37B /* AEFloatConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A6FF1867DD2800D9D37B /* AEFloatConverter.m */; };
9417A7181867DD2800D9D37B /* EZAudio.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7011867DD2800D9D37B /* EZAudio.m */; };
9417A7191867DD2800D9D37B /* EZAudioFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7031867DD2800D9D37B /* EZAudioFile.m */; };
9417A71A1867DD2800D9D37B /* EZAudioPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7051867DD2800D9D37B /* EZAudioPlot.m */; };
9417A71B1867DD2800D9D37B /* EZAudioPlotGL.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7071867DD2800D9D37B /* EZAudioPlotGL.m */; };
9417A71C1867DD2800D9D37B /* EZAudioPlotGLKViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7091867DD2800D9D37B /* EZAudioPlotGLKViewController.m */; };
9417A71D1867DD2800D9D37B /* EZMicrophone.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A70B1867DD2800D9D37B /* EZMicrophone.m */; };
9417A71E1867DD2800D9D37B /* EZOutput.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A70D1867DD2800D9D37B /* EZOutput.m */; };
9417A71F1867DD2800D9D37B /* EZPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A70F1867DD2800D9D37B /* EZPlot.m */; };
9417A7201867DD2800D9D37B /* EZRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7111867DD2800D9D37B /* EZRecorder.m */; };
9417A7211867DD2800D9D37B /* TPCircularBuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7121867DD2800D9D37B /* TPCircularBuffer.c */; };
9417A7221867DD2800D9D37B /* CHANGELOG in Resources */ = {isa = PBXBuildFile; fileRef = 9417A7151867DD2800D9D37B /* CHANGELOG */; };
9417A7231867DD2800D9D37B /* VERSION in Resources */ = {isa = PBXBuildFile; fileRef = 9417A7161867DD2800D9D37B /* VERSION */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -52,6 +57,40 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
665957311B38B2B4003E97A1 /* AEFloatConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AEFloatConverter.h; sourceTree = "<group>"; };
665957321B38B2B4003E97A1 /* AEFloatConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AEFloatConverter.m; sourceTree = "<group>"; };
665957331B38B2B4003E97A1 /* EZAudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudio.h; sourceTree = "<group>"; };
665957341B38B2B4003E97A1 /* EZAudio.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudio.m; sourceTree = "<group>"; };
665957351B38B2B4003E97A1 /* EZAudioDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioDevice.h; sourceTree = "<group>"; };
665957361B38B2B4003E97A1 /* EZAudioDevice.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioDevice.m; sourceTree = "<group>"; };
665957371B38B2B4003E97A1 /* EZAudioFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFile.h; sourceTree = "<group>"; };
665957381B38B2B4003E97A1 /* EZAudioFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFile.m; sourceTree = "<group>"; };
665957391B38B2B4003E97A1 /* EZAudioFloatConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFloatConverter.h; sourceTree = "<group>"; };
6659573A1B38B2B4003E97A1 /* EZAudioFloatConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFloatConverter.m; sourceTree = "<group>"; };
6659573B1B38B2B4003E97A1 /* EZAudioFloatData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFloatData.h; sourceTree = "<group>"; };
6659573C1B38B2B4003E97A1 /* EZAudioFloatData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFloatData.m; sourceTree = "<group>"; };
6659573D1B38B2B4003E97A1 /* EZAudioPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlayer.h; sourceTree = "<group>"; };
6659573E1B38B2B4003E97A1 /* EZAudioPlayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlayer.m; sourceTree = "<group>"; };
6659573F1B38B2B4003E97A1 /* EZAudioPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlot.h; sourceTree = "<group>"; };
665957401B38B2B4003E97A1 /* EZAudioPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlot.m; sourceTree = "<group>"; };
665957411B38B2B4003E97A1 /* EZAudioPlotGL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGL.h; sourceTree = "<group>"; };
665957421B38B2B4003E97A1 /* EZAudioPlotGL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGL.m; sourceTree = "<group>"; };
665957431B38B2B4003E97A1 /* EZAudioPlotGLKViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGLKViewController.h; sourceTree = "<group>"; };
665957441B38B2B4003E97A1 /* EZAudioPlotGLKViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGLKViewController.m; sourceTree = "<group>"; };
665957451B38B2B4003E97A1 /* EZAudioUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioUtilities.h; sourceTree = "<group>"; };
665957461B38B2B4003E97A1 /* EZAudioUtilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioUtilities.m; sourceTree = "<group>"; };
665957471B38B2B4003E97A1 /* EZMicrophone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZMicrophone.h; sourceTree = "<group>"; };
665957481B38B2B4003E97A1 /* EZMicrophone.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZMicrophone.m; sourceTree = "<group>"; };
665957491B38B2B4003E97A1 /* EZOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZOutput.h; sourceTree = "<group>"; };
6659574A1B38B2B4003E97A1 /* EZOutput.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZOutput.m; sourceTree = "<group>"; };
6659574B1B38B2B4003E97A1 /* EZPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZPlot.h; sourceTree = "<group>"; };
6659574C1B38B2B4003E97A1 /* EZPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZPlot.m; sourceTree = "<group>"; };
6659574D1B38B2B4003E97A1 /* EZRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZRecorder.h; sourceTree = "<group>"; };
6659574E1B38B2B4003E97A1 /* EZRecorder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZRecorder.m; sourceTree = "<group>"; };
6659574F1B38B2B4003E97A1 /* TPCircularBuffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = TPCircularBuffer.c; sourceTree = "<group>"; };
665957501B38B2B4003E97A1 /* TPCircularBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TPCircularBuffer.h; sourceTree = "<group>"; };
665957521B38B2B4003E97A1 /* CHANGELOG */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CHANGELOG; sourceTree = "<group>"; };
665957531B38B2B4003E97A1 /* VERSION */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VERSION; sourceTree = "<group>"; };
94056D93185BB0BC00EB94BA /* EZAudioOpenGLWaveformExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = EZAudioOpenGLWaveformExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
94056D96185BB0BC00EB94BA /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
94056D99185BB0BC00EB94BA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
@@ -80,30 +119,6 @@
94056DD5185BB0F400EB94BA /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
94056DD6185BB0F400EB94BA /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = System/Library/Frameworks/AudioUnit.framework; sourceTree = SDKROOT; };
94056DD7185BB0F400EB94BA /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = System/Library/Frameworks/CoreAudio.framework; sourceTree = SDKROOT; };
9417A6FE1867DD2800D9D37B /* AEFloatConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AEFloatConverter.h; sourceTree = "<group>"; };
9417A6FF1867DD2800D9D37B /* AEFloatConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AEFloatConverter.m; sourceTree = "<group>"; };
9417A7001867DD2800D9D37B /* EZAudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudio.h; sourceTree = "<group>"; };
9417A7011867DD2800D9D37B /* EZAudio.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudio.m; sourceTree = "<group>"; };
9417A7021867DD2800D9D37B /* EZAudioFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFile.h; sourceTree = "<group>"; };
9417A7031867DD2800D9D37B /* EZAudioFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFile.m; sourceTree = "<group>"; };
9417A7041867DD2800D9D37B /* EZAudioPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlot.h; sourceTree = "<group>"; };
9417A7051867DD2800D9D37B /* EZAudioPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlot.m; sourceTree = "<group>"; };
9417A7061867DD2800D9D37B /* EZAudioPlotGL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGL.h; sourceTree = "<group>"; };
9417A7071867DD2800D9D37B /* EZAudioPlotGL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGL.m; sourceTree = "<group>"; };
9417A7081867DD2800D9D37B /* EZAudioPlotGLKViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGLKViewController.h; sourceTree = "<group>"; };
9417A7091867DD2800D9D37B /* EZAudioPlotGLKViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGLKViewController.m; sourceTree = "<group>"; };
9417A70A1867DD2800D9D37B /* EZMicrophone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZMicrophone.h; sourceTree = "<group>"; };
9417A70B1867DD2800D9D37B /* EZMicrophone.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZMicrophone.m; sourceTree = "<group>"; };
9417A70C1867DD2800D9D37B /* EZOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZOutput.h; sourceTree = "<group>"; };
9417A70D1867DD2800D9D37B /* EZOutput.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZOutput.m; sourceTree = "<group>"; };
9417A70E1867DD2800D9D37B /* EZPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZPlot.h; sourceTree = "<group>"; };
9417A70F1867DD2800D9D37B /* EZPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZPlot.m; sourceTree = "<group>"; };
9417A7101867DD2800D9D37B /* EZRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZRecorder.h; sourceTree = "<group>"; };
9417A7111867DD2800D9D37B /* EZRecorder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZRecorder.m; sourceTree = "<group>"; };
9417A7121867DD2800D9D37B /* TPCircularBuffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = TPCircularBuffer.c; sourceTree = "<group>"; };
9417A7131867DD2800D9D37B /* TPCircularBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TPCircularBuffer.h; sourceTree = "<group>"; };
9417A7151867DD2800D9D37B /* CHANGELOG */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CHANGELOG; sourceTree = "<group>"; };
9417A7161867DD2800D9D37B /* VERSION */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VERSION; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -133,6 +148,56 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
665957301B38B2B4003E97A1 /* EZAudio */ = {
isa = PBXGroup;
children = (
665957311B38B2B4003E97A1 /* AEFloatConverter.h */,
665957321B38B2B4003E97A1 /* AEFloatConverter.m */,
665957331B38B2B4003E97A1 /* EZAudio.h */,
665957341B38B2B4003E97A1 /* EZAudio.m */,
665957351B38B2B4003E97A1 /* EZAudioDevice.h */,
665957361B38B2B4003E97A1 /* EZAudioDevice.m */,
665957371B38B2B4003E97A1 /* EZAudioFile.h */,
665957381B38B2B4003E97A1 /* EZAudioFile.m */,
665957391B38B2B4003E97A1 /* EZAudioFloatConverter.h */,
6659573A1B38B2B4003E97A1 /* EZAudioFloatConverter.m */,
6659573B1B38B2B4003E97A1 /* EZAudioFloatData.h */,
6659573C1B38B2B4003E97A1 /* EZAudioFloatData.m */,
6659573D1B38B2B4003E97A1 /* EZAudioPlayer.h */,
6659573E1B38B2B4003E97A1 /* EZAudioPlayer.m */,
6659573F1B38B2B4003E97A1 /* EZAudioPlot.h */,
665957401B38B2B4003E97A1 /* EZAudioPlot.m */,
665957411B38B2B4003E97A1 /* EZAudioPlotGL.h */,
665957421B38B2B4003E97A1 /* EZAudioPlotGL.m */,
665957431B38B2B4003E97A1 /* EZAudioPlotGLKViewController.h */,
665957441B38B2B4003E97A1 /* EZAudioPlotGLKViewController.m */,
665957451B38B2B4003E97A1 /* EZAudioUtilities.h */,
665957461B38B2B4003E97A1 /* EZAudioUtilities.m */,
665957471B38B2B4003E97A1 /* EZMicrophone.h */,
665957481B38B2B4003E97A1 /* EZMicrophone.m */,
665957491B38B2B4003E97A1 /* EZOutput.h */,
6659574A1B38B2B4003E97A1 /* EZOutput.m */,
6659574B1B38B2B4003E97A1 /* EZPlot.h */,
6659574C1B38B2B4003E97A1 /* EZPlot.m */,
6659574D1B38B2B4003E97A1 /* EZRecorder.h */,
6659574E1B38B2B4003E97A1 /* EZRecorder.m */,
6659574F1B38B2B4003E97A1 /* TPCircularBuffer.c */,
665957501B38B2B4003E97A1 /* TPCircularBuffer.h */,
665957511B38B2B4003E97A1 /* VERSION */,
);
name = EZAudio;
path = ../../../../EZAudio;
sourceTree = "<group>";
};
665957511B38B2B4003E97A1 /* VERSION */ = {
isa = PBXGroup;
children = (
665957521B38B2B4003E97A1 /* CHANGELOG */,
665957531B38B2B4003E97A1 /* VERSION */,
);
path = VERSION;
sourceTree = "<group>";
};
94056D8A185BB0BC00EB94BA = {
isa = PBXGroup;
children = (
@@ -181,7 +246,7 @@
94056D9C185BB0BC00EB94BA /* EZAudioOpenGLWaveformExample */ = {
isa = PBXGroup;
children = (
9417A6FD1867DD2800D9D37B /* EZAudio */,
665957301B38B2B4003E97A1 /* EZAudio */,
94056DA8185BB0BC00EB94BA /* AppDelegate.h */,
94056DA9185BB0BC00EB94BA /* AppDelegate.m */,
94056DCA185BB0D600EB94BA /* OpenGLWaveformViewController.h */,
@@ -224,46 +289,6 @@
name = "Supporting Files";
sourceTree = "<group>";
};
9417A6FD1867DD2800D9D37B /* EZAudio */ = {
isa = PBXGroup;
children = (
9417A6FE1867DD2800D9D37B /* AEFloatConverter.h */,
9417A6FF1867DD2800D9D37B /* AEFloatConverter.m */,
9417A7001867DD2800D9D37B /* EZAudio.h */,
9417A7011867DD2800D9D37B /* EZAudio.m */,
9417A7021867DD2800D9D37B /* EZAudioFile.h */,
9417A7031867DD2800D9D37B /* EZAudioFile.m */,
9417A7041867DD2800D9D37B /* EZAudioPlot.h */,
9417A7051867DD2800D9D37B /* EZAudioPlot.m */,
9417A7061867DD2800D9D37B /* EZAudioPlotGL.h */,
9417A7071867DD2800D9D37B /* EZAudioPlotGL.m */,
9417A7081867DD2800D9D37B /* EZAudioPlotGLKViewController.h */,
9417A7091867DD2800D9D37B /* EZAudioPlotGLKViewController.m */,
9417A70A1867DD2800D9D37B /* EZMicrophone.h */,
9417A70B1867DD2800D9D37B /* EZMicrophone.m */,
9417A70C1867DD2800D9D37B /* EZOutput.h */,
9417A70D1867DD2800D9D37B /* EZOutput.m */,
9417A70E1867DD2800D9D37B /* EZPlot.h */,
9417A70F1867DD2800D9D37B /* EZPlot.m */,
9417A7101867DD2800D9D37B /* EZRecorder.h */,
9417A7111867DD2800D9D37B /* EZRecorder.m */,
9417A7121867DD2800D9D37B /* TPCircularBuffer.c */,
9417A7131867DD2800D9D37B /* TPCircularBuffer.h */,
9417A7141867DD2800D9D37B /* VERSION */,
);
name = EZAudio;
path = ../../../../EZAudio;
sourceTree = "<group>";
};
9417A7141867DD2800D9D37B /* VERSION */ = {
isa = PBXGroup;
children = (
9417A7151867DD2800D9D37B /* CHANGELOG */,
9417A7161867DD2800D9D37B /* VERSION */,
);
path = VERSION;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -341,12 +366,12 @@
buildActionMask = 2147483647;
files = (
94056DA1185BB0BC00EB94BA /* InfoPlist.strings in Resources */,
9417A7231867DD2800D9D37B /* VERSION in Resources */,
665957651B38B2B4003E97A1 /* VERSION in Resources */,
94056DAF185BB0BC00EB94BA /* Images.xcassets in Resources */,
94056DA7185BB0BC00EB94BA /* Credits.rtf in Resources */,
94056DCE185BB0D600EB94BA /* OpenGLWaveformViewController.xib in Resources */,
94056DAD185BB0BC00EB94BA /* MainMenu.xib in Resources */,
9417A7221867DD2800D9D37B /* CHANGELOG in Resources */,
665957641B38B2B4003E97A1 /* CHANGELOG in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -365,20 +390,25 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9417A7211867DD2800D9D37B /* TPCircularBuffer.c in Sources */,
9417A71E1867DD2800D9D37B /* EZOutput.m in Sources */,
9417A71C1867DD2800D9D37B /* EZAudioPlotGLKViewController.m in Sources */,
665957621B38B2B4003E97A1 /* EZRecorder.m in Sources */,
94056DAA185BB0BC00EB94BA /* AppDelegate.m in Sources */,
9417A7171867DD2800D9D37B /* AEFloatConverter.m in Sources */,
665957581B38B2B4003E97A1 /* EZAudioFloatConverter.m in Sources */,
665957591B38B2B4003E97A1 /* EZAudioFloatData.m in Sources */,
665957541B38B2B4003E97A1 /* AEFloatConverter.m in Sources */,
665957571B38B2B4003E97A1 /* EZAudioFile.m in Sources */,
665957601B38B2B4003E97A1 /* EZOutput.m in Sources */,
6659575C1B38B2B4003E97A1 /* EZAudioPlotGL.m in Sources */,
665957631B38B2B4003E97A1 /* TPCircularBuffer.c in Sources */,
6659575B1B38B2B4003E97A1 /* EZAudioPlot.m in Sources */,
94056DA3185BB0BC00EB94BA /* main.m in Sources */,
9417A71A1867DD2800D9D37B /* EZAudioPlot.m in Sources */,
9417A7191867DD2800D9D37B /* EZAudioFile.m in Sources */,
9417A71B1867DD2800D9D37B /* EZAudioPlotGL.m in Sources */,
6659575F1B38B2B4003E97A1 /* EZMicrophone.m in Sources */,
6659575A1B38B2B4003E97A1 /* EZAudioPlayer.m in Sources */,
665957561B38B2B4003E97A1 /* EZAudioDevice.m in Sources */,
94056DCD185BB0D600EB94BA /* OpenGLWaveformViewController.m in Sources */,
9417A71F1867DD2800D9D37B /* EZPlot.m in Sources */,
9417A71D1867DD2800D9D37B /* EZMicrophone.m in Sources */,
9417A7201867DD2800D9D37B /* EZRecorder.m in Sources */,
9417A7181867DD2800D9D37B /* EZAudio.m in Sources */,
665957611B38B2B4003E97A1 /* EZPlot.m in Sources */,
665957551B38B2B4003E97A1 /* EZAudio.m in Sources */,
6659575E1B38B2B4003E97A1 /* EZAudioUtilities.m in Sources */,
6659575D1B38B2B4003E97A1 /* EZAudioPlotGLKViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -38,7 +38,6 @@
self.openGLWaveformViewController.view.autoresizingMask = (NSViewWidthSizable|NSViewHeightSizable);
// Add in the core graphics view controller as subview
[self.window.contentView addSubview:self.openGLWaveformViewController.view];
}
@end
@@ -28,23 +28,43 @@
// Import EZAudio header
#import "EZAudio.h"
//------------------------------------------------------------------------------
#pragma mark - OpenGLWaveformViewController
//------------------------------------------------------------------------------
/**
We will allow this view controller to act as an EZMicrophoneDelegate. This is how we listen for the microphone callback.
*/
@interface OpenGLWaveformViewController : NSViewController <EZMicrophoneDelegate>
//------------------------------------------------------------------------------
#pragma mark - Components
//------------------------------------------------------------------------------
/**
The OpenGL based audio plot
*/
@property (nonatomic,weak) IBOutlet EZAudioPlotGL *audioPlot;
@property (nonatomic, weak) IBOutlet EZAudioPlotGL *audioPlot;
/**
The microphone component
*/
@property (nonatomic,strong) EZMicrophone *microphone;
@property (nonatomic, strong) EZMicrophone *microphone;
/**
The microphone pop up button (contains the menu for choosing a microphone input)
*/
@property (nonatomic, weak) IBOutlet NSPopUpButton *microphoneInputPopUpButton;
/**
The microphone input channel pop up button (contains the menu for choosing a microphone input channel)
*/
@property (nonatomic, weak) IBOutlet NSPopUpButton *microphoneInputChannelPopUpButton;
//------------------------------------------------------------------------------
#pragma mark - Actions
//------------------------------------------------------------------------------
/**
Switches the plot drawing type between a buffer plot (visualizes the current stream of audio data from the update function) or a rolling plot (visualizes the audio data over time, this is the classic waveform look)
*/
@@ -25,140 +25,227 @@
#import "OpenGLWaveformViewController.h"
@interface OpenGLWaveformViewController ()
@end
//------------------------------------------------------------------------------
#pragma mark - OpenGLWaveformViewController
//------------------------------------------------------------------------------
@implementation OpenGLWaveformViewController
#pragma mark - Initialization
-(id)init {
self = [super initWithNibName:NSStringFromClass(self.class) bundle:nil];
if(self){
[self initializeViewController];
}
return self;
}
-(id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithNibName:NSStringFromClass(self.class) bundle:nil];
if(self){
[self initializeViewController];
}
return self;
}
-(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:NSStringFromClass(self.class) bundle:nil];
if(self){
[self initializeViewController];
}
return self;
}
#pragma mark - Initialize View Controller
-(void)initializeViewController {
// Create an instance of the microphone and tell it to use this view controller instance as the delegate
self.microphone = [EZMicrophone microphoneWithDelegate:self];
}
//------------------------------------------------------------------------------
#pragma mark - Customize the Audio Plot
-(void)awakeFromNib {
/*
Customizing the audio plot's look
*/
// Background color
self.audioPlot.backgroundColor = [NSColor colorWithCalibratedRed: 0.569 green: 0.82 blue: 0.478 alpha: 1];
// Waveform color
self.audioPlot.color = [NSColor colorWithCalibratedRed: 1.000 green: 1.000 blue: 1.000 alpha: 1];
// Plot type
self.audioPlot.plotType = EZPlotTypeBuffer;
/*
Start the microphone
*/
[self.microphone startFetchingAudio];
//------------------------------------------------------------------------------
- (void)awakeFromNib
{
//
// Customizing the audio plot's look
//
// Background color
self.audioPlot.backgroundColor = [NSColor colorWithCalibratedRed: 0.569 green: 0.82 blue: 0.478 alpha: 1];
// Waveform color
self.audioPlot.color = [NSColor colorWithCalibratedRed: 1.000 green: 1.000 blue: 1.000 alpha: 1];
// Plot type
self.audioPlot.plotType = EZPlotTypeBuffer;
//
// Create the microphone
//
self.microphone = [EZMicrophone microphoneWithDelegate:self];
//
// Start the microphone
//
[self.microphone startFetchingAudio];
}
//------------------------------------------------------------------------------
#pragma mark - Setup
//------------------------------------------------------------------------------
- (void) reloadMicrophoneInputPopUpButtonMenu
{
NSArray *inputDevices = [EZAudioDevice inputDevices];
NSMenu *menu = [[NSMenu alloc] init];
NSMenuItem *defaultInputMenuItem;
for (EZAudioDevice *device in inputDevices)
{
NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:device.name
action:@selector(changedInput:)
keyEquivalent:@""];
item.representedObject = device;
item.target = self;
[menu addItem:item];
// If this device is the same one the microphone is using then
// we will use this menu item as the currently selected item
// in the microphone input popup button's list of items. For instance,
// if you are connected to an external display by default the external
// display's microphone might be used instead of the mac's built in
// mic.
if ([device isEqual:self.microphone.device])
{
defaultInputMenuItem = item;
}
}
self.microphoneInputPopUpButton.menu = menu;
//
// Set the selected device to the current selection on the
// microphone input popup button
//
[self.microphoneInputPopUpButton selectItem:defaultInputMenuItem];
}
//------------------------------------------------------------------------------
- (void) reloadMicrophoneInputChannelPopUpButtonMenu
{
NSMenu *menu = [[NSMenu alloc] init];
for (int i = 0; i < self.microphone.device.inputChannelCount; i++)
{
NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:@(i).stringValue
action:@selector(changedInputChannel:)
keyEquivalent:@""];
item.representedObject = @(i);
item.target = self;
[menu addItem:item];
}
self.microphoneInputChannelPopUpButton.menu = menu;
[self.microphoneInputChannelPopUpButton selectItemAtIndex:0];
}
//------------------------------------------------------------------------------
#pragma mark - Actions
-(void)changePlotType:(id)sender {
NSInteger selectedSegment = [sender selectedSegment];
switch(selectedSegment){
case 0:
[self drawBufferPlot];
break;
case 1:
[self drawRollingPlot];
break;
default:
break;
}
//------------------------------------------------------------------------------
- (void)changedInput:(id)sender
{
EZAudioDevice *device = [sender representedObject];
[self.microphone setDevice:device];
}
-(void)toggleMicrophone:(id)sender {
switch([sender state]){
case NSOffState:
[self.microphone stopFetchingAudio];
break;
case NSOnState:
[self.microphone startFetchingAudio];
break;
default:
break;
}
//------------------------------------------------------------------------------
- (void)changePlotType:(id)sender
{
NSInteger selectedSegment = [sender selectedSegment];
switch(selectedSegment)
{
case 0:
[self drawBufferPlot];
break;
case 1:
[self drawRollingPlot];
break;
default:
break;
}
}
//------------------------------------------------------------------------------
- (void)toggleMicrophone:(id)sender
{
switch([sender state])
{
case NSOffState:
[self.microphone stopFetchingAudio];
break;
case NSOnState:
[self.microphone startFetchingAudio];
break;
default:
break;
}
}
//------------------------------------------------------------------------------
#pragma mark - Action Extensions
/*
Give the visualization of the current buffer (this is almost exactly the openFrameworks audio input eample)
*/
-(void)drawBufferPlot {
// Change the plot type to the buffer plot
self.audioPlot.plotType = EZPlotTypeBuffer;
// Don't mirror over the x-axis
self.audioPlot.shouldMirror = NO;
// Don't fill
self.audioPlot.shouldFill = NO;
//------------------------------------------------------------------------------
//
// Give the visualization of the current buffer (this is almost exactly the openFrameworks audio input example)
//
- (void)drawBufferPlot
{
self.audioPlot.plotType = EZPlotTypeBuffer;
self.audioPlot.shouldMirror = NO;
self.audioPlot.shouldFill = NO;
}
/*
Give the classic mirrored, rolling waveform look
*/
-(void)drawRollingPlot {
self.audioPlot.plotType = EZPlotTypeRolling;
self.audioPlot.shouldFill = YES;
self.audioPlot.shouldMirror = YES;
//------------------------------------------------------------------------------
//
// Give the classic mirrored, rolling waveform look
//
- (void)drawRollingPlot
{
self.audioPlot.plotType = EZPlotTypeRolling;
self.audioPlot.shouldFill = YES;
self.audioPlot.shouldMirror = YES;
}
//------------------------------------------------------------------------------
#pragma mark - EZMicrophoneDelegate
//------------------------------------------------------------------------------
#warning Thread Safety
// Note that any callback that provides streamed audio data (like streaming microphone input) happens on a separate audio thread that should not be blocked. When we feed audio data into any of the UI components we need to explicity create a GCD block on the main thread to properly get the UI to work.
-(void)microphone:(EZMicrophone *)microphone
hasAudioReceived:(float **)buffer
withBufferSize:(UInt32)bufferSize
withNumberOfChannels:(UInt32)numberOfChannels {
// Getting audio data as an array of float buffer arrays. What does that mean? Because the audio is coming in as a stereo signal the data is split into a left and right channel. So buffer[0] corresponds to the float* data for the left channel while buffer[1] corresponds to the float* data for the right channel.
// See the Thread Safety warning above, but in a nutshell these callbacks happen on a separate audio thread. We wrap any UI updating in a GCD block on the main thread to avoid blocking that audio flow.
dispatch_async(dispatch_get_main_queue(),^{
- (void)microphone:(EZMicrophone *)microphone
hasAudioReceived:(float **)buffer
withBufferSize:(UInt32)bufferSize
withNumberOfChannels:(UInt32)numberOfChannels
{
// See the Thread Safety warning above, but in a nutshell these callbacks happen on a separate audio thread. We wrap any UI updating in a GCD block on the main thread to avoid blocking that audio flow.
__weak typeof(self) weakSelf = self;
dispatch_async(dispatch_get_main_queue(),^{
// All the audio plot needs is the buffer data (float*) and the size. Internally the audio plot will handle all the drawing related code, history management, and freeing its own resources. Hence, one badass line of code gets you a pretty plot :)
[self.audioPlot updateBuffer:buffer[0] withBufferSize:bufferSize];
});
NSInteger channel = [weakSelf.microphoneInputChannelPopUpButton indexOfSelectedItem];
[weakSelf.audioPlot updateBuffer:buffer[channel] withBufferSize:bufferSize];
});
}
-(void)microphone:(EZMicrophone *)microphone hasAudioStreamBasicDescription:(AudioStreamBasicDescription)audioStreamBasicDescription {
// The AudioStreamBasicDescription of the microphone stream. This is useful when configuring the EZRecorder or telling another component what audio format type to expect.
// Here's a print function to allow you to inspect it a little easier
// [EZAudio printASBD:audioStreamBasicDescription];
//------------------------------------------------------------------------------
- (void)microphone:(EZMicrophone *)microphone hasAudioStreamBasicDescription:(AudioStreamBasicDescription)audioStreamBasicDescription
{
// The AudioStreamBasicDescription of the microphone stream. This is useful when configuring the EZRecorder or telling another component what audio format type to expect.
// Here's a print function to allow you to inspect it a little easier
[EZAudioUtilities printASBD:audioStreamBasicDescription];
}
-(void)microphone:(EZMicrophone *)microphone
hasBufferList:(AudioBufferList *)bufferList
withBufferSize:(UInt32)bufferSize
withNumberOfChannels:(UInt32)numberOfChannels {
// Getting audio data as a buffer list that can be directly fed into the EZRecorder or EZOutput. Say whattt...
//------------------------------------------------------------------------------
- (void)microphone:(EZMicrophone *)microphone
hasBufferList:(AudioBufferList *)bufferList
withBufferSize:(UInt32)bufferSize
withNumberOfChannels:(UInt32)numberOfChannels
{
// Getting audio data as a buffer list that can be directly fed into the EZRecorder or EZOutput. Say whattt...
}
//------------------------------------------------------------------------------
- (void)microphone:(EZMicrophone *)microphone
changedDevice:(EZAudioDevice *)device
{
dispatch_async(dispatch_get_main_queue(), ^{
//
// Set up the microphone input popup button's items to select
// between different microphone inputs
//
[self reloadMicrophoneInputPopUpButtonMenu];
//
// Set up the microphone input popup button's items to select
// between different microphone input channels
//
[self reloadMicrophoneInputChannelPopUpButtonMenu];
});
}
//------------------------------------------------------------------------------
@end
@@ -1,44 +1,40 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6185.11" systemVersion="13E28" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="7702" systemVersion="14C109" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment version="1070" identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6185.11"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="7702"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="OpenGLWaveformViewController">
<connections>
<outlet property="audioPlot" destination="sjT-Ri-IOJ" id="Wf8-PJ-0mY"/>
<outlet property="view" destination="Zy4-iU-8jm" id="Plx-tA-1tK"/>
<outlet property="audioPlot" destination="foT-nv-032" id="Baw-Le-z98"/>
<outlet property="microphoneInputChannelPopUpButton" destination="Usd-lp-n8s" id="FbQ-hj-24k"/>
<outlet property="microphoneInputPopUpButton" destination="wBG-jf-wVy" id="thS-Ur-IMj"/>
<outlet property="view" destination="hFn-jA-9Se" id="cfu-I4-qhQ"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customView id="Zy4-iU-8jm">
<customView id="hFn-jA-9Se">
<rect key="frame" x="0.0" y="0.0" width="480" height="272"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="sjT-Ri-IOJ" customClass="EZAudioPlotGL">
<rect key="frame" x="0.0" y="42" width="480" height="230"/>
</customView>
<button translatesAutoresizingMaskIntoConstraints="NO" id="0kM-1N-88d">
<rect key="frame" x="18" y="14" width="119" height="18"/>
<button translatesAutoresizingMaskIntoConstraints="NO" id="TbW-ha-PgJ">
<rect key="frame" x="339" y="44" width="123" height="18"/>
<constraints>
<constraint firstAttribute="height" constant="14" id="Da9-ZF-OaJ"/>
<constraint firstAttribute="width" constant="119" id="xPL-Un-c5O"/>
</constraints>
<buttonCell key="cell" type="check" title="Microphone On" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="2YD-1T-DAq">
<buttonCell key="cell" type="check" title="Microphone On" bezelStyle="regularSquare" imagePosition="right" state="on" inset="2" id="DaM-FV-gba">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="toggleMicrophone:" target="-2" id="jZt-bz-cRP"/>
<action selector="toggleMicrophone:" target="-2" id="Zb5-tE-lf2"/>
</connections>
</button>
<segmentedControl verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="M6h-53-a8o">
<rect key="frame" x="333" y="11" width="129" height="24"/>
<constraints>
<constraint firstAttribute="height" constant="21" id="a5H-w4-lUa"/>
</constraints>
<segmentedCell key="cell" borderStyle="border" alignment="left" style="rounded" trackingMode="selectOne" id="NWl-cZ-1Qx">
<segmentedControl verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="UPI-59-15v">
<rect key="frame" x="335" y="15" width="127" height="24"/>
<segmentedCell key="cell" borderStyle="border" alignment="left" style="rounded" trackingMode="selectOne" id="VRd-fb-9nH">
<font key="font" metaFont="system"/>
<segments>
<segment label="Buffer" selected="YES"/>
@@ -46,20 +42,81 @@
</segments>
</segmentedCell>
<connections>
<action selector="changePlotType:" target="-2" id="gyT-zv-Y88"/>
<action selector="changePlotType:" target="-2" id="BMJ-vA-3ce"/>
</connections>
</segmentedControl>
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="wBG-jf-wVy" userLabel="microphoneInputPopUpButton">
<rect key="frame" x="18" y="14" width="180" height="26"/>
<constraints>
<constraint firstAttribute="width" constant="175" id="aMw-9p-rHt"/>
</constraints>
<popUpButtonCell key="cell" type="push" title="Item 1" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="cAL-rs-h1w" id="H5k-ea-wV5">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
<menu key="menu" id="15c-sS-jR2">
<items>
<menuItem title="Item 1" state="on" id="cAL-rs-h1w"/>
<menuItem title="Item 2" id="LTz-i3-N0M"/>
<menuItem title="Item 3" id="twD-3N-rcl"/>
</items>
</menu>
</popUpButtonCell>
</popUpButton>
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Usd-lp-n8s" userLabel="microphoneInputChannelPopUpButton">
<rect key="frame" x="204" y="14" width="79" height="26"/>
<constraints>
<constraint firstAttribute="width" constant="74" id="oDB-ke-aGz"/>
</constraints>
<popUpButtonCell key="cell" type="push" title="1" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="Oit-zz-O9w" id="Eyb-QQ-0bg">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="menu"/>
<menu key="menu" id="IPB-NH-My1">
<items>
<menuItem title="1" state="on" id="Oit-zz-O9w"/>
<menuItem title="Item 2" id="v3y-Nn-80j"/>
<menuItem title="Item 3" id="IHk-VR-fPC"/>
</items>
</menu>
</popUpButtonCell>
</popUpButton>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="AuX-d2-dD9">
<rect key="frame" x="18" y="43" width="31" height="14"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Input" id="Fq3-tX-8aU">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="PMV-Zt-Wg6">
<rect key="frame" x="204" y="43" width="48" height="14"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Channel" id="PTE-g2-mTV">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="foT-nv-032" customClass="EZAudioPlotGL">
<rect key="frame" x="0.0" y="77" width="480" height="195"/>
</customView>
</subviews>
<constraints>
<constraint firstAttribute="trailing" secondItem="sjT-Ri-IOJ" secondAttribute="trailing" id="6Up-ZF-7DX"/>
<constraint firstAttribute="trailing" secondItem="M6h-53-a8o" secondAttribute="trailing" constant="20" id="HMG-wO-794"/>
<constraint firstItem="0kM-1N-88d" firstAttribute="top" secondItem="sjT-Ri-IOJ" secondAttribute="bottom" constant="12" id="OKD-YZ-l6b"/>
<constraint firstItem="sjT-Ri-IOJ" firstAttribute="leading" secondItem="Zy4-iU-8jm" secondAttribute="leading" id="cCR-2i-qMC"/>
<constraint firstItem="sjT-Ri-IOJ" firstAttribute="top" secondItem="Zy4-iU-8jm" secondAttribute="top" id="eCi-yv-OES"/>
<constraint firstItem="0kM-1N-88d" firstAttribute="leading" secondItem="Zy4-iU-8jm" secondAttribute="leading" constant="20" id="eGv-dK-bH8"/>
<constraint firstAttribute="bottom" secondItem="M6h-53-a8o" secondAttribute="bottom" constant="13" id="mLO-CB-wrB"/>
<constraint firstItem="M6h-53-a8o" firstAttribute="top" secondItem="sjT-Ri-IOJ" secondAttribute="bottom" constant="8" id="od9-ut-rVh"/>
<constraint firstAttribute="bottom" secondItem="0kM-1N-88d" secondAttribute="bottom" constant="16" id="opv-CP-vhv"/>
<constraint firstAttribute="bottom" secondItem="wBG-jf-wVy" secondAttribute="bottom" constant="17" id="39Q-dq-Ifx"/>
<constraint firstAttribute="trailing" secondItem="foT-nv-032" secondAttribute="trailing" id="4QC-HO-oMa"/>
<constraint firstItem="foT-nv-032" firstAttribute="top" secondItem="hFn-jA-9Se" secondAttribute="top" id="5zo-Yc-OKX"/>
<constraint firstItem="UPI-59-15v" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Usd-lp-n8s" secondAttribute="trailing" constant="11" id="AXw-KY-VEi"/>
<constraint firstItem="Usd-lp-n8s" firstAttribute="top" secondItem="PMV-Zt-Wg6" secondAttribute="bottom" constant="5" id="GZn-x5-gDa"/>
<constraint firstAttribute="trailing" secondItem="UPI-59-15v" secondAttribute="trailing" constant="20" id="Ihi-YB-8cN"/>
<constraint firstItem="AuX-d2-dD9" firstAttribute="leading" secondItem="hFn-jA-9Se" secondAttribute="leading" constant="20" id="RFU-gK-hRd"/>
<constraint firstItem="TbW-ha-PgJ" firstAttribute="top" secondItem="foT-nv-032" secondAttribute="bottom" constant="17" id="aWO-qE-S52"/>
<constraint firstAttribute="bottom" secondItem="UPI-59-15v" secondAttribute="bottom" constant="17" id="biy-0r-WsW"/>
<constraint firstItem="wBG-jf-wVy" firstAttribute="top" secondItem="AuX-d2-dD9" secondAttribute="bottom" constant="5" id="fEE-bx-NVl"/>
<constraint firstItem="UPI-59-15v" firstAttribute="top" secondItem="TbW-ha-PgJ" secondAttribute="bottom" constant="8" id="gMX-Q1-9Ly"/>
<constraint firstAttribute="trailing" secondItem="TbW-ha-PgJ" secondAttribute="trailing" constant="20" id="gek-Wl-IPz"/>
<constraint firstItem="Usd-lp-n8s" firstAttribute="leading" secondItem="wBG-jf-wVy" secondAttribute="trailing" constant="11" id="gqi-4E-1Wf"/>
<constraint firstItem="Usd-lp-n8s" firstAttribute="leading" secondItem="PMV-Zt-Wg6" secondAttribute="leading" id="lT3-RX-en8"/>
<constraint firstItem="foT-nv-032" firstAttribute="leading" secondItem="hFn-jA-9Se" secondAttribute="leading" id="o4A-j4-xiR"/>
<constraint firstItem="wBG-jf-wVy" firstAttribute="leading" secondItem="hFn-jA-9Se" secondAttribute="leading" constant="20" id="uyC-v9-bP1"/>
<constraint firstAttribute="bottom" secondItem="Usd-lp-n8s" secondAttribute="bottom" constant="17" id="yk6-Fm-gXu"/>
</constraints>
</customView>
</objects>
@@ -7,19 +7,24 @@
objects = {
/* Begin PBXBuildFile section */
9417A7B31867DD6600D9D37B /* AEFloatConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A79B1867DD6600D9D37B /* AEFloatConverter.m */; };
9417A7B41867DD6600D9D37B /* EZAudio.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A79D1867DD6600D9D37B /* EZAudio.m */; };
9417A7B51867DD6600D9D37B /* EZAudioFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A79F1867DD6600D9D37B /* EZAudioFile.m */; };
9417A7B61867DD6600D9D37B /* EZAudioPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7A11867DD6600D9D37B /* EZAudioPlot.m */; };
9417A7B71867DD6600D9D37B /* EZAudioPlotGL.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7A31867DD6600D9D37B /* EZAudioPlotGL.m */; };
9417A7B81867DD6600D9D37B /* EZAudioPlotGLKViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7A51867DD6600D9D37B /* EZAudioPlotGLKViewController.m */; };
9417A7B91867DD6600D9D37B /* EZMicrophone.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7A71867DD6600D9D37B /* EZMicrophone.m */; };
9417A7BA1867DD6600D9D37B /* EZOutput.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7A91867DD6600D9D37B /* EZOutput.m */; };
9417A7BB1867DD6600D9D37B /* EZPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7AB1867DD6600D9D37B /* EZPlot.m */; };
9417A7BC1867DD6600D9D37B /* EZRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7AD1867DD6600D9D37B /* EZRecorder.m */; };
9417A7BD1867DD6600D9D37B /* TPCircularBuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7AE1867DD6600D9D37B /* TPCircularBuffer.c */; };
9417A7BE1867DD6600D9D37B /* CHANGELOG in Resources */ = {isa = PBXBuildFile; fileRef = 9417A7B11867DD6600D9D37B /* CHANGELOG */; };
9417A7BF1867DD6600D9D37B /* VERSION in Resources */ = {isa = PBXBuildFile; fileRef = 9417A7B21867DD6600D9D37B /* VERSION */; };
6628E2901B3A1CCA00020E56 /* AEFloatConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E26E1B3A1CCA00020E56 /* AEFloatConverter.m */; };
6628E2911B3A1CCA00020E56 /* EZAudio.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E2701B3A1CCA00020E56 /* EZAudio.m */; };
6628E2921B3A1CCA00020E56 /* EZAudioDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E2721B3A1CCA00020E56 /* EZAudioDevice.m */; };
6628E2931B3A1CCA00020E56 /* EZAudioFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E2741B3A1CCA00020E56 /* EZAudioFile.m */; };
6628E2941B3A1CCA00020E56 /* EZAudioFloatConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E2761B3A1CCA00020E56 /* EZAudioFloatConverter.m */; };
6628E2951B3A1CCA00020E56 /* EZAudioFloatData.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E2781B3A1CCA00020E56 /* EZAudioFloatData.m */; };
6628E2961B3A1CCA00020E56 /* EZAudioPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E27A1B3A1CCA00020E56 /* EZAudioPlayer.m */; };
6628E2971B3A1CCA00020E56 /* EZAudioPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E27C1B3A1CCA00020E56 /* EZAudioPlot.m */; };
6628E2981B3A1CCA00020E56 /* EZAudioPlotGL.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E27E1B3A1CCA00020E56 /* EZAudioPlotGL.m */; };
6628E2991B3A1CCA00020E56 /* EZAudioPlotGLKViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E2801B3A1CCA00020E56 /* EZAudioPlotGLKViewController.m */; };
6628E29A1B3A1CCA00020E56 /* EZAudioUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E2821B3A1CCA00020E56 /* EZAudioUtilities.m */; };
6628E29B1B3A1CCA00020E56 /* EZMicrophone.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E2841B3A1CCA00020E56 /* EZMicrophone.m */; };
6628E29C1B3A1CCA00020E56 /* EZOutput.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E2861B3A1CCA00020E56 /* EZOutput.m */; };
6628E29D1B3A1CCA00020E56 /* EZPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E2881B3A1CCA00020E56 /* EZPlot.m */; };
6628E29E1B3A1CCA00020E56 /* EZRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E28A1B3A1CCA00020E56 /* EZRecorder.m */; };
6628E29F1B3A1CCA00020E56 /* TPCircularBuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 6628E28B1B3A1CCA00020E56 /* TPCircularBuffer.c */; };
6628E2A01B3A1CCA00020E56 /* CHANGELOG in Resources */ = {isa = PBXBuildFile; fileRef = 6628E28E1B3A1CCA00020E56 /* CHANGELOG */; };
6628E2A11B3A1CCA00020E56 /* VERSION in Resources */ = {isa = PBXBuildFile; fileRef = 6628E28F1B3A1CCA00020E56 /* VERSION */; };
941D71B81864C457007D52D8 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 941D71B71864C457007D52D8 /* Cocoa.framework */; };
941D71C21864C457007D52D8 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 941D71C01864C457007D52D8 /* InfoPlist.strings */; };
941D71C41864C457007D52D8 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 941D71C31864C457007D52D8 /* main.m */; };
@@ -52,30 +57,40 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
9417A79A1867DD6600D9D37B /* AEFloatConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AEFloatConverter.h; sourceTree = "<group>"; };
9417A79B1867DD6600D9D37B /* AEFloatConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AEFloatConverter.m; sourceTree = "<group>"; };
9417A79C1867DD6600D9D37B /* EZAudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudio.h; sourceTree = "<group>"; };
9417A79D1867DD6600D9D37B /* EZAudio.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudio.m; sourceTree = "<group>"; };
9417A79E1867DD6600D9D37B /* EZAudioFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFile.h; sourceTree = "<group>"; };
9417A79F1867DD6600D9D37B /* EZAudioFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFile.m; sourceTree = "<group>"; };
9417A7A01867DD6600D9D37B /* EZAudioPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlot.h; sourceTree = "<group>"; };
9417A7A11867DD6600D9D37B /* EZAudioPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlot.m; sourceTree = "<group>"; };
9417A7A21867DD6600D9D37B /* EZAudioPlotGL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGL.h; sourceTree = "<group>"; };
9417A7A31867DD6600D9D37B /* EZAudioPlotGL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGL.m; sourceTree = "<group>"; };
9417A7A41867DD6600D9D37B /* EZAudioPlotGLKViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGLKViewController.h; sourceTree = "<group>"; };
9417A7A51867DD6600D9D37B /* EZAudioPlotGLKViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGLKViewController.m; sourceTree = "<group>"; };
9417A7A61867DD6600D9D37B /* EZMicrophone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZMicrophone.h; sourceTree = "<group>"; };
9417A7A71867DD6600D9D37B /* EZMicrophone.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZMicrophone.m; sourceTree = "<group>"; };
9417A7A81867DD6600D9D37B /* EZOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZOutput.h; sourceTree = "<group>"; };
9417A7A91867DD6600D9D37B /* EZOutput.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZOutput.m; sourceTree = "<group>"; };
9417A7AA1867DD6600D9D37B /* EZPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZPlot.h; sourceTree = "<group>"; };
9417A7AB1867DD6600D9D37B /* EZPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZPlot.m; sourceTree = "<group>"; };
9417A7AC1867DD6600D9D37B /* EZRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZRecorder.h; sourceTree = "<group>"; };
9417A7AD1867DD6600D9D37B /* EZRecorder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZRecorder.m; sourceTree = "<group>"; };
9417A7AE1867DD6600D9D37B /* TPCircularBuffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = TPCircularBuffer.c; sourceTree = "<group>"; };
9417A7AF1867DD6600D9D37B /* TPCircularBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TPCircularBuffer.h; sourceTree = "<group>"; };
9417A7B11867DD6600D9D37B /* CHANGELOG */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CHANGELOG; sourceTree = "<group>"; };
9417A7B21867DD6600D9D37B /* VERSION */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VERSION; sourceTree = "<group>"; };
6628E26D1B3A1CCA00020E56 /* AEFloatConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AEFloatConverter.h; sourceTree = "<group>"; };
6628E26E1B3A1CCA00020E56 /* AEFloatConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AEFloatConverter.m; sourceTree = "<group>"; };
6628E26F1B3A1CCA00020E56 /* EZAudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudio.h; sourceTree = "<group>"; };
6628E2701B3A1CCA00020E56 /* EZAudio.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudio.m; sourceTree = "<group>"; };
6628E2711B3A1CCA00020E56 /* EZAudioDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioDevice.h; sourceTree = "<group>"; };
6628E2721B3A1CCA00020E56 /* EZAudioDevice.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioDevice.m; sourceTree = "<group>"; };
6628E2731B3A1CCA00020E56 /* EZAudioFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFile.h; sourceTree = "<group>"; };
6628E2741B3A1CCA00020E56 /* EZAudioFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFile.m; sourceTree = "<group>"; };
6628E2751B3A1CCA00020E56 /* EZAudioFloatConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFloatConverter.h; sourceTree = "<group>"; };
6628E2761B3A1CCA00020E56 /* EZAudioFloatConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFloatConverter.m; sourceTree = "<group>"; };
6628E2771B3A1CCA00020E56 /* EZAudioFloatData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFloatData.h; sourceTree = "<group>"; };
6628E2781B3A1CCA00020E56 /* EZAudioFloatData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFloatData.m; sourceTree = "<group>"; };
6628E2791B3A1CCA00020E56 /* EZAudioPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlayer.h; sourceTree = "<group>"; };
6628E27A1B3A1CCA00020E56 /* EZAudioPlayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlayer.m; sourceTree = "<group>"; };
6628E27B1B3A1CCA00020E56 /* EZAudioPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlot.h; sourceTree = "<group>"; };
6628E27C1B3A1CCA00020E56 /* EZAudioPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlot.m; sourceTree = "<group>"; };
6628E27D1B3A1CCA00020E56 /* EZAudioPlotGL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGL.h; sourceTree = "<group>"; };
6628E27E1B3A1CCA00020E56 /* EZAudioPlotGL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGL.m; sourceTree = "<group>"; };
6628E27F1B3A1CCA00020E56 /* EZAudioPlotGLKViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGLKViewController.h; sourceTree = "<group>"; };
6628E2801B3A1CCA00020E56 /* EZAudioPlotGLKViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGLKViewController.m; sourceTree = "<group>"; };
6628E2811B3A1CCA00020E56 /* EZAudioUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioUtilities.h; sourceTree = "<group>"; };
6628E2821B3A1CCA00020E56 /* EZAudioUtilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioUtilities.m; sourceTree = "<group>"; };
6628E2831B3A1CCA00020E56 /* EZMicrophone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZMicrophone.h; sourceTree = "<group>"; };
6628E2841B3A1CCA00020E56 /* EZMicrophone.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZMicrophone.m; sourceTree = "<group>"; };
6628E2851B3A1CCA00020E56 /* EZOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZOutput.h; sourceTree = "<group>"; };
6628E2861B3A1CCA00020E56 /* EZOutput.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZOutput.m; sourceTree = "<group>"; };
6628E2871B3A1CCA00020E56 /* EZPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZPlot.h; sourceTree = "<group>"; };
6628E2881B3A1CCA00020E56 /* EZPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZPlot.m; sourceTree = "<group>"; };
6628E2891B3A1CCA00020E56 /* EZRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZRecorder.h; sourceTree = "<group>"; };
6628E28A1B3A1CCA00020E56 /* EZRecorder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZRecorder.m; sourceTree = "<group>"; };
6628E28B1B3A1CCA00020E56 /* TPCircularBuffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = TPCircularBuffer.c; sourceTree = "<group>"; };
6628E28C1B3A1CCA00020E56 /* TPCircularBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TPCircularBuffer.h; sourceTree = "<group>"; };
6628E28E1B3A1CCA00020E56 /* CHANGELOG */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CHANGELOG; sourceTree = "<group>"; };
6628E28F1B3A1CCA00020E56 /* VERSION */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VERSION; sourceTree = "<group>"; };
941D71B41864C457007D52D8 /* EZAudioPassThroughExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = EZAudioPassThroughExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
941D71B71864C457007D52D8 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
941D71BA1864C457007D52D8 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
@@ -133,42 +148,52 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
9417A7991867DD6600D9D37B /* EZAudio */ = {
6628E26C1B3A1CCA00020E56 /* EZAudio */ = {
isa = PBXGroup;
children = (
9417A79A1867DD6600D9D37B /* AEFloatConverter.h */,
9417A79B1867DD6600D9D37B /* AEFloatConverter.m */,
9417A79C1867DD6600D9D37B /* EZAudio.h */,
9417A79D1867DD6600D9D37B /* EZAudio.m */,
9417A79E1867DD6600D9D37B /* EZAudioFile.h */,
9417A79F1867DD6600D9D37B /* EZAudioFile.m */,
9417A7A01867DD6600D9D37B /* EZAudioPlot.h */,
9417A7A11867DD6600D9D37B /* EZAudioPlot.m */,
9417A7A21867DD6600D9D37B /* EZAudioPlotGL.h */,
9417A7A31867DD6600D9D37B /* EZAudioPlotGL.m */,
9417A7A41867DD6600D9D37B /* EZAudioPlotGLKViewController.h */,
9417A7A51867DD6600D9D37B /* EZAudioPlotGLKViewController.m */,
9417A7A61867DD6600D9D37B /* EZMicrophone.h */,
9417A7A71867DD6600D9D37B /* EZMicrophone.m */,
9417A7A81867DD6600D9D37B /* EZOutput.h */,
9417A7A91867DD6600D9D37B /* EZOutput.m */,
9417A7AA1867DD6600D9D37B /* EZPlot.h */,
9417A7AB1867DD6600D9D37B /* EZPlot.m */,
9417A7AC1867DD6600D9D37B /* EZRecorder.h */,
9417A7AD1867DD6600D9D37B /* EZRecorder.m */,
9417A7AE1867DD6600D9D37B /* TPCircularBuffer.c */,
9417A7AF1867DD6600D9D37B /* TPCircularBuffer.h */,
9417A7B01867DD6600D9D37B /* VERSION */,
6628E26D1B3A1CCA00020E56 /* AEFloatConverter.h */,
6628E26E1B3A1CCA00020E56 /* AEFloatConverter.m */,
6628E26F1B3A1CCA00020E56 /* EZAudio.h */,
6628E2701B3A1CCA00020E56 /* EZAudio.m */,
6628E2711B3A1CCA00020E56 /* EZAudioDevice.h */,
6628E2721B3A1CCA00020E56 /* EZAudioDevice.m */,
6628E2731B3A1CCA00020E56 /* EZAudioFile.h */,
6628E2741B3A1CCA00020E56 /* EZAudioFile.m */,
6628E2751B3A1CCA00020E56 /* EZAudioFloatConverter.h */,
6628E2761B3A1CCA00020E56 /* EZAudioFloatConverter.m */,
6628E2771B3A1CCA00020E56 /* EZAudioFloatData.h */,
6628E2781B3A1CCA00020E56 /* EZAudioFloatData.m */,
6628E2791B3A1CCA00020E56 /* EZAudioPlayer.h */,
6628E27A1B3A1CCA00020E56 /* EZAudioPlayer.m */,
6628E27B1B3A1CCA00020E56 /* EZAudioPlot.h */,
6628E27C1B3A1CCA00020E56 /* EZAudioPlot.m */,
6628E27D1B3A1CCA00020E56 /* EZAudioPlotGL.h */,
6628E27E1B3A1CCA00020E56 /* EZAudioPlotGL.m */,
6628E27F1B3A1CCA00020E56 /* EZAudioPlotGLKViewController.h */,
6628E2801B3A1CCA00020E56 /* EZAudioPlotGLKViewController.m */,
6628E2811B3A1CCA00020E56 /* EZAudioUtilities.h */,
6628E2821B3A1CCA00020E56 /* EZAudioUtilities.m */,
6628E2831B3A1CCA00020E56 /* EZMicrophone.h */,
6628E2841B3A1CCA00020E56 /* EZMicrophone.m */,
6628E2851B3A1CCA00020E56 /* EZOutput.h */,
6628E2861B3A1CCA00020E56 /* EZOutput.m */,
6628E2871B3A1CCA00020E56 /* EZPlot.h */,
6628E2881B3A1CCA00020E56 /* EZPlot.m */,
6628E2891B3A1CCA00020E56 /* EZRecorder.h */,
6628E28A1B3A1CCA00020E56 /* EZRecorder.m */,
6628E28B1B3A1CCA00020E56 /* TPCircularBuffer.c */,
6628E28C1B3A1CCA00020E56 /* TPCircularBuffer.h */,
6628E28D1B3A1CCA00020E56 /* VERSION */,
);
name = EZAudio;
path = ../../../../EZAudio;
sourceTree = "<group>";
};
9417A7B01867DD6600D9D37B /* VERSION */ = {
6628E28D1B3A1CCA00020E56 /* VERSION */ = {
isa = PBXGroup;
children = (
9417A7B11867DD6600D9D37B /* CHANGELOG */,
9417A7B21867DD6600D9D37B /* VERSION */,
6628E28E1B3A1CCA00020E56 /* CHANGELOG */,
6628E28F1B3A1CCA00020E56 /* VERSION */,
);
path = VERSION;
sourceTree = "<group>";
@@ -221,7 +246,7 @@
941D71BD1864C457007D52D8 /* EZAudioPassThroughExample */ = {
isa = PBXGroup;
children = (
9417A7991867DD6600D9D37B /* EZAudio */,
6628E26C1B3A1CCA00020E56 /* EZAudio */,
941D71C91864C457007D52D8 /* AppDelegate.h */,
941D71CA1864C457007D52D8 /* AppDelegate.m */,
941D721E1864C4D7007D52D8 /* PassThroughViewController.h */,
@@ -341,12 +366,12 @@
buildActionMask = 2147483647;
files = (
941D72221864C4D7007D52D8 /* PassThroughViewController.xib in Resources */,
9417A7BF1867DD6600D9D37B /* VERSION in Resources */,
6628E2A11B3A1CCA00020E56 /* VERSION in Resources */,
941D71C21864C457007D52D8 /* InfoPlist.strings in Resources */,
941D71D01864C457007D52D8 /* Images.xcassets in Resources */,
941D71C81864C457007D52D8 /* Credits.rtf in Resources */,
941D71CE1864C457007D52D8 /* MainMenu.xib in Resources */,
9417A7BE1867DD6600D9D37B /* CHANGELOG in Resources */,
6628E2A01B3A1CCA00020E56 /* CHANGELOG in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -365,20 +390,25 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9417A7BD1867DD6600D9D37B /* TPCircularBuffer.c in Sources */,
9417A7BA1867DD6600D9D37B /* EZOutput.m in Sources */,
9417A7B81867DD6600D9D37B /* EZAudioPlotGLKViewController.m in Sources */,
6628E29E1B3A1CCA00020E56 /* EZRecorder.m in Sources */,
941D72211864C4D7007D52D8 /* PassThroughViewController.m in Sources */,
9417A7B31867DD6600D9D37B /* AEFloatConverter.m in Sources */,
6628E2941B3A1CCA00020E56 /* EZAudioFloatConverter.m in Sources */,
6628E2951B3A1CCA00020E56 /* EZAudioFloatData.m in Sources */,
6628E2901B3A1CCA00020E56 /* AEFloatConverter.m in Sources */,
6628E2931B3A1CCA00020E56 /* EZAudioFile.m in Sources */,
6628E29C1B3A1CCA00020E56 /* EZOutput.m in Sources */,
6628E2981B3A1CCA00020E56 /* EZAudioPlotGL.m in Sources */,
6628E29F1B3A1CCA00020E56 /* TPCircularBuffer.c in Sources */,
6628E2971B3A1CCA00020E56 /* EZAudioPlot.m in Sources */,
941D71CB1864C457007D52D8 /* AppDelegate.m in Sources */,
9417A7B61867DD6600D9D37B /* EZAudioPlot.m in Sources */,
9417A7B51867DD6600D9D37B /* EZAudioFile.m in Sources */,
9417A7B71867DD6600D9D37B /* EZAudioPlotGL.m in Sources */,
6628E29B1B3A1CCA00020E56 /* EZMicrophone.m in Sources */,
6628E2961B3A1CCA00020E56 /* EZAudioPlayer.m in Sources */,
6628E2921B3A1CCA00020E56 /* EZAudioDevice.m in Sources */,
941D71C41864C457007D52D8 /* main.m in Sources */,
9417A7BB1867DD6600D9D37B /* EZPlot.m in Sources */,
9417A7B91867DD6600D9D37B /* EZMicrophone.m in Sources */,
9417A7BC1867DD6600D9D37B /* EZRecorder.m in Sources */,
9417A7B41867DD6600D9D37B /* EZAudio.m in Sources */,
6628E29D1B3A1CCA00020E56 /* EZPlot.m in Sources */,
6628E2911B3A1CCA00020E56 /* EZAudio.m in Sources */,
6628E29A1B3A1CCA00020E56 /* EZAudioUtilities.m in Sources */,
6628E2991B3A1CCA00020E56 /* EZAudioPlotGLKViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -32,26 +32,31 @@
@interface PassThroughViewController : NSViewController <EZMicrophoneDelegate,EZOutputDataSource>
//------------------------------------------------------------------------------
#pragma mark - Components
//------------------------------------------------------------------------------
/**
The OpenGL based audio plot
*/
@property (nonatomic,weak) IBOutlet EZAudioPlotGL *audioPlot;
/**
The Microphone
*/
@property (nonatomic,strong) EZMicrophone *microphone;
//------------------------------------------------------------------------------
#pragma mark - Actions
//------------------------------------------------------------------------------
/**
Switches the plot drawing type between a buffer plot (visualizes the current stream of audio data from the update function) or a rolling plot (visualizes the audio data over time, this is the classic waveform look)
*/
-(IBAction)changePlotType:(id)sender;
//------------------------------------------------------------------------------
/**
Toggles the microphone on and off. When the microphone is on it will send its delegate (aka this view controller) the audio data in various ways (check out the EZMicrophoneDelegate documentation for more details);
*/
-(IBAction)toggleMicrophone:(id)sender;
//------------------------------------------------------------------------------
@end
@@ -25,155 +25,125 @@
#import "PassThroughViewController.h"
@interface PassThroughViewController (){
TPCircularBuffer _circularBuffer;
}
@end
@implementation PassThroughViewController
@synthesize audioPlot;
@synthesize microphone;
#pragma mark - Initialization
-(id)init {
self = [super initWithNibName:NSStringFromClass(self.class) bundle:nil];
if(self){
[self initializeView];
}
return self;
}
-(id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithNibName:NSStringFromClass(self.class) bundle:nil];
if(self){
[self initializeView];
}
return self;
}
-(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:NSStringFromClass(self.class) bundle:nil];
if(self){
[self initializeView];
}
return self;
}
-(void)initializeView {
/**
Initialize the circular buffer
*/
[EZAudio circularBuffer:&_circularBuffer withSize:2048];
}
//------------------------------------------------------------------------------
#pragma mark - Customize the Audio Plot
-(void)awakeFromNib {
/*
Customizing the audio plot's look
*/
// Background color
self.audioPlot.backgroundColor = [NSColor colorWithCalibratedRed: 0.569 green: 0.82 blue: 0.478 alpha: 1];
// Waveform color
self.audioPlot.color = [NSColor colorWithCalibratedRed: 1.000 green: 1.000 blue: 1.000 alpha: 1];
// Plot type
self.audioPlot.plotType = EZPlotTypeBuffer;
/*
Start the microphone
*/
[EZMicrophone sharedMicrophone].microphoneDelegate = self;
[[EZMicrophone sharedMicrophone] startFetchingAudio];
/**
Start the output
*/
[[EZOutput sharedOutput] setAudioStreamBasicDescription:[EZMicrophone sharedMicrophone].audioStreamBasicDescription];
[EZOutput sharedOutput].outputDataSource = self;
[[EZOutput sharedOutput] startPlayback];
//------------------------------------------------------------------------------
- (void)awakeFromNib
{
//
// Customizing the audio plot's look
//
// Background color
self.audioPlot.backgroundColor = [NSColor colorWithCalibratedRed: 0.569 green: 0.82 blue: 0.478 alpha: 1];
// Waveform color
self.audioPlot.color = [NSColor colorWithCalibratedRed: 1.000 green: 1.000 blue: 1.000 alpha: 1];
// Plot type
self.audioPlot.plotType = EZPlotTypeBuffer;
//
// Start the microphone
//
[EZMicrophone sharedMicrophone].delegate = self;
[[EZMicrophone sharedMicrophone] startFetchingAudio];
//
// Print out the input device being used
//
NSLog(@"Using input device: %@", [[EZMicrophone sharedMicrophone] device]);
//
// Use the microphone as the EZOutputDataSource
//
[[EZMicrophone sharedMicrophone] setOutput:[EZOutput sharedOutput]];
/**
Start the output
*/
[[EZOutput sharedOutput] startPlayback];
}
//------------------------------------------------------------------------------
#pragma mark - Actions
-(void)changePlotType:(id)sender {
NSInteger selectedSegment = [sender selectedSegment];
switch(selectedSegment){
case 0:
[self drawBufferPlot];
break;
case 1:
[self drawRollingPlot];
break;
default:
break;
}
//------------------------------------------------------------------------------
- (void)changePlotType:(id)sender
{
NSInteger selectedSegment = [sender selectedSegment];
switch(selectedSegment)
{
case 0:
[self drawBufferPlot];
break;
case 1:
[self drawRollingPlot];
break;
default:
break;
}
}
-(void)toggleMicrophone:(id)sender {
switch([sender state]){
case NSOffState:
[[EZMicrophone sharedMicrophone] stopFetchingAudio];
break;
case NSOnState:
[[EZMicrophone sharedMicrophone] startFetchingAudio];
break;
default:
break;
}
//------------------------------------------------------------------------------
- (void)toggleMicrophone:(id)sender
{
switch([sender state])
{
case NSOffState:
[[EZMicrophone sharedMicrophone] stopFetchingAudio];
break;
case NSOnState:
[[EZMicrophone sharedMicrophone] startFetchingAudio];
break;
default:
break;
}
}
//------------------------------------------------------------------------------
#pragma mark - Action Extensions
/*
Give the visualization of the current buffer (this is almost exactly the openFrameworks audio input eample)
*/
-(void)drawBufferPlot {
// Change the plot type to the buffer plot
self.audioPlot.plotType = EZPlotTypeBuffer;
// Don't mirror over the x-axis
self.audioPlot.shouldMirror = NO;
// Don't fill
self.audioPlot.shouldFill = NO;
//------------------------------------------------------------------------------
//
// Give the visualization of the current buffer (this is almost exactly the openFrameworks audio input example)
//
- (void)drawBufferPlot
{
self.audioPlot.plotType = EZPlotTypeBuffer;
self.audioPlot.shouldMirror = NO;
self.audioPlot.shouldFill = NO;
}
/*
Give the classic mirrored, rolling waveform look
*/
-(void)drawRollingPlot {
self.audioPlot.plotType = EZPlotTypeRolling;
self.audioPlot.shouldFill = YES;
self.audioPlot.shouldMirror = YES;
//------------------------------------------------------------------------------
//
// Give the classic mirrored, rolling waveform look
//
- (void)drawRollingPlot
{
self.audioPlot.plotType = EZPlotTypeRolling;
self.audioPlot.shouldFill = YES;
self.audioPlot.shouldMirror = YES;
}
//------------------------------------------------------------------------------
#pragma mark - EZMicrophoneDelegate
-(void)microphone:(EZMicrophone *)microphone
hasAudioReceived:(float **)buffer
withBufferSize:(UInt32)bufferSize
withNumberOfChannels:(UInt32)numberOfChannels {
dispatch_async(dispatch_get_main_queue(), ^{
[self.audioPlot updateBuffer:buffer[0] withBufferSize:bufferSize];
});
//------------------------------------------------------------------------------
-(void) microphone:(EZMicrophone *)microphone
hasAudioReceived:(float **)buffer
withBufferSize:(UInt32)bufferSize
withNumberOfChannels:(UInt32)numberOfChannels
{
__weak typeof (self) weakSelf = self;
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf.audioPlot updateBuffer:buffer[0]
withBufferSize:bufferSize];
});
}
// Append the AudioBufferList from the microphone callback to a global circular buffer
-(void)microphone:(EZMicrophone *)microphone
hasBufferList:(AudioBufferList *)bufferList
withBufferSize:(UInt32)bufferSize
withNumberOfChannels:(UInt32)numberOfChannels {
/**
Append the audio data to a circular buffer
*/
[EZAudio appendDataToCircularBuffer:&_circularBuffer
fromAudioBufferList:bufferList];
}
#pragma mark - EZOutputDataSource
-(TPCircularBuffer *)outputShouldUseCircularBuffer:(EZOutput *)output {
return [EZMicrophone sharedMicrophone].microphoneOn ? &_circularBuffer : nil;
}
#pragma mark - Cleanup
-(void)dealloc {
[EZAudio freeCircularBuffer:&_circularBuffer];
}
//------------------------------------------------------------------------------
@end
Binary file not shown.
@@ -7,6 +7,25 @@
objects = {
/* Begin PBXBuildFile section */
6628E2351B3A121A00020E56 /* simple-drum-beat.wav in Resources */ = {isa = PBXBuildFile; fileRef = 6628E2341B3A121A00020E56 /* simple-drum-beat.wav */; };
6659578A1B38B352003E97A1 /* AEFloatConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 665957681B38B352003E97A1 /* AEFloatConverter.m */; };
6659578B1B38B352003E97A1 /* EZAudio.m in Sources */ = {isa = PBXBuildFile; fileRef = 6659576A1B38B352003E97A1 /* EZAudio.m */; };
6659578C1B38B352003E97A1 /* EZAudioDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = 6659576C1B38B352003E97A1 /* EZAudioDevice.m */; };
6659578D1B38B352003E97A1 /* EZAudioFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 6659576E1B38B352003E97A1 /* EZAudioFile.m */; };
6659578E1B38B352003E97A1 /* EZAudioFloatConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 665957701B38B352003E97A1 /* EZAudioFloatConverter.m */; };
6659578F1B38B352003E97A1 /* EZAudioFloatData.m in Sources */ = {isa = PBXBuildFile; fileRef = 665957721B38B352003E97A1 /* EZAudioFloatData.m */; };
665957901B38B352003E97A1 /* EZAudioPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 665957741B38B352003E97A1 /* EZAudioPlayer.m */; };
665957911B38B352003E97A1 /* EZAudioPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 665957761B38B352003E97A1 /* EZAudioPlot.m */; };
665957921B38B352003E97A1 /* EZAudioPlotGL.m in Sources */ = {isa = PBXBuildFile; fileRef = 665957781B38B352003E97A1 /* EZAudioPlotGL.m */; };
665957931B38B352003E97A1 /* EZAudioPlotGLKViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6659577A1B38B352003E97A1 /* EZAudioPlotGLKViewController.m */; };
665957941B38B352003E97A1 /* EZAudioUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = 6659577C1B38B352003E97A1 /* EZAudioUtilities.m */; };
665957951B38B352003E97A1 /* EZMicrophone.m in Sources */ = {isa = PBXBuildFile; fileRef = 6659577E1B38B352003E97A1 /* EZMicrophone.m */; };
665957961B38B352003E97A1 /* EZOutput.m in Sources */ = {isa = PBXBuildFile; fileRef = 665957801B38B352003E97A1 /* EZOutput.m */; };
665957971B38B352003E97A1 /* EZPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 665957821B38B352003E97A1 /* EZPlot.m */; };
665957981B38B352003E97A1 /* EZRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 665957841B38B352003E97A1 /* EZRecorder.m */; };
665957991B38B352003E97A1 /* TPCircularBuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 665957851B38B352003E97A1 /* TPCircularBuffer.c */; };
6659579A1B38B352003E97A1 /* CHANGELOG in Resources */ = {isa = PBXBuildFile; fileRef = 665957881B38B352003E97A1 /* CHANGELOG */; };
6659579B1B38B352003E97A1 /* VERSION in Resources */ = {isa = PBXBuildFile; fileRef = 665957891B38B352003E97A1 /* VERSION */; };
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 */; };
@@ -26,20 +45,6 @@
94056F65185BDB4700EB94BA /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 94056F62185BDB4700EB94BA /* AudioToolbox.framework */; };
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 */; };
9417A7481867DD3400D9D37B /* TPCircularBuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7391867DD3400D9D37B /* TPCircularBuffer.c */; };
9417A7491867DD3400D9D37B /* CHANGELOG in Resources */ = {isa = PBXBuildFile; fileRef = 9417A73C1867DD3400D9D37B /* CHANGELOG */; };
9417A74A1867DD3400D9D37B /* VERSION in Resources */ = {isa = PBXBuildFile; fileRef = 9417A73D1867DD3400D9D37B /* VERSION */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -53,6 +58,41 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
6628E2341B3A121A00020E56 /* simple-drum-beat.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = "simple-drum-beat.wav"; path = "../../../simple-drum-beat.wav"; sourceTree = "<group>"; };
665957671B38B352003E97A1 /* AEFloatConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AEFloatConverter.h; sourceTree = "<group>"; };
665957681B38B352003E97A1 /* AEFloatConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AEFloatConverter.m; sourceTree = "<group>"; };
665957691B38B352003E97A1 /* EZAudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudio.h; sourceTree = "<group>"; };
6659576A1B38B352003E97A1 /* EZAudio.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudio.m; sourceTree = "<group>"; };
6659576B1B38B352003E97A1 /* EZAudioDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioDevice.h; sourceTree = "<group>"; };
6659576C1B38B352003E97A1 /* EZAudioDevice.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioDevice.m; sourceTree = "<group>"; };
6659576D1B38B352003E97A1 /* EZAudioFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFile.h; sourceTree = "<group>"; };
6659576E1B38B352003E97A1 /* EZAudioFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFile.m; sourceTree = "<group>"; };
6659576F1B38B352003E97A1 /* EZAudioFloatConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFloatConverter.h; sourceTree = "<group>"; };
665957701B38B352003E97A1 /* EZAudioFloatConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFloatConverter.m; sourceTree = "<group>"; };
665957711B38B352003E97A1 /* EZAudioFloatData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFloatData.h; sourceTree = "<group>"; };
665957721B38B352003E97A1 /* EZAudioFloatData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFloatData.m; sourceTree = "<group>"; };
665957731B38B352003E97A1 /* EZAudioPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlayer.h; sourceTree = "<group>"; };
665957741B38B352003E97A1 /* EZAudioPlayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlayer.m; sourceTree = "<group>"; };
665957751B38B352003E97A1 /* EZAudioPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlot.h; sourceTree = "<group>"; };
665957761B38B352003E97A1 /* EZAudioPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlot.m; sourceTree = "<group>"; };
665957771B38B352003E97A1 /* EZAudioPlotGL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGL.h; sourceTree = "<group>"; };
665957781B38B352003E97A1 /* EZAudioPlotGL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGL.m; sourceTree = "<group>"; };
665957791B38B352003E97A1 /* EZAudioPlotGLKViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGLKViewController.h; sourceTree = "<group>"; };
6659577A1B38B352003E97A1 /* EZAudioPlotGLKViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGLKViewController.m; sourceTree = "<group>"; };
6659577B1B38B352003E97A1 /* EZAudioUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioUtilities.h; sourceTree = "<group>"; };
6659577C1B38B352003E97A1 /* EZAudioUtilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioUtilities.m; sourceTree = "<group>"; };
6659577D1B38B352003E97A1 /* EZMicrophone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZMicrophone.h; sourceTree = "<group>"; };
6659577E1B38B352003E97A1 /* EZMicrophone.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZMicrophone.m; sourceTree = "<group>"; };
6659577F1B38B352003E97A1 /* EZOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZOutput.h; sourceTree = "<group>"; };
665957801B38B352003E97A1 /* EZOutput.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZOutput.m; sourceTree = "<group>"; };
665957811B38B352003E97A1 /* EZPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZPlot.h; sourceTree = "<group>"; };
665957821B38B352003E97A1 /* EZPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZPlot.m; sourceTree = "<group>"; };
665957831B38B352003E97A1 /* EZRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZRecorder.h; sourceTree = "<group>"; };
665957841B38B352003E97A1 /* EZRecorder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZRecorder.m; sourceTree = "<group>"; };
665957851B38B352003E97A1 /* TPCircularBuffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = TPCircularBuffer.c; sourceTree = "<group>"; };
665957861B38B352003E97A1 /* TPCircularBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TPCircularBuffer.h; sourceTree = "<group>"; };
665957881B38B352003E97A1 /* CHANGELOG */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CHANGELOG; sourceTree = "<group>"; };
665957891B38B352003E97A1 /* VERSION */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VERSION; 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; };
@@ -81,31 +121,6 @@
94056F62185BDB4700EB94BA /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
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>"; };
9417A72A1867DD3400D9D37B /* EZAudioFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFile.m; sourceTree = "<group>"; };
9417A72B1867DD3400D9D37B /* EZAudioPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlot.h; sourceTree = "<group>"; };
9417A72C1867DD3400D9D37B /* EZAudioPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlot.m; sourceTree = "<group>"; };
9417A72D1867DD3400D9D37B /* EZAudioPlotGL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGL.h; sourceTree = "<group>"; };
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>"; };
9417A7361867DD3400D9D37B /* EZPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZPlot.m; sourceTree = "<group>"; };
9417A7371867DD3400D9D37B /* EZRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZRecorder.h; sourceTree = "<group>"; };
9417A7381867DD3400D9D37B /* EZRecorder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZRecorder.m; sourceTree = "<group>"; };
9417A7391867DD3400D9D37B /* TPCircularBuffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = TPCircularBuffer.c; sourceTree = "<group>"; };
9417A73A1867DD3400D9D37B /* TPCircularBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TPCircularBuffer.h; sourceTree = "<group>"; };
9417A73C1867DD3400D9D37B /* CHANGELOG */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CHANGELOG; sourceTree = "<group>"; };
9417A73D1867DD3400D9D37B /* VERSION */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VERSION; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -135,6 +150,56 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
665957661B38B352003E97A1 /* EZAudio */ = {
isa = PBXGroup;
children = (
665957671B38B352003E97A1 /* AEFloatConverter.h */,
665957681B38B352003E97A1 /* AEFloatConverter.m */,
665957691B38B352003E97A1 /* EZAudio.h */,
6659576A1B38B352003E97A1 /* EZAudio.m */,
6659576B1B38B352003E97A1 /* EZAudioDevice.h */,
6659576C1B38B352003E97A1 /* EZAudioDevice.m */,
6659576D1B38B352003E97A1 /* EZAudioFile.h */,
6659576E1B38B352003E97A1 /* EZAudioFile.m */,
6659576F1B38B352003E97A1 /* EZAudioFloatConverter.h */,
665957701B38B352003E97A1 /* EZAudioFloatConverter.m */,
665957711B38B352003E97A1 /* EZAudioFloatData.h */,
665957721B38B352003E97A1 /* EZAudioFloatData.m */,
665957731B38B352003E97A1 /* EZAudioPlayer.h */,
665957741B38B352003E97A1 /* EZAudioPlayer.m */,
665957751B38B352003E97A1 /* EZAudioPlot.h */,
665957761B38B352003E97A1 /* EZAudioPlot.m */,
665957771B38B352003E97A1 /* EZAudioPlotGL.h */,
665957781B38B352003E97A1 /* EZAudioPlotGL.m */,
665957791B38B352003E97A1 /* EZAudioPlotGLKViewController.h */,
6659577A1B38B352003E97A1 /* EZAudioPlotGLKViewController.m */,
6659577B1B38B352003E97A1 /* EZAudioUtilities.h */,
6659577C1B38B352003E97A1 /* EZAudioUtilities.m */,
6659577D1B38B352003E97A1 /* EZMicrophone.h */,
6659577E1B38B352003E97A1 /* EZMicrophone.m */,
6659577F1B38B352003E97A1 /* EZOutput.h */,
665957801B38B352003E97A1 /* EZOutput.m */,
665957811B38B352003E97A1 /* EZPlot.h */,
665957821B38B352003E97A1 /* EZPlot.m */,
665957831B38B352003E97A1 /* EZRecorder.h */,
665957841B38B352003E97A1 /* EZRecorder.m */,
665957851B38B352003E97A1 /* TPCircularBuffer.c */,
665957861B38B352003E97A1 /* TPCircularBuffer.h */,
665957871B38B352003E97A1 /* VERSION */,
);
name = EZAudio;
path = ../../../../EZAudio;
sourceTree = "<group>";
};
665957871B38B352003E97A1 /* VERSION */ = {
isa = PBXGroup;
children = (
665957881B38B352003E97A1 /* CHANGELOG */,
665957891B38B352003E97A1 /* VERSION */,
);
path = VERSION;
sourceTree = "<group>";
};
94056EEE185BD83400EB94BA = {
isa = PBXGroup;
children = (
@@ -183,14 +248,14 @@
94056F00185BD83400EB94BA /* EZAudioPlayFileExample */ = {
isa = PBXGroup;
children = (
9417A7241867DD3400D9D37B /* EZAudio */,
665957661B38B352003E97A1 /* EZAudio */,
94056F0C185BD83400EB94BA /* AppDelegate.h */,
94056F0D185BD83400EB94BA /* AppDelegate.m */,
94056F2E185BD86D00EB94BA /* PlayFileViewController.h */,
94056F2F185BD86D00EB94BA /* PlayFileViewController.m */,
94056F30185BD86D00EB94BA /* PlayFileViewController.xib */,
9417A6D41865928C00D9D37B /* simple-drum-beat.wav */,
94056F0F185BD83400EB94BA /* MainMenu.xib */,
6628E2341B3A121A00020E56 /* simple-drum-beat.wav */,
94056F12185BD83400EB94BA /* Images.xcassets */,
94056F01185BD83400EB94BA /* Supporting Files */,
);
@@ -227,46 +292,6 @@
name = "Supporting Files";
sourceTree = "<group>";
};
9417A7241867DD3400D9D37B /* EZAudio */ = {
isa = PBXGroup;
children = (
9417A7251867DD3400D9D37B /* AEFloatConverter.h */,
9417A7261867DD3400D9D37B /* AEFloatConverter.m */,
9417A7271867DD3400D9D37B /* EZAudio.h */,
9417A7281867DD3400D9D37B /* EZAudio.m */,
9417A7291867DD3400D9D37B /* EZAudioFile.h */,
9417A72A1867DD3400D9D37B /* EZAudioFile.m */,
9417A72B1867DD3400D9D37B /* EZAudioPlot.h */,
9417A72C1867DD3400D9D37B /* EZAudioPlot.m */,
9417A72D1867DD3400D9D37B /* EZAudioPlotGL.h */,
9417A72E1867DD3400D9D37B /* EZAudioPlotGL.m */,
9417A72F1867DD3400D9D37B /* EZAudioPlotGLKViewController.h */,
9417A7301867DD3400D9D37B /* EZAudioPlotGLKViewController.m */,
9417A7311867DD3400D9D37B /* EZMicrophone.h */,
9417A7321867DD3400D9D37B /* EZMicrophone.m */,
9417A7331867DD3400D9D37B /* EZOutput.h */,
9417A7341867DD3400D9D37B /* EZOutput.m */,
9417A7351867DD3400D9D37B /* EZPlot.h */,
9417A7361867DD3400D9D37B /* EZPlot.m */,
9417A7371867DD3400D9D37B /* EZRecorder.h */,
9417A7381867DD3400D9D37B /* EZRecorder.m */,
9417A7391867DD3400D9D37B /* TPCircularBuffer.c */,
9417A73A1867DD3400D9D37B /* TPCircularBuffer.h */,
9417A73B1867DD3400D9D37B /* VERSION */,
);
name = EZAudio;
path = ../../../../EZAudio;
sourceTree = "<group>";
};
9417A73B1867DD3400D9D37B /* VERSION */ = {
isa = PBXGroup;
children = (
9417A73C1867DD3400D9D37B /* CHANGELOG */,
9417A73D1867DD3400D9D37B /* VERSION */,
);
path = VERSION;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -343,12 +368,12 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
6628E2351B3A121A00020E56 /* simple-drum-beat.wav in Resources */,
94056F05185BD83400EB94BA /* InfoPlist.strings in Resources */,
94056F13185BD83400EB94BA /* Images.xcassets in Resources */,
9417A7491867DD3400D9D37B /* CHANGELOG in Resources */,
9417A6D51865928C00D9D37B /* simple-drum-beat.wav in Resources */,
6659579A1B38B352003E97A1 /* CHANGELOG in Resources */,
94056F0B185BD83400EB94BA /* Credits.rtf in Resources */,
9417A74A1867DD3400D9D37B /* VERSION in Resources */,
6659579B1B38B352003E97A1 /* VERSION in Resources */,
94056F32185BD86D00EB94BA /* PlayFileViewController.xib in Resources */,
94056F11185BD83400EB94BA /* MainMenu.xib in Resources */,
);
@@ -369,20 +394,25 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9417A7481867DD3400D9D37B /* TPCircularBuffer.c in Sources */,
9417A7451867DD3400D9D37B /* EZOutput.m in Sources */,
9417A7431867DD3400D9D37B /* EZAudioPlotGLKViewController.m in Sources */,
665957981B38B352003E97A1 /* EZRecorder.m in Sources */,
94056F31185BD86D00EB94BA /* PlayFileViewController.m in Sources */,
9417A73E1867DD3400D9D37B /* AEFloatConverter.m in Sources */,
6659578E1B38B352003E97A1 /* EZAudioFloatConverter.m in Sources */,
6659578F1B38B352003E97A1 /* EZAudioFloatData.m in Sources */,
6659578A1B38B352003E97A1 /* AEFloatConverter.m in Sources */,
6659578D1B38B352003E97A1 /* EZAudioFile.m in Sources */,
665957961B38B352003E97A1 /* EZOutput.m in Sources */,
665957921B38B352003E97A1 /* EZAudioPlotGL.m in Sources */,
665957991B38B352003E97A1 /* TPCircularBuffer.c in Sources */,
665957911B38B352003E97A1 /* EZAudioPlot.m in Sources */,
94056F0E185BD83400EB94BA /* AppDelegate.m in Sources */,
9417A7411867DD3400D9D37B /* EZAudioPlot.m in Sources */,
9417A7401867DD3400D9D37B /* EZAudioFile.m in Sources */,
9417A7421867DD3400D9D37B /* EZAudioPlotGL.m in Sources */,
665957951B38B352003E97A1 /* EZMicrophone.m in Sources */,
665957901B38B352003E97A1 /* EZAudioPlayer.m in Sources */,
6659578C1B38B352003E97A1 /* EZAudioDevice.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 */,
665957971B38B352003E97A1 /* EZPlot.m in Sources */,
6659578B1B38B352003E97A1 /* EZAudio.m in Sources */,
665957941B38B352003E97A1 /* EZAudioUtilities.m in Sources */,
665957931B38B352003E97A1 /* EZAudioPlotGLKViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -47,23 +47,28 @@
/**
The CoreGraphics based audio plot
*/
@property (nonatomic,weak) IBOutlet EZAudioPlotGL *audioPlot;
@property (nonatomic, weak) IBOutlet EZAudioPlotGL *audioPlot;
#pragma mark - UI Extras
/**
A label to display the current file path with the waveform shown
*/
@property (nonatomic,weak) IBOutlet NSTextField *filePathLabel;
@property (nonatomic, weak) IBOutlet NSTextField *filePathLabel;
/**
A slider to indicate the current frame position in the audio file
*/
@property (nonatomic,weak) IBOutlet NSSlider *framePositionSlider;
@property (nonatomic, weak) IBOutlet NSSlider *framePositionSlider;
/**
A slider to adjust the sample rate.
*/
@property (nonatomic,weak) IBOutlet NSSlider *sampleRateSlider;
@property (nonatomic, weak) IBOutlet NSSlider *sampleRateSlider;
/**
A slider to adjust the sample rate.
*/
@property (nonatomic, weak) IBOutlet NSTextField *sampleRateLabel;
/**
A BOOL indicating whether or not we've reached the end of the file
@@ -31,242 +31,257 @@
@end
@implementation PlayFileViewController
@synthesize audioFile;
@synthesize audioPlot;
@synthesize eof = _eof;
@synthesize framePositionSlider;
#pragma mark - Initialization
-(id)init {
self = [super initWithNibName:NSStringFromClass(self.class) bundle:nil];
if(self){
[self initializeViewController];
}
return self;
}
-(id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithNibName:NSStringFromClass(self.class) bundle:nil];
if(self){
[self initializeViewController];
}
return self;
}
-(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:NSStringFromClass(self.class) bundle:nil];
if(self){
[self initializeViewController];
}
return self;
}
#pragma mark - Initialize View Controller
-(void)initializeViewController {
}
//------------------------------------------------------------------------------
#pragma mark - Customize the Audio Plot
-(void)awakeFromNib {
/*
Customizing the audio plot's look
*/
// Background color
self.audioPlot.backgroundColor = [NSColor colorWithCalibratedRed: 0.175 green: 0.151 blue: 0.137 alpha: 1];
// Waveform color
self.audioPlot.color = [NSColor colorWithCalibratedRed: 1.000 green: 1.000 blue: 1.000 alpha: 1];
// Plot type
self.audioPlot.plotType = EZPlotTypeBuffer;
// Fill
self.audioPlot.shouldFill = YES;
// Mirror
self.audioPlot.shouldMirror = YES;
/*
Try opening the sample file
*/
[self openFileWithFilePathURL:[NSURL fileURLWithPath:kAudioFileDefault]];
}
//------------------------------------------------------------------------------
#pragma mark - Actions
-(void)changePlotType:(id)sender {
NSInteger selectedSegment = [sender selectedSegment];
switch(selectedSegment){
case 0:
[self drawBufferPlot];
break;
case 1:
[self drawRollingPlot];
break;
default:
break;
}
}
-(void)changeOutputSamplingFrequency:(id)sender
- (void)awakeFromNib
{
AudioStreamBasicDescription asbd = [EZOutput sharedOutput].audioStreamBasicDescription;
float samplingFrequency = ((NSSlider *)sender).floatValue;
asbd.mSampleRate = samplingFrequency;
[[EZOutput sharedOutput] setAudioStreamBasicDescription:asbd];
//
// Customizing the audio plot's look
//
// Background color
self.audioPlot.backgroundColor = [NSColor colorWithCalibratedRed: 0.816 green: 0.349 blue: 0.255 alpha: 1];
// Waveform color
self.audioPlot.color = [NSColor colorWithCalibratedRed: 1.000 green: 1.000 blue: 1.000 alpha: 1];
// Plot type
self.audioPlot.plotType = EZPlotTypeBuffer;
// Fill
self.audioPlot.shouldFill = YES;
// Mirror
self.audioPlot.shouldMirror = YES;
//
// Try opening the sample file
//
[self openFileWithFilePathURL:[NSURL fileURLWithPath:kAudioFileDefault]];
}
-(void)openFile:(id)sender {
NSOpenPanel* openDlg = [NSOpenPanel openPanel];
openDlg.canChooseFiles = YES;
openDlg.canChooseDirectories = NO;
openDlg.delegate = self;
if( [openDlg runModal] == NSOKButton ){
NSArray *selectedFiles = [openDlg URLs];
[self openFileWithFilePathURL:selectedFiles.firstObject];
}
}
//------------------------------------------------------------------------------
#pragma mark - Actions
//------------------------------------------------------------------------------
-(void)play:(id)sender {
if( ![[EZOutput sharedOutput] isPlaying] ){
if( self.eof ){
[self.audioFile seekToFrame:0];
- (void)changePlotType:(id)sender
{
NSInteger selectedSegment = [sender selectedSegment];
switch(selectedSegment)
{
case 0:
[self drawBufferPlot];
break;
case 1:
[self drawRollingPlot];
break;
default:
break;
}
if( self.audioPlot.plotType == EZPlotTypeBuffer &&
self.audioPlot.shouldFill == YES ){
self.audioPlot.plotType = EZPlotTypeRolling;
}
//------------------------------------------------------------------------------
- (void)changeOutputSamplingFrequency:(id)sender
{
float sampleRate = ((NSSlider *)sender).floatValue;
AudioStreamBasicDescription asbd = [[EZOutput sharedOutput] audioStreamBasicDescription];
asbd.mSampleRate = sampleRate;
[[EZOutput sharedOutput] setAudioStreamBasicDescription:asbd];
self.sampleRateLabel.floatValue = sampleRate;
}
//------------------------------------------------------------------------------
- (void)openFile:(id)sender
{
NSOpenPanel* openDlg = [NSOpenPanel openPanel];
openDlg.canChooseFiles = YES;
openDlg.canChooseDirectories = NO;
openDlg.delegate = self;
if ([openDlg runModal] == NSOKButton)
{
NSArray *selectedFiles = [openDlg URLs];
[self openFileWithFilePathURL:selectedFiles.firstObject];
}
[EZOutput sharedOutput].outputDataSource = self;
[[EZOutput sharedOutput] startPlayback];
}
else {
[EZOutput sharedOutput].outputDataSource = nil;
[[EZOutput sharedOutput] stopPlayback];
}
}
-(void)seekToFrame:(id)sender {
[self.audioFile seekToFrame:(SInt64)[(NSSlider*)sender doubleValue]];
//------------------------------------------------------------------------------
-(void)play:(id)sender
{
if (![[EZOutput sharedOutput] isPlaying])
{
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];
}
else
{
[EZOutput sharedOutput].outputDataSource = nil;
[[EZOutput sharedOutput] stopPlayback];
}
}
//------------------------------------------------------------------------------
-(void)seekToFrame:(id)sender
{
[self.audioFile seekToFrame:(SInt64)[(NSSlider*)sender doubleValue]];
}
//------------------------------------------------------------------------------
#pragma mark - Action Extensions
//------------------------------------------------------------------------------
/*
Give the visualization of the current buffer (this is almost exactly the openFrameworks audio input example)
*/
-(void)drawBufferPlot {
// Change the plot type to the buffer plot
self.audioPlot.plotType = EZPlotTypeBuffer;
// Don't fill
self.audioPlot.shouldFill = NO;
// Don't mirror over the x-axis
self.audioPlot.shouldMirror = NO;
-(void)drawBufferPlot
{
// Change the plot type to the buffer plot
self.audioPlot.plotType = EZPlotTypeBuffer;
// Don't fill
self.audioPlot.shouldFill = NO;
// Don't mirror over the x-axis
self.audioPlot.shouldMirror = NO;
}
//------------------------------------------------------------------------------
/*
Give the classic mirrored, rolling waveform look
*/
-(void)drawRollingPlot {
// Change the plot type to the rolling plot
self.audioPlot.plotType = EZPlotTypeRolling;
// Fill the waveform
self.audioPlot.shouldFill = YES;
// Mirror over the x-axis
self.audioPlot.shouldMirror = YES;
-(void)drawRollingPlot
{
// Change the plot type to the rolling plot
self.audioPlot.plotType = EZPlotTypeRolling;
// Fill the waveform
self.audioPlot.shouldFill = YES;
// Mirror over the x-axis
self.audioPlot.shouldMirror = YES;
}
-(void)openFileWithFilePathURL:(NSURL*)filePathURL {
// Stop playback
[[EZOutput sharedOutput] stopPlayback];
self.audioFile = [EZAudioFile audioFileWithURL:filePathURL andDelegate:self];
self.eof = NO;
self.filePathLabel.stringValue = filePathURL.lastPathComponent;
self.framePositionSlider.minValue = 0.0f;
self.framePositionSlider.maxValue = (double)self.audioFile.totalFrames;
self.playButton.state = NSOffState;
self.plotSegmentControl.selectedSegment = 1;
//------------------------------------------------------------------------------
// Set the client format from the EZAudioFile on the output
-(void)openFileWithFilePathURL:(NSURL*)filePathURL
{
//
// Stop playback
//
[[EZOutput sharedOutput] stopPlayback];
#pragma mark Mess Around With Audio Stream Basic Description Here!
self.sampleRateSlider.floatValue = self.audioFile.clientFormat.mSampleRate;
AudioStreamBasicDescription outputASBD = self.audioFile.clientFormat;
//
// Load the audio file and customize the UI
//
self.audioFile = [EZAudioFile audioFileWithURL:filePathURL andDelegate:self];
self.eof = NO;
self.filePathLabel.stringValue = filePathURL.lastPathComponent;
self.framePositionSlider.minValue = 0.0f;
self.framePositionSlider.maxValue = (double)self.audioFile.totalFrames;
self.playButton.state = NSOffState;
self.plotSegmentControl.selectedSegment = 1;
[[EZOutput sharedOutput] setAudioStreamBasicDescription:[EZAudio stereoFloatInterleavedFormatWithSampleRate:44100]];
//
// Set the client format from the EZAudioFile on the output
//
Float64 sampleRate = self.audioFile.clientFormat.mSampleRate;
self.sampleRateSlider.floatValue = sampleRate;
self.sampleRateLabel.floatValue = sampleRate;
[[EZOutput sharedOutput] setAudioStreamBasicDescription:[EZAudioUtilities stereoFloatInterleavedFormatWithSampleRate:44100]];
// 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];
}];
//
// Change back to a buffer plot, but mirror and fill the waveform
//
self.audioPlot.plotType = EZPlotTypeBuffer;
self.audioPlot.shouldFill = YES;
self.audioPlot.shouldMirror = YES;
//
// Plot the whole waveform
//
__weak typeof (self) weakSelf = self;
[self.audioFile getWaveformDataWithCompletionBlock:^(float *waveformData,
UInt32 length)
{
[weakSelf.audioPlot updateBuffer:waveformData
withBufferSize:length];
}];
}
//------------------------------------------------------------------------------
#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])
{
__weak typeof (self) weakSelf = self;
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf.audioPlot updateBuffer:buffer[0]
withBufferSize:bufferSize];
});
}
}
//------------------------------------------------------------------------------
-(void)audioFile:(EZAudioFile *)audioFile
updatedPosition:(SInt64)framePosition {
dispatch_async(dispatch_get_main_queue(), ^{
if( ![self.framePositionSlider.cell isHighlighted] ){
self.framePositionSlider.floatValue = (float)framePosition;
}
});
__weak typeof (self) weakSelf = self;
dispatch_async(dispatch_get_main_queue(), ^{
if (![weakSelf.framePositionSlider.cell isHighlighted])
{
weakSelf.framePositionSlider.floatValue = (float)framePosition;
}
});
}
//------------------------------------------------------------------------------
#pragma mark - EZOutputDataSource
//------------------------------------------------------------------------------
-(void) output:(EZOutput *)output
shouldFillAudioBufferList:(AudioBufferList *)audioBufferList
withNumberOfFrames:(UInt32)frames
{
if( self.audioFile )
{
UInt32 bufferSize;
[self.audioFile readFrames:frames
audioBufferList:audioBufferList
bufferSize:&bufferSize
eof:&_eof];
if( _eof )
if (self.audioFile)
{
[self seekToFrame:0];
UInt32 bufferSize;
[self.audioFile readFrames:frames
audioBufferList:audioBufferList
bufferSize:&bufferSize
eof:&_eof];
if (_eof)
{
[self seekToFrame:0];
}
}
}
}
//------------------------------------------------------------------------------
#pragma mark - NSOpenSavePanelDelegate
//------------------------------------------------------------------------------
/**
Here's an example how to filter the open panel to only show the supported file types by the EZAudioFile (which are just the audio file types supported by Core Audio).
*/
-(BOOL)panel:(id)sender shouldShowFilename:(NSString *)filename {
NSString* ext = [filename pathExtension];
if ([ext isEqualToString:@""] || [ext isEqualToString:@"/"] || ext == nil || ext == NULL || [ext length] < 1) {
return YES;
}
NSArray *fileTypes = [EZAudioFile supportedAudioFileTypes];
NSEnumerator* tagEnumerator = [fileTypes objectEnumerator];
NSString* allowedExt;
while ((allowedExt = [tagEnumerator nextObject]))
{
if ([ext caseInsensitiveCompare:allowedExt] == NSOrderedSame)
{
return YES;
}
}
return NO;
- (BOOL)panel:(id)sender shouldShowFilename:(NSString *)filename
{
NSString *ext = [filename pathExtension];
NSArray *fileTypes = [EZAudioFile supportedAudioFileTypes];
BOOL isDirectory = [ext isEqualToString:@""];
return [fileTypes containsObject:ext] || isDirectory;
}
//------------------------------------------------------------------------------
@end
@@ -1,8 +1,8 @@
<?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="7702" 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="7702"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="PlayFileViewController">
@@ -12,6 +12,7 @@
<outlet property="framePositionSlider" destination="CFP-v0-TzQ" id="3oy-Xn-4JK"/>
<outlet property="playButton" destination="OQp-Lr-dlS" id="K5R-Qg-7DY"/>
<outlet property="plotSegmentControl" destination="bZW-tA-C61" id="4ic-Ou-qh2"/>
<outlet property="sampleRateLabel" destination="3ul-3w-l3S" id="5CA-Au-tFa"/>
<outlet property="sampleRateSlider" destination="rRH-oS-VV3" id="8ij-Ff-CZK"/>
<outlet property="view" destination="Xpo-HP-Ost" id="zlj-bW-4iz"/>
</connections>
@@ -19,18 +20,14 @@
<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="-1" width="480" height="366"/>
<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 translatesAutoresizingMaskIntoConstraints="NO" id="Lz1-Gs-1lD" customClass="EZAudioPlotGL">
<rect key="frame" x="0.0" y="0.0" width="480" height="236"/>
</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="12" y="320" 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,19 +37,15 @@
</connections>
</button>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="0eT-7c-7fJ">
<rect key="frame" x="141" y="235" width="38" height="17"/>
<textFieldCell key="cell" lineBreakMode="truncatingMiddle" sendsActionOnEndEditing="YES" title="Label" id="vXQ-HF-vLX">
<font key="font" metaFont="system"/>
<rect key="frame" x="140" y="332" width="36" height="16"/>
<textFieldCell key="cell" lineBreakMode="truncatingMiddle" sendsActionOnEndEditing="YES" alignment="left" title="Label" id="vXQ-HF-vLX">
<font key="font" metaFont="cellTitle"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</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="12" y="287" 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 +54,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="335" y="292" width="129" height="24"/>
<constraints>
<constraint firstAttribute="width" constant="125" id="Xbc-hw-M9K"/>
</constraints>
<segmentedCell key="cell" borderStyle="border" alignment="left" style="rounded" trackingMode="selectOne" id="8U1-ER-vPJ">
<font key="font" metaFont="system"/>
<segments>
@@ -74,15 +70,36 @@
<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"/>
<slider verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="CFP-v0-TzQ">
<rect key="frame" x="16" y="242" width="448" height="20"/>
<sliderCell key="cell" 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"/>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="7AB-VA-xL3">
<rect key="frame" x="16" y="269" width="85" height="16"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="left" title="Sample Rate:" id="GAa-Hp-OlV">
<font key="font" metaFont="systemBold" size="12"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="3ul-3w-l3S">
<rect key="frame" x="413" y="269" width="51" height="16"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="44100.0" id="vlK-Hb-Yca">
<numberFormatter key="formatter" formatterBehavior="custom10_4" minimumIntegerDigits="0" maximumIntegerDigits="42" id="bBU-vS-tEB">
<metadata>
<real key="inspectorSampleValue" value="44"/>
</metadata>
</numberFormatter>
<font key="font" metaFont="titleBar" size="12"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<slider verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="rRH-oS-VV3">
<rect key="frame" x="106" y="267" width="302" height="20"/>
<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"/>
@@ -90,23 +107,31 @@
</slider>
</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 firstAttribute="trailing" secondItem="Lz1-Gs-1lD" secondAttribute="trailing" id="6ch-Ea-Fiv"/>
<constraint firstItem="OQp-Lr-dlS" firstAttribute="top" secondItem="bZW-tA-C61" secondAttribute="top" id="7vO-GR-xTE"/>
<constraint firstItem="0eT-7c-7fJ" firstAttribute="top" secondItem="2Ma-jj-U3z" secondAttribute="top" id="HBU-T5-zaa"/>
<constraint firstItem="7AB-VA-xL3" firstAttribute="baseline" secondItem="rRH-oS-VV3" secondAttribute="baseline" id="Kam-ih-ZXi"/>
<constraint firstItem="bZW-tA-C61" firstAttribute="trailing" secondItem="3ul-3w-l3S" secondAttribute="trailing" id="LD2-vK-71Z"/>
<constraint firstItem="CFP-v0-TzQ" firstAttribute="top" secondItem="7AB-VA-xL3" secondAttribute="bottom" constant="9" id="LD8-VL-CNM"/>
<constraint firstItem="OQp-Lr-dlS" firstAttribute="trailing" secondItem="2Ma-jj-U3z" secondAttribute="trailing" id="MsA-yL-lz2"/>
<constraint firstItem="7AB-VA-xL3" firstAttribute="top" secondItem="OQp-Lr-dlS" secondAttribute="bottom" constant="9" id="Pih-ij-B0m"/>
<constraint firstItem="7AB-VA-xL3" firstAttribute="leading" secondItem="CFP-v0-TzQ" secondAttribute="leading" id="RYx-Xq-XLZ"/>
<constraint firstItem="2Ma-jj-U3z" firstAttribute="leading" secondItem="Xpo-HP-Ost" secondAttribute="leading" constant="18" id="S8x-eP-qXK"/>
<constraint firstItem="0eT-7c-7fJ" firstAttribute="leading" secondItem="2Ma-jj-U3z" secondAttribute="trailing" constant="11" id="TQU-4h-fbE"/>
<constraint firstItem="Lz1-Gs-1lD" firstAttribute="leading" secondItem="Xpo-HP-Ost" secondAttribute="leading" id="Uez-MB-poN"/>
<constraint firstItem="2Ma-jj-U3z" firstAttribute="top" secondItem="Xpo-HP-Ost" secondAttribute="top" constant="18" id="WBN-LT-MZa"/>
<constraint firstItem="CFP-v0-TzQ" firstAttribute="centerX" secondItem="Lz1-Gs-1lD" secondAttribute="centerX" id="WbD-eb-ZrO"/>
<constraint firstItem="OQp-Lr-dlS" firstAttribute="leading" secondItem="7AB-VA-xL3" secondAttribute="leading" id="Xfe-yK-p7E"/>
<constraint firstItem="3ul-3w-l3S" firstAttribute="baseline" secondItem="rRH-oS-VV3" secondAttribute="baseline" id="Xmx-y3-yLf"/>
<constraint firstItem="OQp-Lr-dlS" firstAttribute="leading" secondItem="2Ma-jj-U3z" secondAttribute="leading" id="ZFJ-Sy-xrR"/>
<constraint firstItem="3ul-3w-l3S" firstAttribute="leading" secondItem="rRH-oS-VV3" secondAttribute="trailing" constant="9" id="id3-zN-WXi"/>
<constraint firstItem="Lz1-Gs-1lD" firstAttribute="top" secondItem="CFP-v0-TzQ" secondAttribute="bottom" constant="8" symbolic="YES" id="ku7-ZF-joD"/>
<constraint firstItem="OQp-Lr-dlS" firstAttribute="top" secondItem="2Ma-jj-U3z" secondAttribute="bottom" constant="12" symbolic="YES" id="kzD-5K-Jb3"/>
<constraint firstItem="rRH-oS-VV3" firstAttribute="leading" secondItem="7AB-VA-xL3" secondAttribute="trailing" constant="9" id="nVe-ua-Zpl"/>
<constraint firstItem="3ul-3w-l3S" firstAttribute="trailing" secondItem="CFP-v0-TzQ" secondAttribute="trailing" id="pPp-hF-DB3"/>
<constraint firstAttribute="bottom" secondItem="Lz1-Gs-1lD" secondAttribute="bottom" id="yaV-0k-IXf"/>
</constraints>
<point key="canvasLocation" x="191" y="409"/>
</customView>
</objects>
</document>
@@ -7,6 +7,24 @@
objects = {
/* Begin PBXBuildFile section */
665957C01B38B356003E97A1 /* AEFloatConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 6659579E1B38B356003E97A1 /* AEFloatConverter.m */; };
665957C11B38B356003E97A1 /* EZAudio.m in Sources */ = {isa = PBXBuildFile; fileRef = 665957A01B38B356003E97A1 /* EZAudio.m */; };
665957C21B38B356003E97A1 /* EZAudioDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = 665957A21B38B356003E97A1 /* EZAudioDevice.m */; };
665957C31B38B356003E97A1 /* EZAudioFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 665957A41B38B356003E97A1 /* EZAudioFile.m */; };
665957C41B38B356003E97A1 /* EZAudioFloatConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 665957A61B38B356003E97A1 /* EZAudioFloatConverter.m */; };
665957C51B38B356003E97A1 /* EZAudioFloatData.m in Sources */ = {isa = PBXBuildFile; fileRef = 665957A81B38B356003E97A1 /* EZAudioFloatData.m */; };
665957C61B38B356003E97A1 /* EZAudioPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 665957AA1B38B356003E97A1 /* EZAudioPlayer.m */; };
665957C71B38B356003E97A1 /* EZAudioPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 665957AC1B38B356003E97A1 /* EZAudioPlot.m */; };
665957C81B38B356003E97A1 /* EZAudioPlotGL.m in Sources */ = {isa = PBXBuildFile; fileRef = 665957AE1B38B356003E97A1 /* EZAudioPlotGL.m */; };
665957C91B38B356003E97A1 /* EZAudioPlotGLKViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 665957B01B38B356003E97A1 /* EZAudioPlotGLKViewController.m */; };
665957CA1B38B356003E97A1 /* EZAudioUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = 665957B21B38B356003E97A1 /* EZAudioUtilities.m */; };
665957CB1B38B356003E97A1 /* EZMicrophone.m in Sources */ = {isa = PBXBuildFile; fileRef = 665957B41B38B356003E97A1 /* EZMicrophone.m */; };
665957CC1B38B356003E97A1 /* EZOutput.m in Sources */ = {isa = PBXBuildFile; fileRef = 665957B61B38B356003E97A1 /* EZOutput.m */; };
665957CD1B38B356003E97A1 /* EZPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 665957B81B38B356003E97A1 /* EZPlot.m */; };
665957CE1B38B356003E97A1 /* EZRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 665957BA1B38B356003E97A1 /* EZRecorder.m */; };
665957CF1B38B356003E97A1 /* TPCircularBuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 665957BB1B38B356003E97A1 /* TPCircularBuffer.c */; };
665957D01B38B356003E97A1 /* CHANGELOG in Resources */ = {isa = PBXBuildFile; fileRef = 665957BE1B38B356003E97A1 /* CHANGELOG */; };
665957D11B38B356003E97A1 /* VERSION in Resources */ = {isa = PBXBuildFile; fileRef = 665957BF1B38B356003E97A1 /* VERSION */; };
94056E0D185BB3D800EB94BA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 94056E0C185BB3D800EB94BA /* Cocoa.framework */; };
94056E17185BB3D800EB94BA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 94056E15185BB3D800EB94BA /* InfoPlist.strings */; };
94056E19185BB3D800EB94BA /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 94056E18185BB3D800EB94BA /* main.m */; };
@@ -26,19 +44,6 @@
94056E70185BB42100EB94BA /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 94056E6F185BB42100EB94BA /* QuartzCore.framework */; };
94056E74185BB44200EB94BA /* RecordViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 94056E72185BB44200EB94BA /* RecordViewController.m */; };
94056E75185BB44200EB94BA /* RecordViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 94056E73185BB44200EB94BA /* RecordViewController.xib */; };
9417A7651867DD3F00D9D37B /* AEFloatConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A74D1867DD3F00D9D37B /* AEFloatConverter.m */; };
9417A7661867DD3F00D9D37B /* EZAudio.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A74F1867DD3F00D9D37B /* EZAudio.m */; };
9417A7671867DD3F00D9D37B /* EZAudioFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7511867DD3F00D9D37B /* EZAudioFile.m */; };
9417A7681867DD3F00D9D37B /* EZAudioPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7531867DD3F00D9D37B /* EZAudioPlot.m */; };
9417A7691867DD3F00D9D37B /* EZAudioPlotGL.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7551867DD3F00D9D37B /* EZAudioPlotGL.m */; };
9417A76A1867DD3F00D9D37B /* EZAudioPlotGLKViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7571867DD3F00D9D37B /* EZAudioPlotGLKViewController.m */; };
9417A76B1867DD3F00D9D37B /* EZMicrophone.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7591867DD3F00D9D37B /* EZMicrophone.m */; };
9417A76C1867DD3F00D9D37B /* EZOutput.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A75B1867DD3F00D9D37B /* EZOutput.m */; };
9417A76D1867DD3F00D9D37B /* EZPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A75D1867DD3F00D9D37B /* EZPlot.m */; };
9417A76E1867DD3F00D9D37B /* EZRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A75F1867DD3F00D9D37B /* EZRecorder.m */; };
9417A76F1867DD3F00D9D37B /* TPCircularBuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7601867DD3F00D9D37B /* TPCircularBuffer.c */; };
9417A7701867DD3F00D9D37B /* CHANGELOG in Resources */ = {isa = PBXBuildFile; fileRef = 9417A7631867DD3F00D9D37B /* CHANGELOG */; };
9417A7711867DD3F00D9D37B /* VERSION in Resources */ = {isa = PBXBuildFile; fileRef = 9417A7641867DD3F00D9D37B /* VERSION */; };
941D71AA186298AA007D52D8 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 941D71A9186298AA007D52D8 /* AVFoundation.framework */; };
/* End PBXBuildFile section */
@@ -53,6 +58,40 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
6659579D1B38B356003E97A1 /* AEFloatConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AEFloatConverter.h; sourceTree = "<group>"; };
6659579E1B38B356003E97A1 /* AEFloatConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AEFloatConverter.m; sourceTree = "<group>"; };
6659579F1B38B356003E97A1 /* EZAudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudio.h; sourceTree = "<group>"; };
665957A01B38B356003E97A1 /* EZAudio.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudio.m; sourceTree = "<group>"; };
665957A11B38B356003E97A1 /* EZAudioDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioDevice.h; sourceTree = "<group>"; };
665957A21B38B356003E97A1 /* EZAudioDevice.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioDevice.m; sourceTree = "<group>"; };
665957A31B38B356003E97A1 /* EZAudioFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFile.h; sourceTree = "<group>"; };
665957A41B38B356003E97A1 /* EZAudioFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFile.m; sourceTree = "<group>"; };
665957A51B38B356003E97A1 /* EZAudioFloatConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFloatConverter.h; sourceTree = "<group>"; };
665957A61B38B356003E97A1 /* EZAudioFloatConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFloatConverter.m; sourceTree = "<group>"; };
665957A71B38B356003E97A1 /* EZAudioFloatData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFloatData.h; sourceTree = "<group>"; };
665957A81B38B356003E97A1 /* EZAudioFloatData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFloatData.m; sourceTree = "<group>"; };
665957A91B38B356003E97A1 /* EZAudioPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlayer.h; sourceTree = "<group>"; };
665957AA1B38B356003E97A1 /* EZAudioPlayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlayer.m; sourceTree = "<group>"; };
665957AB1B38B356003E97A1 /* EZAudioPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlot.h; sourceTree = "<group>"; };
665957AC1B38B356003E97A1 /* EZAudioPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlot.m; sourceTree = "<group>"; };
665957AD1B38B356003E97A1 /* EZAudioPlotGL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGL.h; sourceTree = "<group>"; };
665957AE1B38B356003E97A1 /* EZAudioPlotGL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGL.m; sourceTree = "<group>"; };
665957AF1B38B356003E97A1 /* EZAudioPlotGLKViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGLKViewController.h; sourceTree = "<group>"; };
665957B01B38B356003E97A1 /* EZAudioPlotGLKViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGLKViewController.m; sourceTree = "<group>"; };
665957B11B38B356003E97A1 /* EZAudioUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioUtilities.h; sourceTree = "<group>"; };
665957B21B38B356003E97A1 /* EZAudioUtilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioUtilities.m; sourceTree = "<group>"; };
665957B31B38B356003E97A1 /* EZMicrophone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZMicrophone.h; sourceTree = "<group>"; };
665957B41B38B356003E97A1 /* EZMicrophone.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZMicrophone.m; sourceTree = "<group>"; };
665957B51B38B356003E97A1 /* EZOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZOutput.h; sourceTree = "<group>"; };
665957B61B38B356003E97A1 /* EZOutput.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZOutput.m; sourceTree = "<group>"; };
665957B71B38B356003E97A1 /* EZPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZPlot.h; sourceTree = "<group>"; };
665957B81B38B356003E97A1 /* EZPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZPlot.m; sourceTree = "<group>"; };
665957B91B38B356003E97A1 /* EZRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZRecorder.h; sourceTree = "<group>"; };
665957BA1B38B356003E97A1 /* EZRecorder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZRecorder.m; sourceTree = "<group>"; };
665957BB1B38B356003E97A1 /* TPCircularBuffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = TPCircularBuffer.c; sourceTree = "<group>"; };
665957BC1B38B356003E97A1 /* TPCircularBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TPCircularBuffer.h; sourceTree = "<group>"; };
665957BE1B38B356003E97A1 /* CHANGELOG */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CHANGELOG; sourceTree = "<group>"; };
665957BF1B38B356003E97A1 /* VERSION */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VERSION; sourceTree = "<group>"; };
94056E09185BB3D800EB94BA /* EZAudioRecordExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = EZAudioRecordExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
94056E0C185BB3D800EB94BA /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
94056E0F185BB3D800EB94BA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
@@ -81,30 +120,6 @@
94056E71185BB44200EB94BA /* RecordViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RecordViewController.h; sourceTree = "<group>"; };
94056E72185BB44200EB94BA /* RecordViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RecordViewController.m; sourceTree = "<group>"; };
94056E73185BB44200EB94BA /* RecordViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = RecordViewController.xib; sourceTree = "<group>"; };
9417A74C1867DD3F00D9D37B /* AEFloatConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AEFloatConverter.h; sourceTree = "<group>"; };
9417A74D1867DD3F00D9D37B /* AEFloatConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AEFloatConverter.m; sourceTree = "<group>"; };
9417A74E1867DD3F00D9D37B /* EZAudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudio.h; sourceTree = "<group>"; };
9417A74F1867DD3F00D9D37B /* EZAudio.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudio.m; sourceTree = "<group>"; };
9417A7501867DD3F00D9D37B /* EZAudioFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFile.h; sourceTree = "<group>"; };
9417A7511867DD3F00D9D37B /* EZAudioFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFile.m; sourceTree = "<group>"; };
9417A7521867DD3F00D9D37B /* EZAudioPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlot.h; sourceTree = "<group>"; };
9417A7531867DD3F00D9D37B /* EZAudioPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlot.m; sourceTree = "<group>"; };
9417A7541867DD3F00D9D37B /* EZAudioPlotGL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGL.h; sourceTree = "<group>"; };
9417A7551867DD3F00D9D37B /* EZAudioPlotGL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGL.m; sourceTree = "<group>"; };
9417A7561867DD3F00D9D37B /* EZAudioPlotGLKViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGLKViewController.h; sourceTree = "<group>"; };
9417A7571867DD3F00D9D37B /* EZAudioPlotGLKViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGLKViewController.m; sourceTree = "<group>"; };
9417A7581867DD3F00D9D37B /* EZMicrophone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZMicrophone.h; sourceTree = "<group>"; };
9417A7591867DD3F00D9D37B /* EZMicrophone.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZMicrophone.m; sourceTree = "<group>"; };
9417A75A1867DD3F00D9D37B /* EZOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZOutput.h; sourceTree = "<group>"; };
9417A75B1867DD3F00D9D37B /* EZOutput.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZOutput.m; sourceTree = "<group>"; };
9417A75C1867DD3F00D9D37B /* EZPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZPlot.h; sourceTree = "<group>"; };
9417A75D1867DD3F00D9D37B /* EZPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZPlot.m; sourceTree = "<group>"; };
9417A75E1867DD3F00D9D37B /* EZRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZRecorder.h; sourceTree = "<group>"; };
9417A75F1867DD3F00D9D37B /* EZRecorder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZRecorder.m; sourceTree = "<group>"; };
9417A7601867DD3F00D9D37B /* TPCircularBuffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = TPCircularBuffer.c; sourceTree = "<group>"; };
9417A7611867DD3F00D9D37B /* TPCircularBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TPCircularBuffer.h; sourceTree = "<group>"; };
9417A7631867DD3F00D9D37B /* CHANGELOG */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CHANGELOG; sourceTree = "<group>"; };
9417A7641867DD3F00D9D37B /* VERSION */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VERSION; sourceTree = "<group>"; };
941D71A9186298AA007D52D8 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */
@@ -136,6 +151,56 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
6659579C1B38B356003E97A1 /* EZAudio */ = {
isa = PBXGroup;
children = (
6659579D1B38B356003E97A1 /* AEFloatConverter.h */,
6659579E1B38B356003E97A1 /* AEFloatConverter.m */,
6659579F1B38B356003E97A1 /* EZAudio.h */,
665957A01B38B356003E97A1 /* EZAudio.m */,
665957A11B38B356003E97A1 /* EZAudioDevice.h */,
665957A21B38B356003E97A1 /* EZAudioDevice.m */,
665957A31B38B356003E97A1 /* EZAudioFile.h */,
665957A41B38B356003E97A1 /* EZAudioFile.m */,
665957A51B38B356003E97A1 /* EZAudioFloatConverter.h */,
665957A61B38B356003E97A1 /* EZAudioFloatConverter.m */,
665957A71B38B356003E97A1 /* EZAudioFloatData.h */,
665957A81B38B356003E97A1 /* EZAudioFloatData.m */,
665957A91B38B356003E97A1 /* EZAudioPlayer.h */,
665957AA1B38B356003E97A1 /* EZAudioPlayer.m */,
665957AB1B38B356003E97A1 /* EZAudioPlot.h */,
665957AC1B38B356003E97A1 /* EZAudioPlot.m */,
665957AD1B38B356003E97A1 /* EZAudioPlotGL.h */,
665957AE1B38B356003E97A1 /* EZAudioPlotGL.m */,
665957AF1B38B356003E97A1 /* EZAudioPlotGLKViewController.h */,
665957B01B38B356003E97A1 /* EZAudioPlotGLKViewController.m */,
665957B11B38B356003E97A1 /* EZAudioUtilities.h */,
665957B21B38B356003E97A1 /* EZAudioUtilities.m */,
665957B31B38B356003E97A1 /* EZMicrophone.h */,
665957B41B38B356003E97A1 /* EZMicrophone.m */,
665957B51B38B356003E97A1 /* EZOutput.h */,
665957B61B38B356003E97A1 /* EZOutput.m */,
665957B71B38B356003E97A1 /* EZPlot.h */,
665957B81B38B356003E97A1 /* EZPlot.m */,
665957B91B38B356003E97A1 /* EZRecorder.h */,
665957BA1B38B356003E97A1 /* EZRecorder.m */,
665957BB1B38B356003E97A1 /* TPCircularBuffer.c */,
665957BC1B38B356003E97A1 /* TPCircularBuffer.h */,
665957BD1B38B356003E97A1 /* VERSION */,
);
name = EZAudio;
path = ../../../../EZAudio;
sourceTree = "<group>";
};
665957BD1B38B356003E97A1 /* VERSION */ = {
isa = PBXGroup;
children = (
665957BE1B38B356003E97A1 /* CHANGELOG */,
665957BF1B38B356003E97A1 /* VERSION */,
);
path = VERSION;
sourceTree = "<group>";
};
94056E00185BB3D800EB94BA = {
isa = PBXGroup;
children = (
@@ -185,7 +250,7 @@
94056E12185BB3D800EB94BA /* EZAudioRecordExample */ = {
isa = PBXGroup;
children = (
9417A74B1867DD3F00D9D37B /* EZAudio */,
6659579C1B38B356003E97A1 /* EZAudio */,
94056E1E185BB3D800EB94BA /* AppDelegate.h */,
94056E1F185BB3D800EB94BA /* AppDelegate.m */,
94056E21185BB3D800EB94BA /* MainMenu.xib */,
@@ -228,46 +293,6 @@
name = "Supporting Files";
sourceTree = "<group>";
};
9417A74B1867DD3F00D9D37B /* EZAudio */ = {
isa = PBXGroup;
children = (
9417A74C1867DD3F00D9D37B /* AEFloatConverter.h */,
9417A74D1867DD3F00D9D37B /* AEFloatConverter.m */,
9417A74E1867DD3F00D9D37B /* EZAudio.h */,
9417A74F1867DD3F00D9D37B /* EZAudio.m */,
9417A7501867DD3F00D9D37B /* EZAudioFile.h */,
9417A7511867DD3F00D9D37B /* EZAudioFile.m */,
9417A7521867DD3F00D9D37B /* EZAudioPlot.h */,
9417A7531867DD3F00D9D37B /* EZAudioPlot.m */,
9417A7541867DD3F00D9D37B /* EZAudioPlotGL.h */,
9417A7551867DD3F00D9D37B /* EZAudioPlotGL.m */,
9417A7561867DD3F00D9D37B /* EZAudioPlotGLKViewController.h */,
9417A7571867DD3F00D9D37B /* EZAudioPlotGLKViewController.m */,
9417A7581867DD3F00D9D37B /* EZMicrophone.h */,
9417A7591867DD3F00D9D37B /* EZMicrophone.m */,
9417A75A1867DD3F00D9D37B /* EZOutput.h */,
9417A75B1867DD3F00D9D37B /* EZOutput.m */,
9417A75C1867DD3F00D9D37B /* EZPlot.h */,
9417A75D1867DD3F00D9D37B /* EZPlot.m */,
9417A75E1867DD3F00D9D37B /* EZRecorder.h */,
9417A75F1867DD3F00D9D37B /* EZRecorder.m */,
9417A7601867DD3F00D9D37B /* TPCircularBuffer.c */,
9417A7611867DD3F00D9D37B /* TPCircularBuffer.h */,
9417A7621867DD3F00D9D37B /* VERSION */,
);
name = EZAudio;
path = ../../../../EZAudio;
sourceTree = "<group>";
};
9417A7621867DD3F00D9D37B /* VERSION */ = {
isa = PBXGroup;
children = (
9417A7631867DD3F00D9D37B /* CHANGELOG */,
9417A7641867DD3F00D9D37B /* VERSION */,
);
path = VERSION;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -345,12 +370,12 @@
buildActionMask = 2147483647;
files = (
94056E17185BB3D800EB94BA /* InfoPlist.strings in Resources */,
9417A7711867DD3F00D9D37B /* VERSION in Resources */,
665957D11B38B356003E97A1 /* VERSION in Resources */,
94056E75185BB44200EB94BA /* RecordViewController.xib in Resources */,
94056E25185BB3D800EB94BA /* Images.xcassets in Resources */,
94056E1D185BB3D800EB94BA /* Credits.rtf in Resources */,
94056E23185BB3D800EB94BA /* MainMenu.xib in Resources */,
9417A7701867DD3F00D9D37B /* CHANGELOG in Resources */,
665957D01B38B356003E97A1 /* CHANGELOG in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -369,20 +394,25 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9417A76F1867DD3F00D9D37B /* TPCircularBuffer.c in Sources */,
9417A76C1867DD3F00D9D37B /* EZOutput.m in Sources */,
9417A76A1867DD3F00D9D37B /* EZAudioPlotGLKViewController.m in Sources */,
665957CE1B38B356003E97A1 /* EZRecorder.m in Sources */,
94056E74185BB44200EB94BA /* RecordViewController.m in Sources */,
9417A7651867DD3F00D9D37B /* AEFloatConverter.m in Sources */,
665957C41B38B356003E97A1 /* EZAudioFloatConverter.m in Sources */,
665957C51B38B356003E97A1 /* EZAudioFloatData.m in Sources */,
665957C01B38B356003E97A1 /* AEFloatConverter.m in Sources */,
665957C31B38B356003E97A1 /* EZAudioFile.m in Sources */,
665957CC1B38B356003E97A1 /* EZOutput.m in Sources */,
665957C81B38B356003E97A1 /* EZAudioPlotGL.m in Sources */,
665957CF1B38B356003E97A1 /* TPCircularBuffer.c in Sources */,
665957C71B38B356003E97A1 /* EZAudioPlot.m in Sources */,
94056E20185BB3D800EB94BA /* AppDelegate.m in Sources */,
9417A7681867DD3F00D9D37B /* EZAudioPlot.m in Sources */,
9417A7671867DD3F00D9D37B /* EZAudioFile.m in Sources */,
9417A7691867DD3F00D9D37B /* EZAudioPlotGL.m in Sources */,
665957CB1B38B356003E97A1 /* EZMicrophone.m in Sources */,
665957C61B38B356003E97A1 /* EZAudioPlayer.m in Sources */,
665957C21B38B356003E97A1 /* EZAudioDevice.m in Sources */,
94056E19185BB3D800EB94BA /* main.m in Sources */,
9417A76D1867DD3F00D9D37B /* EZPlot.m in Sources */,
9417A76B1867DD3F00D9D37B /* EZMicrophone.m in Sources */,
9417A76E1867DD3F00D9D37B /* EZRecorder.m in Sources */,
9417A7661867DD3F00D9D37B /* EZAudio.m in Sources */,
665957CD1B38B356003E97A1 /* EZPlot.m in Sources */,
665957C11B38B356003E97A1 /* EZAudio.m in Sources */,
665957CA1B38B356003E97A1 /* EZAudioUtilities.m in Sources */,
665957C91B38B356003E97A1 /* EZAudioPlotGLKViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -25,9 +25,7 @@
#import "RecordViewController.h"
@interface RecordViewController (){
BOOL _hasSomethingToPlay;
}
@interface RecordViewController ()
@property (nonatomic,strong) AVAudioPlayer *audioPlayer;
@property (nonatomic,weak) IBOutlet NSButton *microphoneToggle;
@property (nonatomic,weak) IBOutlet NSButton *playButton;
@@ -35,53 +33,18 @@
@end
@implementation RecordViewController
@synthesize audioPlayer;
@synthesize audioPlot;
@synthesize isRecording;
@synthesize microphone;
@synthesize microphoneToggle;
@synthesize recorder;
@synthesize recordingToggle;
#pragma mark - Initialization
-(id)init {
self = [super initWithNibName:NSStringFromClass(self.class) bundle:nil];
if(self){
[self initializeViewController];
}
return self;
}
-(id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithNibName:NSStringFromClass(self.class) bundle:nil];
if(self){
[self initializeViewController];
}
return self;
}
-(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:NSStringFromClass(self.class) bundle:nil];
if(self){
[self initializeViewController];
}
return self;
}
#pragma mark - Initialize View Controller
-(void)initializeViewController {
// Create an instance of the microphone and tell it to use this view controller instance as the delegate
self.microphone = [EZMicrophone microphoneWithDelegate:self];
}
//------------------------------------------------------------------------------
#pragma mark - Customize the Audio Plot
//------------------------------------------------------------------------------
-(void)awakeFromNib
{
/*
Customizing the audio plot's look
*/
// Background color
self.audioPlot.backgroundColor = [NSColor colorWithCalibratedRed: 0.175 green: 0.151 blue: 0.137 alpha: 1];
self.audioPlot.backgroundColor = [NSColor colorWithCalibratedRed: 0.984 green: 0.71 blue: 0.365 alpha: 1];
// Waveform color
self.audioPlot.color = [NSColor colorWithCalibratedRed: 1.000 green: 1.000 blue: 1.000 alpha: 1];
// Plot type
@@ -97,62 +60,77 @@
/*
Start the microphone
*/
[self.microphone startFetchingAudio];
self.microphone = [EZMicrophone microphoneWithDelegate:self startsImmediately:YES];
}
//------------------------------------------------------------------------------
#pragma mark - Actions
-(void)playFile:(id)sender {
//------------------------------------------------------------------------------
-(void)playFile:(id)sender
{
//
// Update microphone state
//
[self.microphone stopFetchingAudio];
self.microphoneToggle.state = NSOffState;
[self.microphoneToggle setEnabled:NO];
//
// Update recording state
//
self.isRecording = NO;
self.recordingToggle.state = NSOffState;
[self.recordingToggle setEnabled:NO];
// Create Audio Player
if( self.audioPlayer )
{
if( self.audioPlayer.playing ) [self.audioPlayer stop];
self.audioPlayer = nil;
}
//
// Close the audio file
if( self.recorder )
//
if (self.recorder)
{
[self.recorder closeAudioFile];
}
//
// Create audio player
//
if (self.audioPlayer)
{
if (self.audioPlayer.playing) [self.audioPlayer stop];
self.audioPlayer = nil;
}
NSError *err;
self.audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:kAudioFilePath]
error:&err];
error:&err];
[self.audioPlayer play];
self.audioPlayer.delegate = self;
}
-(void)toggleMicrophone:(id)sender {
switch([sender state]){
case NSOffState:
[self.microphone stopFetchingAudio];
break;
case NSOnState:
[self.microphone startFetchingAudio];
break;
default:
break;
}
//------------------------------------------------------------------------------
-(void)toggleMicrophone:(id)sender
{
switch([sender state])
{
case NSOffState:
[self.microphone stopFetchingAudio];
break;
case NSOnState:
[self.microphone startFetchingAudio];
break;
default:
break;
}
}
//------------------------------------------------------------------------------
-(void)toggleRecording:(id)sender
{
[self.playButton setHidden:NO];
switch( [sender state] )
switch( [sender state])
{
case NSOffState:
[self.recorder closeAudioFile];
@@ -173,50 +151,65 @@
self.isRecording = (BOOL)[sender state];
}
//------------------------------------------------------------------------------
#pragma mark - EZMicrophoneDelegate
//------------------------------------------------------------------------------
#warning Thread Safety
// Note that any callback that provides streamed audio data (like streaming microphone input) happens on a separate audio thread that should not be blocked. When we feed audio data into any of the UI components we need to explicity create a GCD block on the main thread to properly get the UI to work.
-(void)microphone:(EZMicrophone *)microphone
hasAudioReceived:(float **)buffer
withBufferSize:(UInt32)bufferSize
withNumberOfChannels:(UInt32)numberOfChannels {
withNumberOfChannels:(UInt32)numberOfChannels
{
// Getting audio data as an array of float buffer arrays. What does that mean? Because the audio is coming in as a stereo signal the data is split into a left and right channel. So buffer[0] corresponds to the float* data for the left channel while buffer[1] corresponds to the float* data for the right channel.
// See the Thread Safety warning above, but in a nutshell these callbacks happen on a separate audio thread. We wrap any UI updating in a GCD block on the main thread to avoid blocking that audio flow.
dispatch_async(dispatch_get_main_queue(),^{
__weak typeof (self) weakSelf = self;
dispatch_async(dispatch_get_main_queue(),^{
// All the audio plot needs is the buffer data (float*) and the size. Internally the audio plot will handle all the drawing related code, history management, and freeing its own resources. Hence, one badass line of code gets you a pretty plot :)
[self.audioPlot updateBuffer:buffer[0] withBufferSize:bufferSize];
});
[weakSelf.audioPlot updateBuffer:buffer[0]
withBufferSize:bufferSize];
});
}
//------------------------------------------------------------------------------
// Append the microphone data coming as a AudioBufferList with the specified buffer size to the recorder
-(void)microphone:(EZMicrophone *)microphone
hasBufferList:(AudioBufferList *)bufferList
withBufferSize:(UInt32)bufferSize
withNumberOfChannels:(UInt32)numberOfChannels {
// Getting audio data as a buffer list that can be directly fed into the EZRecorder. This is happening on the audio thread - any UI updating needs a GCD main queue block.
if( self.isRecording ){
[self.recorder appendDataFromBufferList:bufferList
withBufferSize:bufferSize];
}
-(void) microphone:(EZMicrophone *)microphone
hasBufferList:(AudioBufferList *)bufferList
withBufferSize:(UInt32)bufferSize
withNumberOfChannels:(UInt32)numberOfChannels
{
// Getting audio data as a buffer list that can be directly fed into the EZRecorder. This is happening on the audio thread - any UI updating needs a GCD main queue block.
if (self.isRecording)
{
[self.recorder appendDataFromBufferList:bufferList
withBufferSize:bufferSize];
}
}
//------------------------------------------------------------------------------
#pragma mark - AVAudioPlayerDelegate
//------------------------------------------------------------------------------
/*
Occurs when the audio player instance completes playback
*/
-(void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)flag {
// Update microphone state
self.microphoneToggle.state = NSOnState;
[self.microphoneToggle setEnabled:YES];
[self.microphone startFetchingAudio];
// Update recording state
self.isRecording = NO;
self.recordingToggle.state = NSOffState;
[self.recordingToggle setEnabled:YES];
-(void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)player
successfully:(BOOL)flag
{
// Update microphone state
self.microphoneToggle.state = NSOnState;
[self.microphoneToggle setEnabled:YES];
[self.microphone startFetchingAudio];
// Update recording state
self.isRecording = NO;
self.recordingToggle.state = NSOffState;
[self.recordingToggle setEnabled:YES];
}
//------------------------------------------------------------------------------
@end
@@ -7,6 +7,24 @@
objects = {
/* Begin PBXBuildFile section */
6628E25A1B3A1A1C00020E56 /* AEFloatConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E2381B3A1A1B00020E56 /* AEFloatConverter.m */; };
6628E25B1B3A1A1C00020E56 /* EZAudio.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E23A1B3A1A1B00020E56 /* EZAudio.m */; };
6628E25C1B3A1A1C00020E56 /* EZAudioDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E23C1B3A1A1B00020E56 /* EZAudioDevice.m */; };
6628E25D1B3A1A1C00020E56 /* EZAudioFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E23E1B3A1A1B00020E56 /* EZAudioFile.m */; };
6628E25E1B3A1A1C00020E56 /* EZAudioFloatConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E2401B3A1A1B00020E56 /* EZAudioFloatConverter.m */; };
6628E25F1B3A1A1C00020E56 /* EZAudioFloatData.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E2421B3A1A1B00020E56 /* EZAudioFloatData.m */; };
6628E2601B3A1A1C00020E56 /* EZAudioPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E2441B3A1A1B00020E56 /* EZAudioPlayer.m */; };
6628E2611B3A1A1C00020E56 /* EZAudioPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E2461B3A1A1B00020E56 /* EZAudioPlot.m */; };
6628E2621B3A1A1C00020E56 /* EZAudioPlotGL.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E2481B3A1A1B00020E56 /* EZAudioPlotGL.m */; };
6628E2631B3A1A1C00020E56 /* EZAudioPlotGLKViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E24A1B3A1A1B00020E56 /* EZAudioPlotGLKViewController.m */; };
6628E2641B3A1A1C00020E56 /* EZAudioUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E24C1B3A1A1C00020E56 /* EZAudioUtilities.m */; };
6628E2651B3A1A1C00020E56 /* EZMicrophone.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E24E1B3A1A1C00020E56 /* EZMicrophone.m */; };
6628E2661B3A1A1C00020E56 /* EZOutput.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E2501B3A1A1C00020E56 /* EZOutput.m */; };
6628E2671B3A1A1C00020E56 /* EZPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E2521B3A1A1C00020E56 /* EZPlot.m */; };
6628E2681B3A1A1C00020E56 /* EZRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E2541B3A1A1C00020E56 /* EZRecorder.m */; };
6628E2691B3A1A1C00020E56 /* TPCircularBuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 6628E2551B3A1A1C00020E56 /* TPCircularBuffer.c */; };
6628E26A1B3A1A1C00020E56 /* CHANGELOG in Resources */ = {isa = PBXBuildFile; fileRef = 6628E2581B3A1A1C00020E56 /* CHANGELOG */; };
6628E26B1B3A1A1C00020E56 /* VERSION in Resources */ = {isa = PBXBuildFile; fileRef = 6628E2591B3A1A1C00020E56 /* VERSION */; };
94056E83185BCBC000EB94BA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 94056E82185BCBC000EB94BA /* Cocoa.framework */; };
94056E8D185BCBC000EB94BA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 94056E8B185BCBC000EB94BA /* InfoPlist.strings */; };
94056E8F185BCBC000EB94BA /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 94056E8E185BCBC000EB94BA /* main.m */; };
@@ -27,19 +45,6 @@
94056EE9185BCDBF00EB94BA /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 94056EE6185BCDBF00EB94BA /* CoreAudio.framework */; };
94056EEB185BCDC500EB94BA /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 94056EEA185BCDC500EB94BA /* QuartzCore.framework */; };
9417A6D31865927500D9D37B /* simple-drum-beat.wav in Resources */ = {isa = PBXBuildFile; fileRef = 9417A6D21865927500D9D37B /* simple-drum-beat.wav */; };
9417A78C1867DD5400D9D37B /* AEFloatConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7741867DD5400D9D37B /* AEFloatConverter.m */; };
9417A78D1867DD5400D9D37B /* EZAudio.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7761867DD5400D9D37B /* EZAudio.m */; };
9417A78E1867DD5400D9D37B /* EZAudioFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7781867DD5400D9D37B /* EZAudioFile.m */; };
9417A78F1867DD5400D9D37B /* EZAudioPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A77A1867DD5400D9D37B /* EZAudioPlot.m */; };
9417A7901867DD5400D9D37B /* EZAudioPlotGL.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A77C1867DD5400D9D37B /* EZAudioPlotGL.m */; };
9417A7911867DD5400D9D37B /* EZAudioPlotGLKViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A77E1867DD5400D9D37B /* EZAudioPlotGLKViewController.m */; };
9417A7921867DD5400D9D37B /* EZMicrophone.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7801867DD5400D9D37B /* EZMicrophone.m */; };
9417A7931867DD5400D9D37B /* EZOutput.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7821867DD5400D9D37B /* EZOutput.m */; };
9417A7941867DD5400D9D37B /* EZPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7841867DD5400D9D37B /* EZPlot.m */; };
9417A7951867DD5400D9D37B /* EZRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7861867DD5400D9D37B /* EZRecorder.m */; };
9417A7961867DD5400D9D37B /* TPCircularBuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7871867DD5400D9D37B /* TPCircularBuffer.c */; };
9417A7971867DD5400D9D37B /* CHANGELOG in Resources */ = {isa = PBXBuildFile; fileRef = 9417A78A1867DD5400D9D37B /* CHANGELOG */; };
9417A7981867DD5400D9D37B /* VERSION in Resources */ = {isa = PBXBuildFile; fileRef = 9417A78B1867DD5400D9D37B /* VERSION */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -53,6 +58,40 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
6628E2371B3A1A1B00020E56 /* AEFloatConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AEFloatConverter.h; sourceTree = "<group>"; };
6628E2381B3A1A1B00020E56 /* AEFloatConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AEFloatConverter.m; sourceTree = "<group>"; };
6628E2391B3A1A1B00020E56 /* EZAudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudio.h; sourceTree = "<group>"; };
6628E23A1B3A1A1B00020E56 /* EZAudio.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudio.m; sourceTree = "<group>"; };
6628E23B1B3A1A1B00020E56 /* EZAudioDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioDevice.h; sourceTree = "<group>"; };
6628E23C1B3A1A1B00020E56 /* EZAudioDevice.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioDevice.m; sourceTree = "<group>"; };
6628E23D1B3A1A1B00020E56 /* EZAudioFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFile.h; sourceTree = "<group>"; };
6628E23E1B3A1A1B00020E56 /* EZAudioFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFile.m; sourceTree = "<group>"; };
6628E23F1B3A1A1B00020E56 /* EZAudioFloatConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFloatConverter.h; sourceTree = "<group>"; };
6628E2401B3A1A1B00020E56 /* EZAudioFloatConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFloatConverter.m; sourceTree = "<group>"; };
6628E2411B3A1A1B00020E56 /* EZAudioFloatData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFloatData.h; sourceTree = "<group>"; };
6628E2421B3A1A1B00020E56 /* EZAudioFloatData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFloatData.m; sourceTree = "<group>"; };
6628E2431B3A1A1B00020E56 /* EZAudioPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlayer.h; sourceTree = "<group>"; };
6628E2441B3A1A1B00020E56 /* EZAudioPlayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlayer.m; sourceTree = "<group>"; };
6628E2451B3A1A1B00020E56 /* EZAudioPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlot.h; sourceTree = "<group>"; };
6628E2461B3A1A1B00020E56 /* EZAudioPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlot.m; sourceTree = "<group>"; };
6628E2471B3A1A1B00020E56 /* EZAudioPlotGL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGL.h; sourceTree = "<group>"; };
6628E2481B3A1A1B00020E56 /* EZAudioPlotGL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGL.m; sourceTree = "<group>"; };
6628E2491B3A1A1B00020E56 /* EZAudioPlotGLKViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGLKViewController.h; sourceTree = "<group>"; };
6628E24A1B3A1A1B00020E56 /* EZAudioPlotGLKViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGLKViewController.m; sourceTree = "<group>"; };
6628E24B1B3A1A1B00020E56 /* EZAudioUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioUtilities.h; sourceTree = "<group>"; };
6628E24C1B3A1A1C00020E56 /* EZAudioUtilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioUtilities.m; sourceTree = "<group>"; };
6628E24D1B3A1A1C00020E56 /* EZMicrophone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZMicrophone.h; sourceTree = "<group>"; };
6628E24E1B3A1A1C00020E56 /* EZMicrophone.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZMicrophone.m; sourceTree = "<group>"; };
6628E24F1B3A1A1C00020E56 /* EZOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZOutput.h; sourceTree = "<group>"; };
6628E2501B3A1A1C00020E56 /* EZOutput.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZOutput.m; sourceTree = "<group>"; };
6628E2511B3A1A1C00020E56 /* EZPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZPlot.h; sourceTree = "<group>"; };
6628E2521B3A1A1C00020E56 /* EZPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZPlot.m; sourceTree = "<group>"; };
6628E2531B3A1A1C00020E56 /* EZRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZRecorder.h; sourceTree = "<group>"; };
6628E2541B3A1A1C00020E56 /* EZRecorder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZRecorder.m; sourceTree = "<group>"; };
6628E2551B3A1A1C00020E56 /* TPCircularBuffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = TPCircularBuffer.c; sourceTree = "<group>"; };
6628E2561B3A1A1C00020E56 /* TPCircularBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TPCircularBuffer.h; sourceTree = "<group>"; };
6628E2581B3A1A1C00020E56 /* CHANGELOG */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CHANGELOG; sourceTree = "<group>"; };
6628E2591B3A1A1C00020E56 /* VERSION */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VERSION; sourceTree = "<group>"; };
94056E7F185BCBC000EB94BA /* EZAudioWaveformFromFileExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = EZAudioWaveformFromFileExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
94056E82185BCBC000EB94BA /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
94056E85185BCBC000EB94BA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
@@ -82,30 +121,6 @@
94056EE6185BCDBF00EB94BA /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = System/Library/Frameworks/CoreAudio.framework; sourceTree = SDKROOT; };
94056EEA185BCDC500EB94BA /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
9417A6D21865927500D9D37B /* simple-drum-beat.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = "simple-drum-beat.wav"; path = "../../../simple-drum-beat.wav"; sourceTree = "<group>"; };
9417A7731867DD5400D9D37B /* AEFloatConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AEFloatConverter.h; sourceTree = "<group>"; };
9417A7741867DD5400D9D37B /* AEFloatConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AEFloatConverter.m; sourceTree = "<group>"; };
9417A7751867DD5400D9D37B /* EZAudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudio.h; sourceTree = "<group>"; };
9417A7761867DD5400D9D37B /* EZAudio.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudio.m; sourceTree = "<group>"; };
9417A7771867DD5400D9D37B /* EZAudioFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFile.h; sourceTree = "<group>"; };
9417A7781867DD5400D9D37B /* EZAudioFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFile.m; sourceTree = "<group>"; };
9417A7791867DD5400D9D37B /* EZAudioPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlot.h; sourceTree = "<group>"; };
9417A77A1867DD5400D9D37B /* EZAudioPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlot.m; sourceTree = "<group>"; };
9417A77B1867DD5400D9D37B /* EZAudioPlotGL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGL.h; sourceTree = "<group>"; };
9417A77C1867DD5400D9D37B /* EZAudioPlotGL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGL.m; sourceTree = "<group>"; };
9417A77D1867DD5400D9D37B /* EZAudioPlotGLKViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGLKViewController.h; sourceTree = "<group>"; };
9417A77E1867DD5400D9D37B /* EZAudioPlotGLKViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGLKViewController.m; sourceTree = "<group>"; };
9417A77F1867DD5400D9D37B /* EZMicrophone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZMicrophone.h; sourceTree = "<group>"; };
9417A7801867DD5400D9D37B /* EZMicrophone.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZMicrophone.m; sourceTree = "<group>"; };
9417A7811867DD5400D9D37B /* EZOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZOutput.h; sourceTree = "<group>"; };
9417A7821867DD5400D9D37B /* EZOutput.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZOutput.m; sourceTree = "<group>"; };
9417A7831867DD5400D9D37B /* EZPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZPlot.h; sourceTree = "<group>"; };
9417A7841867DD5400D9D37B /* EZPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZPlot.m; sourceTree = "<group>"; };
9417A7851867DD5400D9D37B /* EZRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZRecorder.h; sourceTree = "<group>"; };
9417A7861867DD5400D9D37B /* EZRecorder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZRecorder.m; sourceTree = "<group>"; };
9417A7871867DD5400D9D37B /* TPCircularBuffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = TPCircularBuffer.c; sourceTree = "<group>"; };
9417A7881867DD5400D9D37B /* TPCircularBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TPCircularBuffer.h; sourceTree = "<group>"; };
9417A78A1867DD5400D9D37B /* CHANGELOG */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CHANGELOG; sourceTree = "<group>"; };
9417A78B1867DD5400D9D37B /* VERSION */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VERSION; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -135,6 +150,56 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
6628E2361B3A1A1B00020E56 /* EZAudio */ = {
isa = PBXGroup;
children = (
6628E2371B3A1A1B00020E56 /* AEFloatConverter.h */,
6628E2381B3A1A1B00020E56 /* AEFloatConverter.m */,
6628E2391B3A1A1B00020E56 /* EZAudio.h */,
6628E23A1B3A1A1B00020E56 /* EZAudio.m */,
6628E23B1B3A1A1B00020E56 /* EZAudioDevice.h */,
6628E23C1B3A1A1B00020E56 /* EZAudioDevice.m */,
6628E23D1B3A1A1B00020E56 /* EZAudioFile.h */,
6628E23E1B3A1A1B00020E56 /* EZAudioFile.m */,
6628E23F1B3A1A1B00020E56 /* EZAudioFloatConverter.h */,
6628E2401B3A1A1B00020E56 /* EZAudioFloatConverter.m */,
6628E2411B3A1A1B00020E56 /* EZAudioFloatData.h */,
6628E2421B3A1A1B00020E56 /* EZAudioFloatData.m */,
6628E2431B3A1A1B00020E56 /* EZAudioPlayer.h */,
6628E2441B3A1A1B00020E56 /* EZAudioPlayer.m */,
6628E2451B3A1A1B00020E56 /* EZAudioPlot.h */,
6628E2461B3A1A1B00020E56 /* EZAudioPlot.m */,
6628E2471B3A1A1B00020E56 /* EZAudioPlotGL.h */,
6628E2481B3A1A1B00020E56 /* EZAudioPlotGL.m */,
6628E2491B3A1A1B00020E56 /* EZAudioPlotGLKViewController.h */,
6628E24A1B3A1A1B00020E56 /* EZAudioPlotGLKViewController.m */,
6628E24B1B3A1A1B00020E56 /* EZAudioUtilities.h */,
6628E24C1B3A1A1C00020E56 /* EZAudioUtilities.m */,
6628E24D1B3A1A1C00020E56 /* EZMicrophone.h */,
6628E24E1B3A1A1C00020E56 /* EZMicrophone.m */,
6628E24F1B3A1A1C00020E56 /* EZOutput.h */,
6628E2501B3A1A1C00020E56 /* EZOutput.m */,
6628E2511B3A1A1C00020E56 /* EZPlot.h */,
6628E2521B3A1A1C00020E56 /* EZPlot.m */,
6628E2531B3A1A1C00020E56 /* EZRecorder.h */,
6628E2541B3A1A1C00020E56 /* EZRecorder.m */,
6628E2551B3A1A1C00020E56 /* TPCircularBuffer.c */,
6628E2561B3A1A1C00020E56 /* TPCircularBuffer.h */,
6628E2571B3A1A1C00020E56 /* VERSION */,
);
name = EZAudio;
path = ../../../../EZAudio;
sourceTree = "<group>";
};
6628E2571B3A1A1C00020E56 /* VERSION */ = {
isa = PBXGroup;
children = (
6628E2581B3A1A1C00020E56 /* CHANGELOG */,
6628E2591B3A1A1C00020E56 /* VERSION */,
);
path = VERSION;
sourceTree = "<group>";
};
94056E76185BCBC000EB94BA = {
isa = PBXGroup;
children = (
@@ -183,14 +248,14 @@
94056E88185BCBC000EB94BA /* EZAudioWaveformFromFileExample */ = {
isa = PBXGroup;
children = (
9417A7721867DD5400D9D37B /* EZAudio */,
6628E2361B3A1A1B00020E56 /* EZAudio */,
94056E94185BCBC000EB94BA /* AppDelegate.h */,
94056E95185BCBC000EB94BA /* AppDelegate.m */,
9417A6D21865927500D9D37B /* simple-drum-beat.wav */,
94056EDB185BCC0100EB94BA /* WaveformFromFileViewController.h */,
94056EDC185BCC0200EB94BA /* WaveformFromFileViewController.m */,
94056EDD185BCC0200EB94BA /* WaveformFromFileViewController.xib */,
94056E97185BCBC000EB94BA /* MainMenu.xib */,
9417A6D21865927500D9D37B /* simple-drum-beat.wav */,
94056E9A185BCBC000EB94BA /* Images.xcassets */,
94056E89185BCBC000EB94BA /* Supporting Files */,
);
@@ -227,46 +292,6 @@
name = "Supporting Files";
sourceTree = "<group>";
};
9417A7721867DD5400D9D37B /* EZAudio */ = {
isa = PBXGroup;
children = (
9417A7731867DD5400D9D37B /* AEFloatConverter.h */,
9417A7741867DD5400D9D37B /* AEFloatConverter.m */,
9417A7751867DD5400D9D37B /* EZAudio.h */,
9417A7761867DD5400D9D37B /* EZAudio.m */,
9417A7771867DD5400D9D37B /* EZAudioFile.h */,
9417A7781867DD5400D9D37B /* EZAudioFile.m */,
9417A7791867DD5400D9D37B /* EZAudioPlot.h */,
9417A77A1867DD5400D9D37B /* EZAudioPlot.m */,
9417A77B1867DD5400D9D37B /* EZAudioPlotGL.h */,
9417A77C1867DD5400D9D37B /* EZAudioPlotGL.m */,
9417A77D1867DD5400D9D37B /* EZAudioPlotGLKViewController.h */,
9417A77E1867DD5400D9D37B /* EZAudioPlotGLKViewController.m */,
9417A77F1867DD5400D9D37B /* EZMicrophone.h */,
9417A7801867DD5400D9D37B /* EZMicrophone.m */,
9417A7811867DD5400D9D37B /* EZOutput.h */,
9417A7821867DD5400D9D37B /* EZOutput.m */,
9417A7831867DD5400D9D37B /* EZPlot.h */,
9417A7841867DD5400D9D37B /* EZPlot.m */,
9417A7851867DD5400D9D37B /* EZRecorder.h */,
9417A7861867DD5400D9D37B /* EZRecorder.m */,
9417A7871867DD5400D9D37B /* TPCircularBuffer.c */,
9417A7881867DD5400D9D37B /* TPCircularBuffer.h */,
9417A7891867DD5400D9D37B /* VERSION */,
);
name = EZAudio;
path = ../../../../EZAudio;
sourceTree = "<group>";
};
9417A7891867DD5400D9D37B /* VERSION */ = {
isa = PBXGroup;
children = (
9417A78A1867DD5400D9D37B /* CHANGELOG */,
9417A78B1867DD5400D9D37B /* VERSION */,
);
path = VERSION;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -345,10 +370,10 @@
files = (
94056E8D185BCBC000EB94BA /* InfoPlist.strings in Resources */,
94056E9B185BCBC000EB94BA /* Images.xcassets in Resources */,
9417A7971867DD5400D9D37B /* CHANGELOG in Resources */,
6628E26A1B3A1A1C00020E56 /* CHANGELOG in Resources */,
9417A6D31865927500D9D37B /* simple-drum-beat.wav in Resources */,
94056EDF185BCC0200EB94BA /* WaveformFromFileViewController.xib in Resources */,
9417A7981867DD5400D9D37B /* VERSION in Resources */,
6628E26B1B3A1A1C00020E56 /* VERSION in Resources */,
94056E93185BCBC000EB94BA /* Credits.rtf in Resources */,
94056E99185BCBC000EB94BA /* MainMenu.xib in Resources */,
);
@@ -369,20 +394,25 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9417A7961867DD5400D9D37B /* TPCircularBuffer.c in Sources */,
9417A7931867DD5400D9D37B /* EZOutput.m in Sources */,
9417A7911867DD5400D9D37B /* EZAudioPlotGLKViewController.m in Sources */,
6628E2681B3A1A1C00020E56 /* EZRecorder.m in Sources */,
94056E96185BCBC000EB94BA /* AppDelegate.m in Sources */,
9417A78C1867DD5400D9D37B /* AEFloatConverter.m in Sources */,
6628E25E1B3A1A1C00020E56 /* EZAudioFloatConverter.m in Sources */,
6628E25F1B3A1A1C00020E56 /* EZAudioFloatData.m in Sources */,
6628E25A1B3A1A1C00020E56 /* AEFloatConverter.m in Sources */,
6628E25D1B3A1A1C00020E56 /* EZAudioFile.m in Sources */,
6628E2661B3A1A1C00020E56 /* EZOutput.m in Sources */,
6628E2621B3A1A1C00020E56 /* EZAudioPlotGL.m in Sources */,
6628E2691B3A1A1C00020E56 /* TPCircularBuffer.c in Sources */,
6628E2611B3A1A1C00020E56 /* EZAudioPlot.m in Sources */,
94056EDE185BCC0200EB94BA /* WaveformFromFileViewController.m in Sources */,
9417A78F1867DD5400D9D37B /* EZAudioPlot.m in Sources */,
9417A78E1867DD5400D9D37B /* EZAudioFile.m in Sources */,
9417A7901867DD5400D9D37B /* EZAudioPlotGL.m in Sources */,
6628E2651B3A1A1C00020E56 /* EZMicrophone.m in Sources */,
6628E2601B3A1A1C00020E56 /* EZAudioPlayer.m in Sources */,
6628E25C1B3A1A1C00020E56 /* EZAudioDevice.m in Sources */,
94056E8F185BCBC000EB94BA /* main.m in Sources */,
9417A7941867DD5400D9D37B /* EZPlot.m in Sources */,
9417A7921867DD5400D9D37B /* EZMicrophone.m in Sources */,
9417A7951867DD5400D9D37B /* EZRecorder.m in Sources */,
9417A78D1867DD5400D9D37B /* EZAudio.m in Sources */,
6628E2671B3A1A1C00020E56 /* EZPlot.m in Sources */,
6628E25B1B3A1A1C00020E56 /* EZAudio.m in Sources */,
6628E2641B3A1A1C00020E56 /* EZAudioUtilities.m in Sources */,
6628E2631B3A1A1C00020E56 /* EZAudioPlotGLKViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -35,34 +35,54 @@
@interface WaveformFromFileViewController : NSViewController <NSOpenSavePanelDelegate>
//------------------------------------------------------------------------------
#pragma mark - Components
//------------------------------------------------------------------------------
/**
The EZAudioFile representing of the currently selected audio file
*/
@property (nonatomic,strong) EZAudioFile *audioFile;
//------------------------------------------------------------------------------
/**
The CoreGraphics based audio plot
*/
@property (nonatomic,weak) IBOutlet EZAudioPlot *audioPlot;
//------------------------------------------------------------------------------
/**
A BOOL indicating whether or not we've reached the end of the file
*/
@property (nonatomic,assign) BOOL eof;
//------------------------------------------------------------------------------
#pragma mark - UI Extras
//------------------------------------------------------------------------------
/**
A label to display the current file path with the waveform shown
*/
@property (nonatomic,weak) IBOutlet NSTextField *filePathLabel;
//------------------------------------------------------------------------------
#pragma mark - Actions
//------------------------------------------------------------------------------
/**
Prompts the file manager and loads in a new audio file into the EZAudioFile representation.
*/
-(IBAction)openFile:(id)sender;
//------------------------------------------------------------------------------
/**
Shows how to take a snapshot of the Core Graphics based waveform and save it to the file path: ~/Documents/waveform.png
*/
-(IBAction)snapshot:(id)sender;
//------------------------------------------------------------------------------
@end
@@ -25,117 +25,108 @@
#import "WaveformFromFileViewController.h"
@interface WaveformFromFileViewController (){
AudioBufferList *readBuffer;
}
@end
@implementation WaveformFromFileViewController
@synthesize audioFile;
@synthesize audioPlot;
@synthesize eof = _eof;
#pragma mark - Initialization
-(id)init {
self = [super initWithNibName:NSStringFromClass(self.class) bundle:nil];
if(self){
[self initializeViewController];
}
return self;
}
-(id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithNibName:NSStringFromClass(self.class) bundle:nil];
if(self){
[self initializeViewController];
}
return self;
}
-(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:NSStringFromClass(self.class) bundle:nil];
if(self){
[self initializeViewController];
}
return self;
}
#pragma mark - Initialize View Controller
-(void)initializeViewController {
}
//------------------------------------------------------------------------------
#pragma mark - Customize the Audio Plot
-(void)awakeFromNib {
self.audioPlot.wantsLayer = YES;
self.audioPlot.backgroundColor = [NSColor clearColor];
//------------------------------------------------------------------------------
-(void)awakeFromNib
{
//
//Customizing the audio plot's look
//
// Background color
self.audioPlot.backgroundColor = [NSColor colorWithCalibratedRed: 0.169 green: 0.643 blue: 0.675 alpha: 1];
// Waveform color
self.audioPlot.color = [NSColor colorWithCalibratedRed: 1.000 green: 1.000 blue: 1.000 alpha: 1];
// Plot type
self.audioPlot.plotType = EZPlotTypeBuffer;
// Fill
self.audioPlot.shouldFill = YES;
// Mirror
self.audioPlot.shouldMirror = YES;
self.audioPlot.color = [NSColor colorWithCalibratedRed:0
green:0.676
blue:0.575
alpha:1];
//
// Open the default file included with the example
//
[self openFileWithFilePathURL:[NSURL fileURLWithPath:kAudioFileDefault]];
}
//------------------------------------------------------------------------------
#pragma mark - Actions
-(void)openFile:(id)sender {
NSOpenPanel* openDlg = [NSOpenPanel openPanel];
openDlg.canChooseFiles = YES;
openDlg.canChooseDirectories = NO;
openDlg.delegate = self;
if( [openDlg runModal] == NSOKButton ){
NSArray *selectedFiles = [openDlg URLs];
[self openFileWithFilePathURL:selectedFiles.firstObject];
}
//------------------------------------------------------------------------------
- (void)openFile:(id)sender
{
NSOpenPanel *openDlg = [NSOpenPanel openPanel];
openDlg.canChooseFiles = YES;
openDlg.canChooseDirectories = NO;
openDlg.delegate = self;
if ([openDlg runModal] == NSOKButton)
{
NSArray *selectedFiles = [openDlg URLs];
[self openFileWithFilePathURL:selectedFiles.firstObject];
}
}
//------------------------------------------------------------------------------
- (void)snapshot:(id)sender
{
NSBitmapImageRep* imageRep = [self.audioPlot bitmapImageRepForCachingDisplayInRect:self.audioPlot.bounds];
NSBitmapImageRep *imageRep = [self.audioPlot bitmapImageRepForCachingDisplayInRect:self.audioPlot.bounds];
[self.audioPlot cacheDisplayInRect:self.audioPlot.bounds toBitmapImageRep:imageRep];
NSData* data = [imageRep representationUsingType:NSPNGFileType properties:nil];
[data writeToFile:@"/Users/haris/Documents/waveform.png" atomically:NO];
NSData *data = [imageRep representationUsingType:NSPNGFileType properties:nil];
NSString *filePath = [NSString stringWithFormat:@"%@/Documents/waveform.png",NSHomeDirectory()];
[data writeToFile:filePath atomically:NO];
}
//------------------------------------------------------------------------------
#pragma mark - Action Extensions
-(void)openFileWithFilePathURL:(NSURL*)filePathURL {
self.audioFile = [EZAudioFile audioFileWithURL:filePathURL];
self.eof = NO;
self.filePathLabel.stringValue = filePathURL.lastPathComponent;
// 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];
}];
//------------------------------------------------------------------------------
- (void)openFileWithFilePathURL:(NSURL*)filePathURL
{
//
// Load the audio file and customize the UI
//
self.audioFile = [EZAudioFile audioFileWithURL:filePathURL];
self.eof = NO;
self.filePathLabel.stringValue = filePathURL.lastPathComponent;
//
// Change back to a buffer plot, but mirror and fill the waveform
//
self.audioPlot.plotType = EZPlotTypeBuffer;
self.audioPlot.shouldFill = YES;
self.audioPlot.shouldMirror = YES;
//
// Plot the whole waveform
//
__weak typeof (self) weakSelf = self;
[self.audioFile getWaveformDataWithCompletionBlock:^(float *waveformData,
UInt32 length)
{
[weakSelf.audioPlot updateBuffer:waveformData
withBufferSize:length];
}];
}
//------------------------------------------------------------------------------
#pragma mark - NSOpenSavePanelDelegate
//------------------------------------------------------------------------------
/**
Here's an example how to filter the open panel to only show the supported file types by the EZAudioFile (which are just the audio file types supported by Core Audio).
*/
-(BOOL)panel:(id)sender shouldShowFilename:(NSString *)filename {
NSString* ext = [filename pathExtension];
if ([ext isEqualToString:@""] || [ext isEqualToString:@"/"] || ext == nil || ext == NULL || [ext length] < 1) {
return YES;
}
NSArray *fileTypes = [EZAudioFile supportedAudioFileTypes];
NSEnumerator* tagEnumerator = [fileTypes objectEnumerator];
NSString* allowedExt;
while ((allowedExt = [tagEnumerator nextObject]))
{
if ([ext caseInsensitiveCompare:allowedExt] == NSOrderedSame)
{
return YES;
}
}
return NO;
- (BOOL)panel:(id)sender shouldShowFilename:(NSString *)filename
{
NSString *ext = [filename pathExtension];
NSArray *fileTypes = [EZAudioFile supportedAudioFileTypes];
BOOL isDirectory = [ext isEqualToString:@""];
return [fileTypes containsObject:ext] || isDirectory;
}
//------------------------------------------------------------------------------
@end
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6245" systemVersion="13F34" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="7702" systemVersion="14C109" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment version="1070" identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6245"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="7702"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="WaveformFromFileViewController">
@@ -45,7 +45,7 @@
</textField>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="2Q5-5T-qQ4">
<rect key="frame" x="375" y="224" width="97" height="32"/>
<buttonCell key="cell" type="push" title="snapshot" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="8ht-Cu-65q">
<buttonCell key="cell" type="push" title="Snapshot" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="8ht-Cu-65q">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
BIN
View File
Binary file not shown.
@@ -7,14 +7,31 @@
objects = {
/* Begin PBXBuildFile section */
6628E0D41B39D8CB00020E56 /* AEFloatConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E0B21B39D8CB00020E56 /* AEFloatConverter.m */; };
6628E0D51B39D8CB00020E56 /* EZAudio.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E0B41B39D8CB00020E56 /* EZAudio.m */; };
6628E0D61B39D8CB00020E56 /* EZAudioDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E0B61B39D8CB00020E56 /* EZAudioDevice.m */; };
6628E0D71B39D8CB00020E56 /* EZAudioFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E0B81B39D8CB00020E56 /* EZAudioFile.m */; };
6628E0D81B39D8CB00020E56 /* EZAudioFloatConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E0BA1B39D8CB00020E56 /* EZAudioFloatConverter.m */; };
6628E0D91B39D8CB00020E56 /* EZAudioFloatData.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E0BC1B39D8CB00020E56 /* EZAudioFloatData.m */; };
6628E0DA1B39D8CB00020E56 /* EZAudioPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E0BE1B39D8CB00020E56 /* EZAudioPlayer.m */; };
6628E0DB1B39D8CB00020E56 /* EZAudioPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E0C01B39D8CB00020E56 /* EZAudioPlot.m */; };
6628E0DC1B39D8CB00020E56 /* EZAudioPlotGL.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E0C21B39D8CB00020E56 /* EZAudioPlotGL.m */; };
6628E0DD1B39D8CB00020E56 /* EZAudioPlotGLKViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E0C41B39D8CB00020E56 /* EZAudioPlotGLKViewController.m */; };
6628E0DE1B39D8CB00020E56 /* EZAudioUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E0C61B39D8CB00020E56 /* EZAudioUtilities.m */; };
6628E0DF1B39D8CB00020E56 /* EZMicrophone.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E0C81B39D8CB00020E56 /* EZMicrophone.m */; };
6628E0E01B39D8CB00020E56 /* EZOutput.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E0CA1B39D8CB00020E56 /* EZOutput.m */; };
6628E0E11B39D8CB00020E56 /* EZPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E0CC1B39D8CB00020E56 /* EZPlot.m */; };
6628E0E21B39D8CB00020E56 /* EZRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E0CE1B39D8CB00020E56 /* EZRecorder.m */; };
6628E0E31B39D8CB00020E56 /* TPCircularBuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 6628E0CF1B39D8CB00020E56 /* TPCircularBuffer.c */; };
6628E0E41B39D8CB00020E56 /* CHANGELOG in Resources */ = {isa = PBXBuildFile; fileRef = 6628E0D21B39D8CB00020E56 /* CHANGELOG */; };
6628E0E51B39D8CB00020E56 /* VERSION in Resources */ = {isa = PBXBuildFile; fileRef = 6628E0D31B39D8CB00020E56 /* VERSION */; };
66DB85831B0430E70018EFC5 /* MainStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 66DB85821B0430E70018EFC5 /* MainStoryboard.storyboard */; };
94056F7E185E593500EB94BA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 94056F7D185E593500EB94BA /* Foundation.framework */; };
94056F80185E593500EB94BA /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 94056F7F185E593500EB94BA /* CoreGraphics.framework */; };
94056F82185E593500EB94BA /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 94056F81185E593500EB94BA /* UIKit.framework */; };
94056F88185E593500EB94BA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 94056F86185E593500EB94BA /* InfoPlist.strings */; };
94056F8A185E593500EB94BA /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 94056F89185E593500EB94BA /* main.m */; };
94056F8E185E593500EB94BA /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 94056F8D185E593500EB94BA /* AppDelegate.m */; };
94056F91185E593500EB94BA /* Main_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 94056F8F185E593500EB94BA /* Main_iPhone.storyboard */; };
94056F94185E593500EB94BA /* Main_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 94056F92185E593500EB94BA /* Main_iPad.storyboard */; };
94056F99185E593500EB94BA /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 94056F98185E593500EB94BA /* Images.xcassets */; };
94056FA0185E593500EB94BA /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 94056F9F185E593500EB94BA /* XCTest.framework */; };
94056FA1185E593500EB94BA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 94056F7D185E593500EB94BA /* Foundation.framework */; };
@@ -24,19 +41,6 @@
94056FDE185E59D900EB94BA /* CoreGraphicsWaveformViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 94056FDD185E59D900EB94BA /* CoreGraphicsWaveformViewController.m */; };
94057024185E612100EB94BA /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 94057023185E612000EB94BA /* AudioToolbox.framework */; };
94057026185E612A00EB94BA /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 94057025185E612A00EB94BA /* GLKit.framework */; };
9417A7DA1867DDD600D9D37B /* AEFloatConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7C21867DDD600D9D37B /* AEFloatConverter.m */; };
9417A7DB1867DDD600D9D37B /* EZAudio.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7C41867DDD600D9D37B /* EZAudio.m */; };
9417A7DC1867DDD600D9D37B /* EZAudioFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7C61867DDD600D9D37B /* EZAudioFile.m */; };
9417A7DD1867DDD600D9D37B /* EZAudioPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7C81867DDD600D9D37B /* EZAudioPlot.m */; };
9417A7DE1867DDD600D9D37B /* EZAudioPlotGL.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7CA1867DDD600D9D37B /* EZAudioPlotGL.m */; };
9417A7DF1867DDD600D9D37B /* EZAudioPlotGLKViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7CC1867DDD600D9D37B /* EZAudioPlotGLKViewController.m */; };
9417A7E01867DDD600D9D37B /* EZMicrophone.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7CE1867DDD600D9D37B /* EZMicrophone.m */; };
9417A7E11867DDD600D9D37B /* EZOutput.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7D01867DDD600D9D37B /* EZOutput.m */; };
9417A7E21867DDD600D9D37B /* EZPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7D21867DDD600D9D37B /* EZPlot.m */; };
9417A7E31867DDD600D9D37B /* EZRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7D41867DDD600D9D37B /* EZRecorder.m */; };
9417A7E41867DDD600D9D37B /* TPCircularBuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7D51867DDD600D9D37B /* TPCircularBuffer.c */; };
9417A7E51867DDD600D9D37B /* CHANGELOG in Resources */ = {isa = PBXBuildFile; fileRef = 9417A7D81867DDD600D9D37B /* CHANGELOG */; };
9417A7E61867DDD600D9D37B /* VERSION in Resources */ = {isa = PBXBuildFile; fileRef = 9417A7D91867DDD600D9D37B /* VERSION */; };
94FBB77318B15690007CAE45 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 94FBB77218B15690007CAE45 /* AVFoundation.framework */; };
/* End PBXBuildFile section */
@@ -51,6 +55,41 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
6628E0B11B39D8CB00020E56 /* AEFloatConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AEFloatConverter.h; sourceTree = "<group>"; };
6628E0B21B39D8CB00020E56 /* AEFloatConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AEFloatConverter.m; sourceTree = "<group>"; };
6628E0B31B39D8CB00020E56 /* EZAudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudio.h; sourceTree = "<group>"; };
6628E0B41B39D8CB00020E56 /* EZAudio.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudio.m; sourceTree = "<group>"; };
6628E0B51B39D8CB00020E56 /* EZAudioDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioDevice.h; sourceTree = "<group>"; };
6628E0B61B39D8CB00020E56 /* EZAudioDevice.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioDevice.m; sourceTree = "<group>"; };
6628E0B71B39D8CB00020E56 /* EZAudioFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFile.h; sourceTree = "<group>"; };
6628E0B81B39D8CB00020E56 /* EZAudioFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFile.m; sourceTree = "<group>"; };
6628E0B91B39D8CB00020E56 /* EZAudioFloatConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFloatConverter.h; sourceTree = "<group>"; };
6628E0BA1B39D8CB00020E56 /* EZAudioFloatConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFloatConverter.m; sourceTree = "<group>"; };
6628E0BB1B39D8CB00020E56 /* EZAudioFloatData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFloatData.h; sourceTree = "<group>"; };
6628E0BC1B39D8CB00020E56 /* EZAudioFloatData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFloatData.m; sourceTree = "<group>"; };
6628E0BD1B39D8CB00020E56 /* EZAudioPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlayer.h; sourceTree = "<group>"; };
6628E0BE1B39D8CB00020E56 /* EZAudioPlayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlayer.m; sourceTree = "<group>"; };
6628E0BF1B39D8CB00020E56 /* EZAudioPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlot.h; sourceTree = "<group>"; };
6628E0C01B39D8CB00020E56 /* EZAudioPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlot.m; sourceTree = "<group>"; };
6628E0C11B39D8CB00020E56 /* EZAudioPlotGL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGL.h; sourceTree = "<group>"; };
6628E0C21B39D8CB00020E56 /* EZAudioPlotGL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGL.m; sourceTree = "<group>"; };
6628E0C31B39D8CB00020E56 /* EZAudioPlotGLKViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGLKViewController.h; sourceTree = "<group>"; };
6628E0C41B39D8CB00020E56 /* EZAudioPlotGLKViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGLKViewController.m; sourceTree = "<group>"; };
6628E0C51B39D8CB00020E56 /* EZAudioUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioUtilities.h; sourceTree = "<group>"; };
6628E0C61B39D8CB00020E56 /* EZAudioUtilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioUtilities.m; sourceTree = "<group>"; };
6628E0C71B39D8CB00020E56 /* EZMicrophone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZMicrophone.h; sourceTree = "<group>"; };
6628E0C81B39D8CB00020E56 /* EZMicrophone.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZMicrophone.m; sourceTree = "<group>"; };
6628E0C91B39D8CB00020E56 /* EZOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZOutput.h; sourceTree = "<group>"; };
6628E0CA1B39D8CB00020E56 /* EZOutput.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZOutput.m; sourceTree = "<group>"; };
6628E0CB1B39D8CB00020E56 /* EZPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZPlot.h; sourceTree = "<group>"; };
6628E0CC1B39D8CB00020E56 /* EZPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZPlot.m; sourceTree = "<group>"; };
6628E0CD1B39D8CB00020E56 /* EZRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZRecorder.h; sourceTree = "<group>"; };
6628E0CE1B39D8CB00020E56 /* EZRecorder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZRecorder.m; sourceTree = "<group>"; };
6628E0CF1B39D8CB00020E56 /* TPCircularBuffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = TPCircularBuffer.c; sourceTree = "<group>"; };
6628E0D01B39D8CB00020E56 /* TPCircularBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TPCircularBuffer.h; sourceTree = "<group>"; };
6628E0D21B39D8CB00020E56 /* CHANGELOG */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CHANGELOG; sourceTree = "<group>"; };
6628E0D31B39D8CB00020E56 /* VERSION */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VERSION; sourceTree = "<group>"; };
66DB85821B0430E70018EFC5 /* MainStoryboard.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = MainStoryboard.storyboard; sourceTree = "<group>"; };
94056F7A185E593500EB94BA /* EZAudioCoreGraphicsWaveformExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = EZAudioCoreGraphicsWaveformExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
94056F7D185E593500EB94BA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
94056F7F185E593500EB94BA /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
@@ -61,8 +100,6 @@
94056F8B185E593500EB94BA /* EZAudioCoreGraphicsWaveformExample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "EZAudioCoreGraphicsWaveformExample-Prefix.pch"; sourceTree = "<group>"; };
94056F8C185E593500EB94BA /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
94056F8D185E593500EB94BA /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
94056F90185E593500EB94BA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main_iPhone.storyboard; sourceTree = "<group>"; };
94056F93185E593500EB94BA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main_iPad.storyboard; sourceTree = "<group>"; };
94056F98185E593500EB94BA /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
94056F9E185E593500EB94BA /* EZAudioCoreGraphicsWaveformExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = EZAudioCoreGraphicsWaveformExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
94056F9F185E593500EB94BA /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
@@ -73,30 +110,6 @@
94056FDD185E59D900EB94BA /* CoreGraphicsWaveformViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CoreGraphicsWaveformViewController.m; sourceTree = "<group>"; };
94057023185E612000EB94BA /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
94057025185E612A00EB94BA /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; };
9417A7C11867DDD600D9D37B /* AEFloatConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AEFloatConverter.h; sourceTree = "<group>"; };
9417A7C21867DDD600D9D37B /* AEFloatConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AEFloatConverter.m; sourceTree = "<group>"; };
9417A7C31867DDD600D9D37B /* EZAudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudio.h; sourceTree = "<group>"; };
9417A7C41867DDD600D9D37B /* EZAudio.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudio.m; sourceTree = "<group>"; };
9417A7C51867DDD600D9D37B /* EZAudioFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFile.h; sourceTree = "<group>"; };
9417A7C61867DDD600D9D37B /* EZAudioFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFile.m; sourceTree = "<group>"; };
9417A7C71867DDD600D9D37B /* EZAudioPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlot.h; sourceTree = "<group>"; };
9417A7C81867DDD600D9D37B /* EZAudioPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlot.m; sourceTree = "<group>"; };
9417A7C91867DDD600D9D37B /* EZAudioPlotGL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGL.h; sourceTree = "<group>"; };
9417A7CA1867DDD600D9D37B /* EZAudioPlotGL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGL.m; sourceTree = "<group>"; };
9417A7CB1867DDD600D9D37B /* EZAudioPlotGLKViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGLKViewController.h; sourceTree = "<group>"; };
9417A7CC1867DDD600D9D37B /* EZAudioPlotGLKViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGLKViewController.m; sourceTree = "<group>"; };
9417A7CD1867DDD600D9D37B /* EZMicrophone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZMicrophone.h; sourceTree = "<group>"; };
9417A7CE1867DDD600D9D37B /* EZMicrophone.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZMicrophone.m; sourceTree = "<group>"; };
9417A7CF1867DDD600D9D37B /* EZOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZOutput.h; sourceTree = "<group>"; };
9417A7D01867DDD600D9D37B /* EZOutput.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZOutput.m; sourceTree = "<group>"; };
9417A7D11867DDD600D9D37B /* EZPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZPlot.h; sourceTree = "<group>"; };
9417A7D21867DDD600D9D37B /* EZPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZPlot.m; sourceTree = "<group>"; };
9417A7D31867DDD600D9D37B /* EZRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZRecorder.h; sourceTree = "<group>"; };
9417A7D41867DDD600D9D37B /* EZRecorder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZRecorder.m; sourceTree = "<group>"; };
9417A7D51867DDD600D9D37B /* TPCircularBuffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = TPCircularBuffer.c; sourceTree = "<group>"; };
9417A7D61867DDD600D9D37B /* TPCircularBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TPCircularBuffer.h; sourceTree = "<group>"; };
9417A7D81867DDD600D9D37B /* CHANGELOG */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CHANGELOG; sourceTree = "<group>"; };
9417A7D91867DDD600D9D37B /* VERSION */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VERSION; sourceTree = "<group>"; };
94FBB77218B15690007CAE45 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */
@@ -127,6 +140,56 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
6628E0B01B39D8CB00020E56 /* EZAudio */ = {
isa = PBXGroup;
children = (
6628E0B11B39D8CB00020E56 /* AEFloatConverter.h */,
6628E0B21B39D8CB00020E56 /* AEFloatConverter.m */,
6628E0B31B39D8CB00020E56 /* EZAudio.h */,
6628E0B41B39D8CB00020E56 /* EZAudio.m */,
6628E0B51B39D8CB00020E56 /* EZAudioDevice.h */,
6628E0B61B39D8CB00020E56 /* EZAudioDevice.m */,
6628E0B71B39D8CB00020E56 /* EZAudioFile.h */,
6628E0B81B39D8CB00020E56 /* EZAudioFile.m */,
6628E0B91B39D8CB00020E56 /* EZAudioFloatConverter.h */,
6628E0BA1B39D8CB00020E56 /* EZAudioFloatConverter.m */,
6628E0BB1B39D8CB00020E56 /* EZAudioFloatData.h */,
6628E0BC1B39D8CB00020E56 /* EZAudioFloatData.m */,
6628E0BD1B39D8CB00020E56 /* EZAudioPlayer.h */,
6628E0BE1B39D8CB00020E56 /* EZAudioPlayer.m */,
6628E0BF1B39D8CB00020E56 /* EZAudioPlot.h */,
6628E0C01B39D8CB00020E56 /* EZAudioPlot.m */,
6628E0C11B39D8CB00020E56 /* EZAudioPlotGL.h */,
6628E0C21B39D8CB00020E56 /* EZAudioPlotGL.m */,
6628E0C31B39D8CB00020E56 /* EZAudioPlotGLKViewController.h */,
6628E0C41B39D8CB00020E56 /* EZAudioPlotGLKViewController.m */,
6628E0C51B39D8CB00020E56 /* EZAudioUtilities.h */,
6628E0C61B39D8CB00020E56 /* EZAudioUtilities.m */,
6628E0C71B39D8CB00020E56 /* EZMicrophone.h */,
6628E0C81B39D8CB00020E56 /* EZMicrophone.m */,
6628E0C91B39D8CB00020E56 /* EZOutput.h */,
6628E0CA1B39D8CB00020E56 /* EZOutput.m */,
6628E0CB1B39D8CB00020E56 /* EZPlot.h */,
6628E0CC1B39D8CB00020E56 /* EZPlot.m */,
6628E0CD1B39D8CB00020E56 /* EZRecorder.h */,
6628E0CE1B39D8CB00020E56 /* EZRecorder.m */,
6628E0CF1B39D8CB00020E56 /* TPCircularBuffer.c */,
6628E0D01B39D8CB00020E56 /* TPCircularBuffer.h */,
6628E0D11B39D8CB00020E56 /* VERSION */,
);
name = EZAudio;
path = ../../../../EZAudio;
sourceTree = "<group>";
};
6628E0D11B39D8CB00020E56 /* VERSION */ = {
isa = PBXGroup;
children = (
6628E0D21B39D8CB00020E56 /* CHANGELOG */,
6628E0D31B39D8CB00020E56 /* VERSION */,
);
path = VERSION;
sourceTree = "<group>";
};
94056F71185E593500EB94BA = {
isa = PBXGroup;
children = (
@@ -163,11 +226,10 @@
94056F83185E593500EB94BA /* EZAudioCoreGraphicsWaveformExample */ = {
isa = PBXGroup;
children = (
9417A7C01867DDD600D9D37B /* EZAudio */,
6628E0B01B39D8CB00020E56 /* EZAudio */,
94056F8C185E593500EB94BA /* AppDelegate.h */,
94056F8D185E593500EB94BA /* AppDelegate.m */,
94056F8F185E593500EB94BA /* Main_iPhone.storyboard */,
94056F92185E593500EB94BA /* Main_iPad.storyboard */,
66DB85821B0430E70018EFC5 /* MainStoryboard.storyboard */,
94056FDC185E59D900EB94BA /* CoreGraphicsWaveformViewController.h */,
94056FDD185E59D900EB94BA /* CoreGraphicsWaveformViewController.m */,
94056F98185E593500EB94BA /* Images.xcassets */,
@@ -205,46 +267,6 @@
name = "Supporting Files";
sourceTree = "<group>";
};
9417A7C01867DDD600D9D37B /* EZAudio */ = {
isa = PBXGroup;
children = (
9417A7C11867DDD600D9D37B /* AEFloatConverter.h */,
9417A7C21867DDD600D9D37B /* AEFloatConverter.m */,
9417A7C31867DDD600D9D37B /* EZAudio.h */,
9417A7C41867DDD600D9D37B /* EZAudio.m */,
9417A7C51867DDD600D9D37B /* EZAudioFile.h */,
9417A7C61867DDD600D9D37B /* EZAudioFile.m */,
9417A7C71867DDD600D9D37B /* EZAudioPlot.h */,
9417A7C81867DDD600D9D37B /* EZAudioPlot.m */,
9417A7C91867DDD600D9D37B /* EZAudioPlotGL.h */,
9417A7CA1867DDD600D9D37B /* EZAudioPlotGL.m */,
9417A7CB1867DDD600D9D37B /* EZAudioPlotGLKViewController.h */,
9417A7CC1867DDD600D9D37B /* EZAudioPlotGLKViewController.m */,
9417A7CD1867DDD600D9D37B /* EZMicrophone.h */,
9417A7CE1867DDD600D9D37B /* EZMicrophone.m */,
9417A7CF1867DDD600D9D37B /* EZOutput.h */,
9417A7D01867DDD600D9D37B /* EZOutput.m */,
9417A7D11867DDD600D9D37B /* EZPlot.h */,
9417A7D21867DDD600D9D37B /* EZPlot.m */,
9417A7D31867DDD600D9D37B /* EZRecorder.h */,
9417A7D41867DDD600D9D37B /* EZRecorder.m */,
9417A7D51867DDD600D9D37B /* TPCircularBuffer.c */,
9417A7D61867DDD600D9D37B /* TPCircularBuffer.h */,
9417A7D71867DDD600D9D37B /* VERSION */,
);
name = EZAudio;
path = ../../../../EZAudio;
sourceTree = "<group>";
};
9417A7D71867DDD600D9D37B /* VERSION */ = {
isa = PBXGroup;
children = (
9417A7D81867DDD600D9D37B /* CHANGELOG */,
9417A7D91867DDD600D9D37B /* VERSION */,
);
path = VERSION;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -321,12 +343,11 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
94056F94185E593500EB94BA /* Main_iPad.storyboard in Resources */,
94056F99185E593500EB94BA /* Images.xcassets in Resources */,
94056F91185E593500EB94BA /* Main_iPhone.storyboard in Resources */,
9417A7E61867DDD600D9D37B /* VERSION in Resources */,
6628E0E41B39D8CB00020E56 /* CHANGELOG in Resources */,
66DB85831B0430E70018EFC5 /* MainStoryboard.storyboard in Resources */,
94056F88185E593500EB94BA /* InfoPlist.strings in Resources */,
9417A7E51867DDD600D9D37B /* CHANGELOG in Resources */,
6628E0E51B39D8CB00020E56 /* VERSION in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -345,20 +366,25 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9417A7E41867DDD600D9D37B /* TPCircularBuffer.c in Sources */,
9417A7E11867DDD600D9D37B /* EZOutput.m in Sources */,
9417A7DF1867DDD600D9D37B /* EZAudioPlotGLKViewController.m in Sources */,
6628E0E21B39D8CB00020E56 /* EZRecorder.m in Sources */,
94056FDE185E59D900EB94BA /* CoreGraphicsWaveformViewController.m in Sources */,
9417A7DA1867DDD600D9D37B /* AEFloatConverter.m in Sources */,
6628E0D81B39D8CB00020E56 /* EZAudioFloatConverter.m in Sources */,
6628E0D91B39D8CB00020E56 /* EZAudioFloatData.m in Sources */,
6628E0D41B39D8CB00020E56 /* AEFloatConverter.m in Sources */,
6628E0D71B39D8CB00020E56 /* EZAudioFile.m in Sources */,
6628E0E01B39D8CB00020E56 /* EZOutput.m in Sources */,
6628E0DC1B39D8CB00020E56 /* EZAudioPlotGL.m in Sources */,
6628E0E31B39D8CB00020E56 /* TPCircularBuffer.c in Sources */,
6628E0DB1B39D8CB00020E56 /* EZAudioPlot.m in Sources */,
94056F8E185E593500EB94BA /* AppDelegate.m in Sources */,
9417A7DD1867DDD600D9D37B /* EZAudioPlot.m in Sources */,
9417A7DC1867DDD600D9D37B /* EZAudioFile.m in Sources */,
9417A7DE1867DDD600D9D37B /* EZAudioPlotGL.m in Sources */,
6628E0DF1B39D8CB00020E56 /* EZMicrophone.m in Sources */,
6628E0DA1B39D8CB00020E56 /* EZAudioPlayer.m in Sources */,
6628E0D61B39D8CB00020E56 /* EZAudioDevice.m in Sources */,
94056F8A185E593500EB94BA /* main.m in Sources */,
9417A7E21867DDD600D9D37B /* EZPlot.m in Sources */,
9417A7E01867DDD600D9D37B /* EZMicrophone.m in Sources */,
9417A7E31867DDD600D9D37B /* EZRecorder.m in Sources */,
9417A7DB1867DDD600D9D37B /* EZAudio.m in Sources */,
6628E0E11B39D8CB00020E56 /* EZPlot.m in Sources */,
6628E0D51B39D8CB00020E56 /* EZAudio.m in Sources */,
6628E0DE1B39D8CB00020E56 /* EZAudioUtilities.m in Sources */,
6628E0DD1B39D8CB00020E56 /* EZAudioPlotGLKViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -389,22 +415,6 @@
name = InfoPlist.strings;
sourceTree = "<group>";
};
94056F8F185E593500EB94BA /* Main_iPhone.storyboard */ = {
isa = PBXVariantGroup;
children = (
94056F90185E593500EB94BA /* Base */,
);
name = Main_iPhone.storyboard;
sourceTree = "<group>";
};
94056F92185E593500EB94BA /* Main_iPad.storyboard */ = {
isa = PBXVariantGroup;
children = (
94056F93185E593500EB94BA /* Base */,
);
name = Main_iPad.storyboard;
sourceTree = "<group>";
};
94056FA8185E593500EB94BA /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
@@ -495,6 +505,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CODE_SIGN_IDENTITY = "iPhone Developer";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "EZAudioCoreGraphicsWaveformExample/EZAudioCoreGraphicsWaveformExample-Prefix.pch";
INFOPLIST_FILE = "EZAudioCoreGraphicsWaveformExample/EZAudioCoreGraphicsWaveformExample-Info.plist";
@@ -509,6 +520,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CODE_SIGN_IDENTITY = "iPhone Developer";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "EZAudioCoreGraphicsWaveformExample/EZAudioCoreGraphicsWaveformExample-Prefix.pch";
INFOPLIST_FILE = "EZAudioCoreGraphicsWaveformExample/EZAudioCoreGraphicsWaveformExample-Info.plist";
@@ -1,96 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "94056F79185E593500EB94BA"
BuildableName = "EZAudioCoreGraphicsWaveformExample.app"
BlueprintName = "EZAudioCoreGraphicsWaveformExample"
ReferencedContainer = "container:EZAudioCoreGraphicsWaveformExample.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "94056F9D185E593500EB94BA"
BuildableName = "EZAudioCoreGraphicsWaveformExampleTests.xctest"
BlueprintName = "EZAudioCoreGraphicsWaveformExampleTests"
ReferencedContainer = "container:EZAudioCoreGraphicsWaveformExample.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "94056F79185E593500EB94BA"
BuildableName = "EZAudioCoreGraphicsWaveformExample.app"
BlueprintName = "EZAudioCoreGraphicsWaveformExample"
ReferencedContainer = "container:EZAudioCoreGraphicsWaveformExample.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "94056F79185E593500EB94BA"
BuildableName = "EZAudioCoreGraphicsWaveformExample.app"
BlueprintName = "EZAudioCoreGraphicsWaveformExample"
ReferencedContainer = "container:EZAudioCoreGraphicsWaveformExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "94056F79185E593500EB94BA"
BuildableName = "EZAudioCoreGraphicsWaveformExample.app"
BlueprintName = "EZAudioCoreGraphicsWaveformExample"
ReferencedContainer = "container:EZAudioCoreGraphicsWaveformExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -1,27 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>EZAudioCoreGraphicsWaveformExample.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>94056F79185E593500EB94BA</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>94056F9D185E593500EB94BA</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
@@ -1,84 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4514" systemVersion="13A603" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<deployment defaultVersion="1536" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3747"/>
</dependencies>
<scenes>
<!--Core Graphics Waveform View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="CoreGraphicsWaveformViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Rz3-HH-m41"/>
<viewControllerLayoutGuide type="bottom" id="Edn-LO-SgE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="KVj-SX-30V" customClass="EZAudioPlot">
<rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<segmentedControl opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="0" translatesAutoresizingMaskIntoConstraints="NO" id="HOo-wT-4Gl">
<rect key="frame" x="635" y="975" width="113" height="29"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<segments>
<segment title="Buffer"/>
<segment title="Rolling"/>
</segments>
<connections>
<action selector="changePlotType:" destination="BYZ-38-t0r" eventType="valueChanged" id="u5I-m7-Eca"/>
</connections>
</segmentedControl>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="IdG-24-t3E">
<rect key="frame" x="20" y="973" width="51" height="31"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<connections>
<action selector="toggleMicrophone:" destination="BYZ-38-t0r" eventType="valueChanged" id="z0i-Io-nWB"/>
</connections>
</switch>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Microphone " lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dBJ-Ob-1px">
<rect key="frame" x="20" y="944" width="728" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="HOo-wT-4Gl" secondAttribute="trailing" constant="20" id="1bj-GM-5u9"/>
<constraint firstItem="dBJ-Ob-1px" firstAttribute="leading" secondItem="KVj-SX-30V" secondAttribute="leading" constant="20" id="FGd-WH-dE1"/>
<constraint firstAttribute="trailing" secondItem="dBJ-Ob-1px" secondAttribute="trailing" constant="20" id="LPb-Al-dww"/>
<constraint firstItem="IdG-24-t3E" firstAttribute="leading" secondItem="KVj-SX-30V" secondAttribute="leading" constant="20" id="g5e-84-did"/>
<constraint firstAttribute="bottom" secondItem="HOo-wT-4Gl" secondAttribute="bottom" constant="21" id="iaS-pz-dXC"/>
<constraint firstAttribute="bottom" secondItem="IdG-24-t3E" secondAttribute="bottom" constant="20" id="mks-lI-4PW"/>
<constraint firstItem="IdG-24-t3E" firstAttribute="top" secondItem="dBJ-Ob-1px" secondAttribute="bottom" constant="8" id="uLY-bf-9Qc"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="KVj-SX-30V" secondAttribute="bottom" id="Egg-Wh-pwI"/>
<constraint firstItem="KVj-SX-30V" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" id="LI6-AN-HB1"/>
<constraint firstAttribute="trailing" secondItem="KVj-SX-30V" secondAttribute="trailing" id="PDo-8E-1OC"/>
<constraint firstItem="KVj-SX-30V" firstAttribute="top" secondItem="8bC-Xf-vdC" secondAttribute="top" id="Z3Y-9k-ddm"/>
</constraints>
</view>
<connections>
<outlet property="audioPlot" destination="KVj-SX-30V" id="eVz-n9-mDV"/>
<outlet property="microphoneTextLabel" destination="dBJ-Ob-1px" id="IoH-VO-TDK"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="12" y="-240"/>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar" statusBarStyle="blackOpaque"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination"/>
</simulatedMetricsContainer>
</document>
@@ -1,83 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4514" systemVersion="13B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="vXZ-lx-hvc">
<dependencies>
<deployment defaultVersion="1536" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3747"/>
</dependencies>
<scenes>
<!--Core Graphics Waveform View Controller-->
<scene sceneID="ufC-wZ-h7g">
<objects>
<viewController id="vXZ-lx-hvc" customClass="CoreGraphicsWaveformViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Nwm-1t-jcl"/>
<viewControllerLayoutGuide type="bottom" id="CCw-11-X3I"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Lov-Wi-Vvt" customClass="EZAudioPlot">
<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="1wx-ee-ueV">
<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"/>
</segments>
<connections>
<action selector="changePlotType:" destination="vXZ-lx-hvc" eventType="valueChanged" id="qXy-P2-qRD"/>
</connections>
</segmentedControl>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="VE3-BA-g0H">
<rect key="frame" x="20" y="518" width="51" height="31"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<connections>
<action selector="toggleMicrophone:" destination="vXZ-lx-hvc" eventType="valueChanged" id="g7h-Lo-Tgb"/>
</connections>
</switch>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Microphone " lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kxf-bG-JhL">
<rect key="frame" x="20" y="489" width="280" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="1wx-ee-ueV" secondAttribute="bottom" constant="20" id="9pP-2T-cLA"/>
<constraint firstAttribute="bottom" secondItem="VE3-BA-g0H" secondAttribute="bottom" constant="19" id="CVg-bB-cdA"/>
<constraint firstAttribute="trailing" secondItem="1wx-ee-ueV" secondAttribute="trailing" constant="20" id="DRf-ak-ETh"/>
<constraint firstItem="kxf-bG-JhL" firstAttribute="leading" secondItem="Lov-Wi-Vvt" secondAttribute="leading" constant="20" id="Yzv-Os-lMH"/>
<constraint firstItem="VE3-BA-g0H" firstAttribute="top" secondItem="kxf-bG-JhL" secondAttribute="bottom" constant="8" id="cvW-wO-CN2"/>
<constraint firstItem="VE3-BA-g0H" firstAttribute="leading" secondItem="Lov-Wi-Vvt" secondAttribute="leading" constant="20" id="jkK-gD-wjZ"/>
<constraint firstAttribute="trailing" secondItem="kxf-bG-JhL" secondAttribute="trailing" constant="20" id="sJW-wY-kEG"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="Lov-Wi-Vvt" secondAttribute="bottom" id="3Yc-cq-XvW"/>
<constraint firstItem="Lov-Wi-Vvt" firstAttribute="top" secondItem="kh9-bI-dsS" secondAttribute="top" id="Rgw-Gl-Z34"/>
<constraint firstAttribute="trailing" secondItem="Lov-Wi-Vvt" secondAttribute="trailing" id="U0V-RG-CC7"/>
<constraint firstItem="Lov-Wi-Vvt" firstAttribute="leading" secondItem="kh9-bI-dsS" secondAttribute="leading" id="qxO-x5-Knu"/>
</constraints>
</view>
<connections>
<outlet property="audioPlot" destination="Lov-Wi-Vvt" id="Jbc-y7-FfI"/>
<outlet property="microphoneTextLabel" destination="kxf-bG-JhL" id="ZwY-xe-xeV"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
</document>
@@ -14,28 +14,62 @@
/**
We will allow this view controller to act as an EZMicrophoneDelegate. This is how we listen for the microphone callback.
*/
@interface CoreGraphicsWaveformViewController : UIViewController <EZMicrophoneDelegate>
@interface CoreGraphicsWaveformViewController : UIViewController <EZMicrophoneDelegate,
UIPickerViewDataSource,
UIPickerViewDelegate>
//------------------------------------------------------------------------------
#pragma mark - Components
//------------------------------------------------------------------------------
/**
The CoreGraphics based audio plot
*/
@property (nonatomic,weak) IBOutlet EZAudioPlot *audioPlot;
@property (nonatomic, weak) IBOutlet EZAudioPlot *audioPlot;
/**
The microphone component
*/
@property (nonatomic,strong) EZMicrophone *microphone;
@property (nonatomic, strong) EZMicrophone *microphone;
/**
The button at the bottom displaying the currently selected microphone input
*/
@property (nonatomic, weak) IBOutlet UIButton *microphoneInputToggleButton;
/**
The microphone input picker view to display the different microphone input sources
*/
@property (nonatomic, weak) IBOutlet UIPickerView *microphoneInputPickerView;
/**
The microphone input picker view's top layout constraint (we use this to hide the control)
*/
@property (nonatomic, weak) IBOutlet NSLayoutConstraint *microphoneInputPickerViewTopConstraint;
/**
The text label displaying "Microphone On" or "Microphone Off"
*/
@property (nonatomic, weak) IBOutlet UILabel *microphoneTextLabel;
//------------------------------------------------------------------------------
#pragma mark - Actions
//------------------------------------------------------------------------------
/**
Switches the plot drawing type between a buffer plot (visualizes the current stream of audio data from the update function) or a rolling plot (visualizes the audio data over time, this is the classic waveform look)
*/
-(IBAction)changePlotType:(id)sender;
- (IBAction)changePlotType:(id)sender;
/**
Toggles the microphone on and off. When the microphone is on it will send its delegate (aka this view controller) the audio data in various ways (check out the EZMicrophoneDelegate documentation for more details);
*/
-(IBAction)toggleMicrophone:(id)sender;
- (IBAction)toggleMicrophonePickerView:(id)sender;
/**
Toggles the microphone on and off. When the microphone is on it will send its delegate (aka this view controller) the audio data in various ways (check out the EZMicrophoneDelegate documentation for more details);
*/
- (IBAction)toggleMicrophone:(id)sender;
@end
@@ -8,142 +8,291 @@
#import "CoreGraphicsWaveformViewController.h"
@interface CoreGraphicsWaveformViewController (){
float scale;
}
#pragma mark - UI Extras
@property (nonatomic,weak) IBOutlet UILabel *microphoneTextLabel;
@interface CoreGraphicsWaveformViewController ()
@property (nonatomic, strong) NSArray *inputs;
@end
@implementation CoreGraphicsWaveformViewController
@synthesize audioPlot;
@synthesize microphone;
#pragma mark - Initialization
-(id)init {
self = [super init];
if(self){
[self initializeViewController];
}
return self;
}
-(id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
if(self){
[self initializeViewController];
}
return self;
}
#pragma mark - Initialize View Controller Here
-(void)initializeViewController {
// Create an instance of the microphone and tell it to use this view controller instance as the delegate
self.microphone = [EZMicrophone microphoneWithDelegate:self];
//------------------------------------------------------------------------------
#pragma mark - View Style
//------------------------------------------------------------------------------
- (UIStatusBarStyle)preferredStatusBarStyle
{
return UIStatusBarStyleLightContent;
}
//------------------------------------------------------------------------------
#pragma mark - Customize the Audio Plot
//------------------------------------------------------------------------------
- (void)viewDidLoad
{
[super viewDidLoad];
/*
Customizing the audio plot's look
*/
// Background color
self.audioPlot.backgroundColor = [UIColor colorWithRed:0.984 green:0.471 blue:0.525 alpha:1.0];
// Waveform color
self.audioPlot.color = [UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:1.0];
// Plot type
self.audioPlot.plotType = EZPlotTypeBuffer;
/*
Start the microphone
*/
[self.microphone startFetchingAudio];
self.microphoneTextLabel.text = @"Microphone On";
}
-(void)pinch:(UIPinchGestureRecognizer*)pinch {
}
#pragma mark - Actions
-(void)changePlotType:(id)sender {
NSInteger selectedSegment = [sender selectedSegmentIndex];
switch(selectedSegment){
case 0:
[self drawBufferPlot];
break;
case 1:
[self drawRollingPlot];
break;
default:
break;
}
}
-(void)toggleMicrophone:(id)sender {
if( ![(UISwitch*)sender isOn] ){
[self.microphone stopFetchingAudio];
self.microphoneTextLabel.text = @"Microphone Off";
}
else {
[super viewDidLoad];
//
// Setup the AVAudioSession. EZMicrophone will not work properly on iOS
// if you don't do this!
//
AVAudioSession *session = [AVAudioSession sharedInstance];
NSError *error;
[session setCategory:AVAudioSessionCategoryPlayAndRecord error:&error];
if (error)
{
NSLog(@"Error setting up audio session category: %@", error.localizedDescription);
}
[session setActive:YES error:&error];
if (error)
{
NSLog(@"Error setting up audio session active: %@", error.localizedDescription);
}
//
// Customizing the audio plot's look
//
// Background color
self.audioPlot.backgroundColor = [UIColor colorWithRed:0.984 green:0.471 blue:0.525 alpha:1.0];
// Waveform color
self.audioPlot.color = [UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:1.0];
// Plot type
self.audioPlot.plotType = EZPlotTypeBuffer;
//
// Create the microphone
//
self.microphone = [EZMicrophone microphoneWithDelegate:self];
//
// Set up the microphone input UIPickerView items to select
// between different microphone inputs. Here what we're doing behind the hood
// is enumerating the available inputs provided by the AVAudioSession.
//
self.inputs = [EZAudioDevice inputDevices];
self.microphoneInputPickerView.dataSource = self;
self.microphoneInputPickerView.delegate = self;
//
// Start the microphone
//
[self.microphone startFetchingAudio];
self.microphoneTextLabel.text = @"Microphone On";
}
}
#pragma mark - Action Extensions
//------------------------------------------------------------------------------
#pragma mark - UIPickerViewDataSource
//------------------------------------------------------------------------------
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView
{
return 1;
}
//------------------------------------------------------------------------------
- (NSString *)pickerView:(UIPickerView *)pickerView
titleForRow:(NSInteger)row
forComponent:(NSInteger)component
{
EZAudioDevice *device = self.inputs[row];
return device.name;
}
//------------------------------------------------------------------------------
- (NSAttributedString *)pickerView:(UIPickerView *)pickerView
attributedTitleForRow:(NSInteger)row
forComponent:(NSInteger)component
{
EZAudioDevice *device = self.inputs[row];
UIColor *textColor = [device isEqual:self.microphone.device] ? self.audioPlot.backgroundColor : [UIColor blackColor];
return [[NSAttributedString alloc] initWithString:device.name
attributes:@{ NSForegroundColorAttributeName : textColor }];
}
//------------------------------------------------------------------------------
- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component
{
return self.inputs.count;
}
//------------------------------------------------------------------------------
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
EZAudioDevice *device = self.inputs[row];
[self.microphone setDevice:device];
}
//------------------------------------------------------------------------------
#pragma mark - Actions
//------------------------------------------------------------------------------
- (void)changePlotType:(id)sender
{
NSInteger selectedSegment = [sender selectedSegmentIndex];
switch (selectedSegment)
{
case 0:
[self drawBufferPlot];
break;
case 1:
[self drawRollingPlot];
break;
default:
break;
}
}
//------------------------------------------------------------------------------
- (void)toggleMicrophone:(id)sender
{
BOOL isOn = [sender isOn];
if (!isOn)
{
[self.microphone stopFetchingAudio];
self.microphoneTextLabel.text = @"Microphone Off";
}
else
{
[self.microphone startFetchingAudio];
self.microphoneTextLabel.text = @"Microphone On";
}
}
//------------------------------------------------------------------------------
- (void)toggleMicrophonePickerView:(id)sender
{
BOOL isHidden = self.microphoneInputPickerViewTopConstraint.constant != 0.0;
[self setMicrophonePickerViewHidden:!isHidden];
}
//------------------------------------------------------------------------------
- (void)setMicrophonePickerViewHidden:(BOOL)hidden
{
CGFloat pickerHeight = CGRectGetHeight(self.microphoneInputPickerView.bounds);
__weak typeof(self) weakSelf = self;
[UIView animateWithDuration:0.55
delay:0.0
usingSpringWithDamping:0.6
initialSpringVelocity:0.5
options:(UIViewAnimationOptionBeginFromCurrentState|
UIViewAnimationOptionCurveEaseInOut|
UIViewAnimationOptionLayoutSubviews)
animations:^{
weakSelf.microphoneInputPickerViewTopConstraint.constant = hidden ? -pickerHeight : 0.0f;
[weakSelf.view layoutSubviews];
} completion:nil];
}
//------------------------------------------------------------------------------
#pragma mark - Utility
//------------------------------------------------------------------------------
/*
Give the visualization of the current buffer (this is almost exactly the openFrameworks audio input eample)
*/
-(void)drawBufferPlot {
// Change the plot type to the buffer plot
self.audioPlot.plotType = EZPlotTypeBuffer;
// Don't mirror over the x-axis
self.audioPlot.shouldMirror = NO;
// Don't fill
self.audioPlot.shouldFill = NO;
- (void)drawBufferPlot
{
self.audioPlot.plotType = EZPlotTypeBuffer;
self.audioPlot.shouldMirror = NO;
self.audioPlot.shouldFill = NO;
}
//------------------------------------------------------------------------------
/*
Give the classic mirrored, rolling waveform look
*/
-(void)drawRollingPlot {
self.audioPlot.plotType = EZPlotTypeRolling;
self.audioPlot.shouldFill = YES;
self.audioPlot.shouldMirror = YES;
-(void)drawRollingPlot
{
self.audioPlot.plotType = EZPlotTypeRolling;
self.audioPlot.shouldFill = YES;
self.audioPlot.shouldMirror = YES;
}
#pragma mark - EZMicrophoneDelegate
#warning Thread Safety
// Note that any callback that provides streamed audio data (like streaming microphone input) happens on a separate audio thread that should not be blocked. When we feed audio data into any of the UI components we need to explicity create a GCD block on the main thread to properly get the UI to work.
-(void)microphone:(EZMicrophone *)microphone
hasAudioReceived:(float **)buffer
withBufferSize:(UInt32)bufferSize
withNumberOfChannels:(UInt32)numberOfChannels {
// Getting audio data as an array of float buffer arrays. What does that mean? Because the audio is coming in as a stereo signal the data is split into a left and right channel. So buffer[0] corresponds to the float* data for the left channel while buffer[1] corresponds to the float* data for the right channel.
// See the Thread Safety warning above, but in a nutshell these callbacks happen on a separate audio thread. We wrap any UI updating in a GCD block on the main thread to avoid blocking that audio flow.
dispatch_async(dispatch_get_main_queue(),^{
// All the audio plot needs is the buffer data (float*) and the size. Internally the audio plot will handle all the drawing related code, history management, and freeing its own resources. Hence, one badass line of code gets you a pretty plot :)
[self.audioPlot updateBuffer:buffer[0] withBufferSize:bufferSize];
});
// Note that any callback that provides streamed audio data (like streaming
// microphone input) happens on a separate audio thread that should not be
// blocked. When we feed audio data into any of the UI components we need to
// explicity create a GCD block on the main thread to properly get the UI
// to work.
- (void)microphone:(EZMicrophone *)microphone
hasAudioReceived:(float **)buffer
withBufferSize:(UInt32)bufferSize
withNumberOfChannels:(UInt32)numberOfChannels
{
// Getting audio data as an array of float buffer arrays. What does that mean?
// Because the audio is coming in as a stereo signal the data is split into
// a left and right channel. So buffer[0] corresponds to the float* data
// for the left channel while buffer[1] corresponds to the float* data
// for the right channel.
// See the Thread Safety warning above, but in a nutshell these callbacks
// happen on a separate audio thread. We wrap any UI updating in a GCD block
// on the main thread to avoid blocking that audio flow.
__weak typeof (self) weakSelf = self;
dispatch_async(dispatch_get_main_queue(), ^{
// All the audio plot needs is the buffer data (float*) and the size.
// Internally the audio plot will handle all the drawing related code,
// history management, and freeing its own resources.
// Hence, one badass line of code gets you a pretty plot :)
[weakSelf.audioPlot updateBuffer:buffer[0] withBufferSize:bufferSize];
});
}
-(void)microphone:(EZMicrophone *)microphone hasAudioStreamBasicDescription:(AudioStreamBasicDescription)audioStreamBasicDescription {
// The AudioStreamBasicDescription of the microphone stream. This is useful when configuring the EZRecorder or telling another component what audio format type to expect.
// Here's a print function to allow you to inspect it a little easier
[EZAudio printASBD:audioStreamBasicDescription];
//------------------------------------------------------------------------------
- (void)microphone:(EZMicrophone *)microphone hasAudioStreamBasicDescription:(AudioStreamBasicDescription)audioStreamBasicDescription
{
// The AudioStreamBasicDescription of the microphone stream. This is useful
// when configuring the EZRecorder or telling another component what
// audio format type to expect.
[EZAudioUtilities printASBD:audioStreamBasicDescription];
}
-(void)microphone:(EZMicrophone *)microphone
hasBufferList:(AudioBufferList *)bufferList
withBufferSize:(UInt32)bufferSize
withNumberOfChannels:(UInt32)numberOfChannels {
// Getting audio data as a buffer list that can be directly fed into the EZRecorder or EZOutput. Say whattt...
//------------------------------------------------------------------------------
- (void)microphone:(EZMicrophone *)microphone
hasBufferList:(AudioBufferList *)bufferList
withBufferSize:(UInt32)bufferSize
withNumberOfChannels:(UInt32)numberOfChannels
{
// Getting audio data as a buffer list that can be directly fed into the
// EZRecorder or EZOutput. Say whattt...
}
@end
//------------------------------------------------------------------------------
- (void)microphone:(EZMicrophone *)microphone changedDevice:(EZAudioDevice *)device
{
NSLog(@"Microphone changed device: %@", device.name);
// Called anytime the microphone's device changes
__weak typeof(self) weakSelf = self;
dispatch_async(dispatch_get_main_queue(), ^{
NSString *name = device.name;
NSString *tapText = @" (Tap To Change)";
NSString *microphoneInputToggleButtonText = [NSString stringWithFormat:@"%@%@", device.name, tapText];
NSRange rangeOfName = [microphoneInputToggleButtonText rangeOfString:name];
NSMutableAttributedString *microphoneInputToggleButtonAttributedText = [[NSMutableAttributedString alloc] initWithString:microphoneInputToggleButtonText];
[microphoneInputToggleButtonAttributedText addAttribute:NSFontAttributeName value:[UIFont boldSystemFontOfSize:13.0f] range:rangeOfName];
[weakSelf.microphoneInputToggleButton setAttributedTitle:microphoneInputToggleButtonAttributedText forState:UIControlStateNormal];
// reset the device list (a device may have been plugged in/out)
weakSelf.inputs = [EZAudioDevice inputDevices];
[weakSelf.microphoneInputPickerView reloadAllComponents];
[weakSelf setMicrophonePickerViewHidden:YES];
});
}
//------------------------------------------------------------------------------
@end
@@ -25,13 +25,15 @@
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIMainStoryboardFile</key>
<string>Main_iPhone</string>
<string>MainStoryboard</string>
<key>UIMainStoryboardFile~ipad</key>
<string>Main_iPad</string>
<string>MainStoryboard</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleLightContent</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
@@ -15,6 +15,11 @@
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "29x29",
@@ -0,0 +1,102 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7702" systemVersion="14C109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="uAJ-Uz-eFq">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7701"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
</dependencies>
<scenes>
<!--Core Graphics Waveform View Controller-->
<scene sceneID="d5F-Cu-PN5">
<objects>
<viewController id="uAJ-Uz-eFq" customClass="CoreGraphicsWaveformViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Z2u-WA-u3Y"/>
<viewControllerLayoutGuide type="bottom" id="eTB-c6-hqM"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="LZk-FQ-Roy">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="PTM-3g-RZx" customClass="EZAudioPlot">
<rect key="frame" x="0.0" y="-54" width="600" height="654"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
<segmentedControl opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="0" translatesAutoresizingMaskIntoConstraints="NO" id="82V-bR-cRo">
<rect key="frame" x="16" y="520" width="157" height="29"/>
<constraints>
<constraint firstAttribute="width" constant="157" id="6BL-nE-ONH"/>
</constraints>
<segments>
<segment title="Buffer"/>
<segment title="Rolling"/>
</segments>
<color key="tintColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<connections>
<action selector="changePlotType:" destination="uAJ-Uz-eFq" eventType="valueChanged" id="loR-vI-Hcz"/>
</connections>
</segmentedControl>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="roundedRect" showsTouchWhenHighlighted="YES" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="iZQ-my-xGs">
<rect key="frame" x="16" y="556" width="568" height="28"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="tintColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<state key="normal" title="Change Microphone Input">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="toggleMicrophonePickerView:" destination="uAJ-Uz-eFq" eventType="touchUpInside" id="uwB-mw-2Ac"/>
</connections>
</button>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="YOL-mD-qlh">
<rect key="frame" x="16" y="479" width="51" height="31"/>
<color key="onTintColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<connections>
<action selector="toggleMicrophone:" destination="uAJ-Uz-eFq" eventType="touchUpInside" id="5TS-5b-eln"/>
</connections>
</switch>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qEV-qa-XcB">
<rect key="frame" x="73" y="487" width="33" height="16"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" red="1" green="1" blue="1" alpha="0.90000000000000002" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<pickerView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="5do-cK-DtK">
<rect key="frame" x="0.0" y="-216" width="600" height="162"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
</pickerView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="82V-bR-cRo" firstAttribute="leading" secondItem="LZk-FQ-Roy" secondAttribute="leading" constant="16" id="6Yn-aJ-OO7"/>
<constraint firstItem="PTM-3g-RZx" firstAttribute="leading" secondItem="LZk-FQ-Roy" secondAttribute="leading" id="D1v-FC-xCQ"/>
<constraint firstItem="82V-bR-cRo" firstAttribute="top" secondItem="YOL-mD-qlh" secondAttribute="bottom" constant="10" id="Q6t-KE-QM6"/>
<constraint firstItem="eTB-c6-hqM" firstAttribute="top" secondItem="PTM-3g-RZx" secondAttribute="bottom" id="Qdf-yH-08h"/>
<constraint firstAttribute="trailing" secondItem="5do-cK-DtK" secondAttribute="trailing" id="TFf-n7-Lar"/>
<constraint firstItem="qEV-qa-XcB" firstAttribute="leading" secondItem="YOL-mD-qlh" secondAttribute="trailing" constant="8" symbolic="YES" id="TTM-IM-GgG"/>
<constraint firstItem="eTB-c6-hqM" firstAttribute="top" secondItem="iZQ-my-xGs" secondAttribute="bottom" constant="16" id="VDh-aa-K3c"/>
<constraint firstItem="YOL-mD-qlh" firstAttribute="leading" secondItem="82V-bR-cRo" secondAttribute="leading" id="Ybz-Ri-nBr"/>
<constraint firstItem="iZQ-my-xGs" firstAttribute="leading" secondItem="LZk-FQ-Roy" secondAttribute="leading" constant="16" id="aFq-vx-F9B"/>
<constraint firstItem="5do-cK-DtK" firstAttribute="leading" secondItem="LZk-FQ-Roy" secondAttribute="leading" id="aos-wc-RIm"/>
<constraint firstAttribute="trailing" secondItem="PTM-3g-RZx" secondAttribute="trailing" id="duY-lt-nwK"/>
<constraint firstItem="PTM-3g-RZx" firstAttribute="top" secondItem="5do-cK-DtK" secondAttribute="bottom" id="glD-k0-v7v"/>
<constraint firstItem="82V-bR-cRo" firstAttribute="top" secondItem="qEV-qa-XcB" secondAttribute="bottom" constant="17" id="hN9-AW-5mr"/>
<constraint firstItem="5do-cK-DtK" firstAttribute="top" secondItem="LZk-FQ-Roy" secondAttribute="topMargin" constant="-216" id="j80-5N-His"/>
<constraint firstItem="iZQ-my-xGs" firstAttribute="top" secondItem="82V-bR-cRo" secondAttribute="bottom" constant="8" id="jPu-90-foy"/>
<constraint firstAttribute="trailing" secondItem="iZQ-my-xGs" secondAttribute="trailing" constant="16" id="rc6-RC-Rjr"/>
<constraint firstItem="YOL-mD-qlh" firstAttribute="leading" secondItem="LZk-FQ-Roy" secondAttribute="leading" constant="16" id="vIP-WC-7w4"/>
</constraints>
</view>
<connections>
<outlet property="audioPlot" destination="PTM-3g-RZx" id="XT9-Ss-mS5"/>
<outlet property="microphoneInputPickerView" destination="5do-cK-DtK" id="nuC-9V-HG0"/>
<outlet property="microphoneInputPickerViewTopConstraint" destination="j80-5N-His" id="Uk4-Us-ADc"/>
<outlet property="microphoneInputToggleButton" destination="iZQ-my-xGs" id="rkU-w0-Xqo"/>
<outlet property="microphoneTextLabel" destination="qEV-qa-XcB" id="5id-wg-zWA"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Vws-3v-CE5" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="574" y="89"/>
</scene>
</scenes>
</document>
@@ -1,41 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>76457C28-A04B-437F-897F-48ACC496271B</string>
<key>IDESourceControlProjectName</key>
<string>EZAudioExamplesiOS</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>F77EC8D9-F815-4829-9274-5DA08EA98D6B</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>
<string>../../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>https://github.com/syedhali/EZAudio.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>110</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>F77EC8D9-F815-4829-9274-5DA08EA98D6B</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>F77EC8D9-F815-4829-9274-5DA08EA98D6B</string>
<key>IDESourceControlWCCName</key>
<string>EZAudio</string>
</dict>
</array>
</dict>
</plist>
@@ -7,14 +7,31 @@
objects = {
/* Begin PBXBuildFile section */
6628E1401B39D96500020E56 /* AEFloatConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E11E1B39D96500020E56 /* AEFloatConverter.m */; };
6628E1411B39D96500020E56 /* EZAudio.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E1201B39D96500020E56 /* EZAudio.m */; };
6628E1421B39D96500020E56 /* EZAudioDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E1221B39D96500020E56 /* EZAudioDevice.m */; };
6628E1431B39D96500020E56 /* EZAudioFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E1241B39D96500020E56 /* EZAudioFile.m */; };
6628E1441B39D96500020E56 /* EZAudioFloatConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E1261B39D96500020E56 /* EZAudioFloatConverter.m */; };
6628E1451B39D96500020E56 /* EZAudioFloatData.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E1281B39D96500020E56 /* EZAudioFloatData.m */; };
6628E1461B39D96500020E56 /* EZAudioPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E12A1B39D96500020E56 /* EZAudioPlayer.m */; };
6628E1471B39D96500020E56 /* EZAudioPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E12C1B39D96500020E56 /* EZAudioPlot.m */; };
6628E1481B39D96500020E56 /* EZAudioPlotGL.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E12E1B39D96500020E56 /* EZAudioPlotGL.m */; };
6628E1491B39D96500020E56 /* EZAudioPlotGLKViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E1301B39D96500020E56 /* EZAudioPlotGLKViewController.m */; };
6628E14A1B39D96500020E56 /* EZAudioUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E1321B39D96500020E56 /* EZAudioUtilities.m */; };
6628E14B1B39D96500020E56 /* EZMicrophone.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E1341B39D96500020E56 /* EZMicrophone.m */; };
6628E14C1B39D96500020E56 /* EZOutput.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E1361B39D96500020E56 /* EZOutput.m */; };
6628E14D1B39D96500020E56 /* EZPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E1381B39D96500020E56 /* EZPlot.m */; };
6628E14E1B39D96500020E56 /* EZRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E13A1B39D96500020E56 /* EZRecorder.m */; };
6628E14F1B39D96500020E56 /* TPCircularBuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 6628E13B1B39D96500020E56 /* TPCircularBuffer.c */; };
6628E1501B39D96500020E56 /* CHANGELOG in Resources */ = {isa = PBXBuildFile; fileRef = 6628E13E1B39D96500020E56 /* CHANGELOG */; };
6628E1511B39D96500020E56 /* VERSION in Resources */ = {isa = PBXBuildFile; fileRef = 6628E13F1B39D96500020E56 /* VERSION */; };
6628E2331B39F7CC00020E56 /* MainStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6628E2321B39F7CC00020E56 /* MainStoryboard.storyboard */; };
9417A96C1871E88300D9D37B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9417A96B1871E88300D9D37B /* Foundation.framework */; };
9417A96E1871E88300D9D37B /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9417A96D1871E88300D9D37B /* CoreGraphics.framework */; };
9417A9701871E88300D9D37B /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9417A96F1871E88300D9D37B /* UIKit.framework */; };
9417A9761871E88300D9D37B /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 9417A9741871E88300D9D37B /* InfoPlist.strings */; };
9417A9781871E88300D9D37B /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A9771871E88300D9D37B /* main.m */; };
9417A97C1871E88300D9D37B /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A97B1871E88300D9D37B /* AppDelegate.m */; };
9417A97F1871E88300D9D37B /* Main_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9417A97D1871E88300D9D37B /* Main_iPhone.storyboard */; };
9417A9821871E88300D9D37B /* Main_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9417A9801871E88300D9D37B /* Main_iPad.storyboard */; };
9417A9871871E88300D9D37B /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9417A9861871E88300D9D37B /* Images.xcassets */; };
9417A98E1871E88300D9D37B /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9417A98D1871E88300D9D37B /* XCTest.framework */; };
9417A98F1871E88300D9D37B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9417A96B1871E88300D9D37B /* Foundation.framework */; };
@@ -23,19 +40,6 @@
9417A99A1871E88300D9D37B /* EZAudioFFTExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A9991871E88300D9D37B /* EZAudioFFTExampleTests.m */; };
9417A9A41871E89500D9D37B /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9417A9A31871E89500D9D37B /* AudioToolbox.framework */; };
9417A9A61871E8A100D9D37B /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9417A9A51871E8A100D9D37B /* GLKit.framework */; };
9417A9C11871E96300D9D37B /* AEFloatConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A9A91871E96300D9D37B /* AEFloatConverter.m */; };
9417A9C21871E96300D9D37B /* EZAudio.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A9AB1871E96300D9D37B /* EZAudio.m */; };
9417A9C31871E96300D9D37B /* EZAudioFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A9AD1871E96300D9D37B /* EZAudioFile.m */; };
9417A9C41871E96300D9D37B /* EZAudioPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A9AF1871E96300D9D37B /* EZAudioPlot.m */; };
9417A9C51871E96300D9D37B /* EZAudioPlotGL.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A9B11871E96300D9D37B /* EZAudioPlotGL.m */; };
9417A9C61871E96300D9D37B /* EZAudioPlotGLKViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A9B31871E96300D9D37B /* EZAudioPlotGLKViewController.m */; };
9417A9C71871E96300D9D37B /* EZMicrophone.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A9B51871E96300D9D37B /* EZMicrophone.m */; };
9417A9C81871E96300D9D37B /* EZOutput.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A9B71871E96300D9D37B /* EZOutput.m */; };
9417A9C91871E96300D9D37B /* EZPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A9B91871E96300D9D37B /* EZPlot.m */; };
9417A9CA1871E96300D9D37B /* EZRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A9BB1871E96300D9D37B /* EZRecorder.m */; };
9417A9CB1871E96300D9D37B /* TPCircularBuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 9417A9BC1871E96300D9D37B /* TPCircularBuffer.c */; };
9417A9CC1871E96300D9D37B /* CHANGELOG in Resources */ = {isa = PBXBuildFile; fileRef = 9417A9BF1871E96300D9D37B /* CHANGELOG */; };
9417A9CD1871E96300D9D37B /* VERSION in Resources */ = {isa = PBXBuildFile; fileRef = 9417A9C01871E96300D9D37B /* VERSION */; };
9417A9D01871E97D00D9D37B /* FFTViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A9CF1871E97D00D9D37B /* FFTViewController.m */; };
9417A9D21871EA5900D9D37B /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9417A9D11871EA5900D9D37B /* Accelerate.framework */; };
94FBB77918B156B8007CAE45 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 94FBB77818B156B8007CAE45 /* AVFoundation.framework */; };
@@ -52,6 +56,41 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
6628E11D1B39D96500020E56 /* AEFloatConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AEFloatConverter.h; sourceTree = "<group>"; };
6628E11E1B39D96500020E56 /* AEFloatConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AEFloatConverter.m; sourceTree = "<group>"; };
6628E11F1B39D96500020E56 /* EZAudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudio.h; sourceTree = "<group>"; };
6628E1201B39D96500020E56 /* EZAudio.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudio.m; sourceTree = "<group>"; };
6628E1211B39D96500020E56 /* EZAudioDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioDevice.h; sourceTree = "<group>"; };
6628E1221B39D96500020E56 /* EZAudioDevice.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioDevice.m; sourceTree = "<group>"; };
6628E1231B39D96500020E56 /* EZAudioFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFile.h; sourceTree = "<group>"; };
6628E1241B39D96500020E56 /* EZAudioFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFile.m; sourceTree = "<group>"; };
6628E1251B39D96500020E56 /* EZAudioFloatConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFloatConverter.h; sourceTree = "<group>"; };
6628E1261B39D96500020E56 /* EZAudioFloatConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFloatConverter.m; sourceTree = "<group>"; };
6628E1271B39D96500020E56 /* EZAudioFloatData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFloatData.h; sourceTree = "<group>"; };
6628E1281B39D96500020E56 /* EZAudioFloatData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFloatData.m; sourceTree = "<group>"; };
6628E1291B39D96500020E56 /* EZAudioPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlayer.h; sourceTree = "<group>"; };
6628E12A1B39D96500020E56 /* EZAudioPlayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlayer.m; sourceTree = "<group>"; };
6628E12B1B39D96500020E56 /* EZAudioPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlot.h; sourceTree = "<group>"; };
6628E12C1B39D96500020E56 /* EZAudioPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlot.m; sourceTree = "<group>"; };
6628E12D1B39D96500020E56 /* EZAudioPlotGL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGL.h; sourceTree = "<group>"; };
6628E12E1B39D96500020E56 /* EZAudioPlotGL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGL.m; sourceTree = "<group>"; };
6628E12F1B39D96500020E56 /* EZAudioPlotGLKViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGLKViewController.h; sourceTree = "<group>"; };
6628E1301B39D96500020E56 /* EZAudioPlotGLKViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGLKViewController.m; sourceTree = "<group>"; };
6628E1311B39D96500020E56 /* EZAudioUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioUtilities.h; sourceTree = "<group>"; };
6628E1321B39D96500020E56 /* EZAudioUtilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioUtilities.m; sourceTree = "<group>"; };
6628E1331B39D96500020E56 /* EZMicrophone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZMicrophone.h; sourceTree = "<group>"; };
6628E1341B39D96500020E56 /* EZMicrophone.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZMicrophone.m; sourceTree = "<group>"; };
6628E1351B39D96500020E56 /* EZOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZOutput.h; sourceTree = "<group>"; };
6628E1361B39D96500020E56 /* EZOutput.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZOutput.m; sourceTree = "<group>"; };
6628E1371B39D96500020E56 /* EZPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZPlot.h; sourceTree = "<group>"; };
6628E1381B39D96500020E56 /* EZPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZPlot.m; sourceTree = "<group>"; };
6628E1391B39D96500020E56 /* EZRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZRecorder.h; sourceTree = "<group>"; };
6628E13A1B39D96500020E56 /* EZRecorder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZRecorder.m; sourceTree = "<group>"; };
6628E13B1B39D96500020E56 /* TPCircularBuffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = TPCircularBuffer.c; sourceTree = "<group>"; };
6628E13C1B39D96500020E56 /* TPCircularBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TPCircularBuffer.h; sourceTree = "<group>"; };
6628E13E1B39D96500020E56 /* CHANGELOG */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CHANGELOG; sourceTree = "<group>"; };
6628E13F1B39D96500020E56 /* VERSION */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VERSION; sourceTree = "<group>"; };
6628E2321B39F7CC00020E56 /* MainStoryboard.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = MainStoryboard.storyboard; sourceTree = "<group>"; };
9417A9681871E88300D9D37B /* EZAudioFFTExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = EZAudioFFTExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
9417A96B1871E88300D9D37B /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
9417A96D1871E88300D9D37B /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
@@ -62,8 +101,6 @@
9417A9791871E88300D9D37B /* EZAudioFFTExample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "EZAudioFFTExample-Prefix.pch"; sourceTree = "<group>"; };
9417A97A1871E88300D9D37B /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
9417A97B1871E88300D9D37B /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
9417A97E1871E88300D9D37B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main_iPhone.storyboard; sourceTree = "<group>"; };
9417A9811871E88300D9D37B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main_iPad.storyboard; sourceTree = "<group>"; };
9417A9861871E88300D9D37B /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
9417A98C1871E88300D9D37B /* EZAudioFFTExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = EZAudioFFTExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
9417A98D1871E88300D9D37B /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
@@ -72,30 +109,6 @@
9417A9991871E88300D9D37B /* EZAudioFFTExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = EZAudioFFTExampleTests.m; sourceTree = "<group>"; };
9417A9A31871E89500D9D37B /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
9417A9A51871E8A100D9D37B /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; };
9417A9A81871E96300D9D37B /* AEFloatConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AEFloatConverter.h; sourceTree = "<group>"; };
9417A9A91871E96300D9D37B /* AEFloatConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AEFloatConverter.m; sourceTree = "<group>"; };
9417A9AA1871E96300D9D37B /* EZAudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudio.h; sourceTree = "<group>"; };
9417A9AB1871E96300D9D37B /* EZAudio.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudio.m; sourceTree = "<group>"; };
9417A9AC1871E96300D9D37B /* EZAudioFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFile.h; sourceTree = "<group>"; };
9417A9AD1871E96300D9D37B /* EZAudioFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFile.m; sourceTree = "<group>"; };
9417A9AE1871E96300D9D37B /* EZAudioPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlot.h; sourceTree = "<group>"; };
9417A9AF1871E96300D9D37B /* EZAudioPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlot.m; sourceTree = "<group>"; };
9417A9B01871E96300D9D37B /* EZAudioPlotGL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGL.h; sourceTree = "<group>"; };
9417A9B11871E96300D9D37B /* EZAudioPlotGL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGL.m; sourceTree = "<group>"; };
9417A9B21871E96300D9D37B /* EZAudioPlotGLKViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGLKViewController.h; sourceTree = "<group>"; };
9417A9B31871E96300D9D37B /* EZAudioPlotGLKViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGLKViewController.m; sourceTree = "<group>"; };
9417A9B41871E96300D9D37B /* EZMicrophone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZMicrophone.h; sourceTree = "<group>"; };
9417A9B51871E96300D9D37B /* EZMicrophone.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZMicrophone.m; sourceTree = "<group>"; };
9417A9B61871E96300D9D37B /* EZOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZOutput.h; sourceTree = "<group>"; };
9417A9B71871E96300D9D37B /* EZOutput.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZOutput.m; sourceTree = "<group>"; };
9417A9B81871E96300D9D37B /* EZPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZPlot.h; sourceTree = "<group>"; };
9417A9B91871E96300D9D37B /* EZPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZPlot.m; sourceTree = "<group>"; };
9417A9BA1871E96300D9D37B /* EZRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZRecorder.h; sourceTree = "<group>"; };
9417A9BB1871E96300D9D37B /* EZRecorder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZRecorder.m; sourceTree = "<group>"; };
9417A9BC1871E96300D9D37B /* TPCircularBuffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = TPCircularBuffer.c; sourceTree = "<group>"; };
9417A9BD1871E96300D9D37B /* TPCircularBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TPCircularBuffer.h; sourceTree = "<group>"; };
9417A9BF1871E96300D9D37B /* CHANGELOG */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CHANGELOG; sourceTree = "<group>"; };
9417A9C01871E96300D9D37B /* VERSION */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VERSION; sourceTree = "<group>"; };
9417A9CE1871E97D00D9D37B /* FFTViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FFTViewController.h; sourceTree = "<group>"; };
9417A9CF1871E97D00D9D37B /* FFTViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FFTViewController.m; sourceTree = "<group>"; };
9417A9D11871EA5900D9D37B /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; };
@@ -130,6 +143,56 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
6628E11C1B39D96500020E56 /* EZAudio */ = {
isa = PBXGroup;
children = (
6628E11D1B39D96500020E56 /* AEFloatConverter.h */,
6628E11E1B39D96500020E56 /* AEFloatConverter.m */,
6628E11F1B39D96500020E56 /* EZAudio.h */,
6628E1201B39D96500020E56 /* EZAudio.m */,
6628E1211B39D96500020E56 /* EZAudioDevice.h */,
6628E1221B39D96500020E56 /* EZAudioDevice.m */,
6628E1231B39D96500020E56 /* EZAudioFile.h */,
6628E1241B39D96500020E56 /* EZAudioFile.m */,
6628E1251B39D96500020E56 /* EZAudioFloatConverter.h */,
6628E1261B39D96500020E56 /* EZAudioFloatConverter.m */,
6628E1271B39D96500020E56 /* EZAudioFloatData.h */,
6628E1281B39D96500020E56 /* EZAudioFloatData.m */,
6628E1291B39D96500020E56 /* EZAudioPlayer.h */,
6628E12A1B39D96500020E56 /* EZAudioPlayer.m */,
6628E12B1B39D96500020E56 /* EZAudioPlot.h */,
6628E12C1B39D96500020E56 /* EZAudioPlot.m */,
6628E12D1B39D96500020E56 /* EZAudioPlotGL.h */,
6628E12E1B39D96500020E56 /* EZAudioPlotGL.m */,
6628E12F1B39D96500020E56 /* EZAudioPlotGLKViewController.h */,
6628E1301B39D96500020E56 /* EZAudioPlotGLKViewController.m */,
6628E1311B39D96500020E56 /* EZAudioUtilities.h */,
6628E1321B39D96500020E56 /* EZAudioUtilities.m */,
6628E1331B39D96500020E56 /* EZMicrophone.h */,
6628E1341B39D96500020E56 /* EZMicrophone.m */,
6628E1351B39D96500020E56 /* EZOutput.h */,
6628E1361B39D96500020E56 /* EZOutput.m */,
6628E1371B39D96500020E56 /* EZPlot.h */,
6628E1381B39D96500020E56 /* EZPlot.m */,
6628E1391B39D96500020E56 /* EZRecorder.h */,
6628E13A1B39D96500020E56 /* EZRecorder.m */,
6628E13B1B39D96500020E56 /* TPCircularBuffer.c */,
6628E13C1B39D96500020E56 /* TPCircularBuffer.h */,
6628E13D1B39D96500020E56 /* VERSION */,
);
name = EZAudio;
path = ../../../../EZAudio;
sourceTree = "<group>";
};
6628E13D1B39D96500020E56 /* VERSION */ = {
isa = PBXGroup;
children = (
6628E13E1B39D96500020E56 /* CHANGELOG */,
6628E13F1B39D96500020E56 /* VERSION */,
);
path = VERSION;
sourceTree = "<group>";
};
9417A95F1871E88300D9D37B = {
isa = PBXGroup;
children = (
@@ -167,11 +230,10 @@
9417A9711871E88300D9D37B /* EZAudioFFTExample */ = {
isa = PBXGroup;
children = (
9417A9A71871E96300D9D37B /* EZAudio */,
6628E11C1B39D96500020E56 /* EZAudio */,
9417A97A1871E88300D9D37B /* AppDelegate.h */,
9417A97B1871E88300D9D37B /* AppDelegate.m */,
9417A97D1871E88300D9D37B /* Main_iPhone.storyboard */,
9417A9801871E88300D9D37B /* Main_iPad.storyboard */,
6628E2321B39F7CC00020E56 /* MainStoryboard.storyboard */,
9417A9CE1871E97D00D9D37B /* FFTViewController.h */,
9417A9CF1871E97D00D9D37B /* FFTViewController.m */,
9417A9861871E88300D9D37B /* Images.xcassets */,
@@ -209,46 +271,6 @@
name = "Supporting Files";
sourceTree = "<group>";
};
9417A9A71871E96300D9D37B /* EZAudio */ = {
isa = PBXGroup;
children = (
9417A9A81871E96300D9D37B /* AEFloatConverter.h */,
9417A9A91871E96300D9D37B /* AEFloatConverter.m */,
9417A9AA1871E96300D9D37B /* EZAudio.h */,
9417A9AB1871E96300D9D37B /* EZAudio.m */,
9417A9AC1871E96300D9D37B /* EZAudioFile.h */,
9417A9AD1871E96300D9D37B /* EZAudioFile.m */,
9417A9AE1871E96300D9D37B /* EZAudioPlot.h */,
9417A9AF1871E96300D9D37B /* EZAudioPlot.m */,
9417A9B01871E96300D9D37B /* EZAudioPlotGL.h */,
9417A9B11871E96300D9D37B /* EZAudioPlotGL.m */,
9417A9B21871E96300D9D37B /* EZAudioPlotGLKViewController.h */,
9417A9B31871E96300D9D37B /* EZAudioPlotGLKViewController.m */,
9417A9B41871E96300D9D37B /* EZMicrophone.h */,
9417A9B51871E96300D9D37B /* EZMicrophone.m */,
9417A9B61871E96300D9D37B /* EZOutput.h */,
9417A9B71871E96300D9D37B /* EZOutput.m */,
9417A9B81871E96300D9D37B /* EZPlot.h */,
9417A9B91871E96300D9D37B /* EZPlot.m */,
9417A9BA1871E96300D9D37B /* EZRecorder.h */,
9417A9BB1871E96300D9D37B /* EZRecorder.m */,
9417A9BC1871E96300D9D37B /* TPCircularBuffer.c */,
9417A9BD1871E96300D9D37B /* TPCircularBuffer.h */,
9417A9BE1871E96300D9D37B /* VERSION */,
);
name = EZAudio;
path = ../../../../EZAudio;
sourceTree = "<group>";
};
9417A9BE1871E96300D9D37B /* VERSION */ = {
isa = PBXGroup;
children = (
9417A9BF1871E96300D9D37B /* CHANGELOG */,
9417A9C01871E96300D9D37B /* VERSION */,
);
path = VERSION;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -325,12 +347,11 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9417A9821871E88300D9D37B /* Main_iPad.storyboard in Resources */,
9417A9871871E88300D9D37B /* Images.xcassets in Resources */,
9417A97F1871E88300D9D37B /* Main_iPhone.storyboard in Resources */,
9417A9CD1871E96300D9D37B /* VERSION in Resources */,
6628E2331B39F7CC00020E56 /* MainStoryboard.storyboard in Resources */,
6628E1511B39D96500020E56 /* VERSION in Resources */,
9417A9761871E88300D9D37B /* InfoPlist.strings in Resources */,
9417A9CC1871E96300D9D37B /* CHANGELOG in Resources */,
6628E1501B39D96500020E56 /* CHANGELOG in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -349,20 +370,25 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9417A9CB1871E96300D9D37B /* TPCircularBuffer.c in Sources */,
9417A9C81871E96300D9D37B /* EZOutput.m in Sources */,
9417A9C61871E96300D9D37B /* EZAudioPlotGLKViewController.m in Sources */,
9417A9C11871E96300D9D37B /* AEFloatConverter.m in Sources */,
6628E14E1B39D96500020E56 /* EZRecorder.m in Sources */,
9417A97C1871E88300D9D37B /* AppDelegate.m in Sources */,
9417A9C41871E96300D9D37B /* EZAudioPlot.m in Sources */,
9417A9C31871E96300D9D37B /* EZAudioFile.m in Sources */,
6628E1441B39D96500020E56 /* EZAudioFloatConverter.m in Sources */,
6628E1451B39D96500020E56 /* EZAudioFloatData.m in Sources */,
6628E1401B39D96500020E56 /* AEFloatConverter.m in Sources */,
6628E1431B39D96500020E56 /* EZAudioFile.m in Sources */,
6628E14C1B39D96500020E56 /* EZOutput.m in Sources */,
6628E1481B39D96500020E56 /* EZAudioPlotGL.m in Sources */,
6628E14F1B39D96500020E56 /* TPCircularBuffer.c in Sources */,
6628E1471B39D96500020E56 /* EZAudioPlot.m in Sources */,
9417A9D01871E97D00D9D37B /* FFTViewController.m in Sources */,
9417A9C51871E96300D9D37B /* EZAudioPlotGL.m in Sources */,
6628E14B1B39D96500020E56 /* EZMicrophone.m in Sources */,
6628E1461B39D96500020E56 /* EZAudioPlayer.m in Sources */,
6628E1421B39D96500020E56 /* EZAudioDevice.m in Sources */,
9417A9781871E88300D9D37B /* main.m in Sources */,
9417A9C91871E96300D9D37B /* EZPlot.m in Sources */,
9417A9C71871E96300D9D37B /* EZMicrophone.m in Sources */,
9417A9CA1871E96300D9D37B /* EZRecorder.m in Sources */,
9417A9C21871E96300D9D37B /* EZAudio.m in Sources */,
6628E14D1B39D96500020E56 /* EZPlot.m in Sources */,
6628E1411B39D96500020E56 /* EZAudio.m in Sources */,
6628E14A1B39D96500020E56 /* EZAudioUtilities.m in Sources */,
6628E1491B39D96500020E56 /* EZAudioPlotGLKViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -393,22 +419,6 @@
name = InfoPlist.strings;
sourceTree = "<group>";
};
9417A97D1871E88300D9D37B /* Main_iPhone.storyboard */ = {
isa = PBXVariantGroup;
children = (
9417A97E1871E88300D9D37B /* Base */,
);
name = Main_iPhone.storyboard;
sourceTree = "<group>";
};
9417A9801871E88300D9D37B /* Main_iPad.storyboard */ = {
isa = PBXVariantGroup;
children = (
9417A9811871E88300D9D37B /* Base */,
);
name = Main_iPad.storyboard;
sourceTree = "<group>";
};
9417A9961871E88300D9D37B /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
@@ -1,96 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9417A9671871E88300D9D37B"
BuildableName = "EZAudioFFTExample.app"
BlueprintName = "EZAudioFFTExample"
ReferencedContainer = "container:EZAudioFFTExample.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9417A98B1871E88300D9D37B"
BuildableName = "EZAudioFFTExampleTests.xctest"
BlueprintName = "EZAudioFFTExampleTests"
ReferencedContainer = "container:EZAudioFFTExample.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9417A9671871E88300D9D37B"
BuildableName = "EZAudioFFTExample.app"
BlueprintName = "EZAudioFFTExample"
ReferencedContainer = "container:EZAudioFFTExample.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9417A9671871E88300D9D37B"
BuildableName = "EZAudioFFTExample.app"
BlueprintName = "EZAudioFFTExample"
ReferencedContainer = "container:EZAudioFFTExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9417A9671871E88300D9D37B"
BuildableName = "EZAudioFFTExample.app"
BlueprintName = "EZAudioFFTExample"
ReferencedContainer = "container:EZAudioFFTExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -1,27 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>EZAudioFFTExample.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>6</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>9417A9671871E88300D9D37B</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>9417A98B1871E88300D9D37B</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
@@ -1,58 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4514" systemVersion="13A603" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3747"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="FFTViewController" sceneMemberID="viewController">
<connections>
<outlet property="audioPlotFreq" destination="DSa-vR-ySS" id="JP5-yB-Jqo"/>
<outlet property="audioPlotTime" destination="Za4-u7-8h1" id="ox5-AQ-DaQ"/>
<outlet property="view" destination="e0f-bI-AGV" id="oLT-9I-NIK"/>
</connections>
</viewController>
<view contentMode="scaleToFill" id="e0f-bI-AGV">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Za4-u7-8h1" customClass="EZAudioPlotGL">
<rect key="frame" x="0.0" y="0.0" width="320" height="284"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="height" relation="lessThanOrEqual" constant="284" id="lUL-Pa-hHs"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="DSa-vR-ySS" customClass="EZAudioPlot">
<rect key="frame" x="0.0" y="284" width="320" height="284"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="height" relation="lessThanOrEqual" priority="86" constant="284" id="aNL-Q8-MOw"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="DSa-vR-ySS" secondAttribute="trailing" id="FOI-4L-3b8"/>
<constraint firstItem="DSa-vR-ySS" firstAttribute="leading" secondItem="e0f-bI-AGV" secondAttribute="leading" id="LTm-AL-Oqz"/>
<constraint firstAttribute="trailing" secondItem="Za4-u7-8h1" secondAttribute="trailing" id="SLb-8B-cNK"/>
<constraint firstItem="DSa-vR-ySS" firstAttribute="top" secondItem="Za4-u7-8h1" secondAttribute="bottom" id="cef-HS-Uiw"/>
<constraint firstItem="Za4-u7-8h1" firstAttribute="leading" secondItem="e0f-bI-AGV" secondAttribute="leading" id="fe0-ef-NkA"/>
<constraint firstAttribute="bottom" secondItem="DSa-vR-ySS" secondAttribute="bottom" id="oDL-Qh-0Ei"/>
<constraint firstItem="Za4-u7-8h1" firstAttribute="top" secondItem="e0f-bI-AGV" secondAttribute="top" id="zKR-dO-8wP"/>
</constraints>
</view>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar" statusBarStyle="blackOpaque"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination"/>
</simulatedMetricsContainer>
</document>
@@ -1,58 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6185.11" systemVersion="13E28" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="vXZ-lx-hvc">
<dependencies>
<deployment defaultVersion="1792" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6190.4"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="ufC-wZ-h7g">
<objects>
<viewController id="vXZ-lx-hvc" customClass="FFTViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="SDG-bW-D9N"/>
<viewControllerLayoutGuide type="bottom" id="Ghx-UD-SsY"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="0IN-AU-L5p" customClass="EZAudioPlotGL">
<rect key="frame" x="0.0" y="0.0" width="320" height="284"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="tRL-re-aMl" customClass="EZAudioPlot">
<rect key="frame" x="0.0" y="284" width="320" height="284"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="tRL-re-aMl" firstAttribute="height" secondItem="0IN-AU-L5p" secondAttribute="height" id="0x5-uT-6oH"/>
<constraint firstItem="tRL-re-aMl" firstAttribute="leading" secondItem="kh9-bI-dsS" secondAttribute="leading" id="1PO-c6-Jpi"/>
<constraint firstItem="0IN-AU-L5p" firstAttribute="top" secondItem="kh9-bI-dsS" secondAttribute="top" id="3j1-j9-0EV"/>
<constraint firstItem="Ghx-UD-SsY" firstAttribute="top" secondItem="tRL-re-aMl" secondAttribute="bottom" id="9sP-5w-dcD"/>
<constraint firstAttribute="trailing" secondItem="tRL-re-aMl" secondAttribute="trailing" id="KSC-e5-GVL"/>
<constraint firstItem="0IN-AU-L5p" firstAttribute="leading" secondItem="kh9-bI-dsS" secondAttribute="leading" id="Ut5-w2-ONV"/>
<constraint firstItem="tRL-re-aMl" firstAttribute="top" secondItem="0IN-AU-L5p" secondAttribute="bottom" id="V11-Sm-jlk"/>
<constraint firstAttribute="trailing" secondItem="0IN-AU-L5p" secondAttribute="trailing" id="XFq-Me-fvw"/>
</constraints>
</view>
<connections>
<outlet property="audioPlotFreq" destination="tRL-re-aMl" id="s8q-c6-u9E"/>
<outlet property="audioPlotTime" destination="0IN-AU-L5p" id="tej-Kb-ycI"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4">
<size key="portraitSize" width="320" height="568"/>
<size key="landscapeSize" width="568" height="320"/>
</simulatedScreenMetrics>
</simulatedMetricsContainer>
</document>
@@ -25,13 +25,15 @@
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIMainStoryboardFile</key>
<string>Main_iPhone</string>
<string>MainStoryboard</string>
<key>UIMainStoryboardFile~ipad</key>
<string>Main_iPad</string>
<string>MainStoryboard</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleLightContent</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
@@ -44,12 +44,12 @@
/**
EZAudioPlot for frequency plot
*/
@property (nonatomic,weak) IBOutlet EZAudioPlot *audioPlotFreq;
@property (nonatomic,weak) IBOutlet EZAudioPlotGL *audioPlotFreq;
/**
EZAudioPlot for time plot
*/
@property (nonatomic,weak) IBOutlet EZAudioPlotGL *audioPlotTime;
@property (nonatomic,weak) IBOutlet EZAudioPlot *audioPlotTime;
/**
Microphone
@@ -38,6 +38,12 @@
@synthesize audioPlotTime;
@synthesize microphone;
#pragma mark - Status Bar Style
- (UIStatusBarStyle)preferredStatusBarStyle
{
return UIStatusBarStyleLightContent;
}
#pragma mark - Customize the Audio Plot
- (void)viewDidLoad
{
@@ -121,7 +127,7 @@
// Calculate the magnitude
float mag = _A.realp[i]*_A.realp[i]+_A.imagp[i]*_A.imagp[i];
// Bind the value to be less than 1.0 to fit in the graph
amp[i] = [EZAudio MAP:mag leftMin:0.0 leftMax:maxMag rightMin:0.0 rightMax:1.0];
amp[i] = [EZAudioUtilities MAP:mag leftMin:0.0 leftMax:maxMag rightMin:0.0 rightMax:1.0];
}
// Update the frequency domain plot
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7702" systemVersion="14C109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="Weo-wK-GIV">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7701"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="JgX-xL-1L8">
<objects>
<viewController id="Weo-wK-GIV" customClass="FFTViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Gb6-mY-qlI"/>
<viewControllerLayoutGuide type="bottom" id="YgU-XB-3Wp"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="qdz-w1-Fnd">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="rTC-r5-1nY" customClass="EZAudioPlotGL">
<rect key="frame" x="0.0" y="300" width="600" height="300"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="OQU-xT-TSP" customClass="EZAudioPlot">
<rect key="frame" x="0.0" y="0.0" width="600" height="300"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="rTC-r5-1nY" firstAttribute="top" secondItem="OQU-xT-TSP" secondAttribute="bottom" id="Gvx-p5-QUo"/>
<constraint firstAttribute="trailing" secondItem="OQU-xT-TSP" secondAttribute="trailing" id="Jas-mw-vJx"/>
<constraint firstItem="rTC-r5-1nY" firstAttribute="leading" secondItem="qdz-w1-Fnd" secondAttribute="leading" id="L4g-Ae-9tj"/>
<constraint firstItem="rTC-r5-1nY" firstAttribute="leading" secondItem="qdz-w1-Fnd" secondAttribute="leading" id="R76-NA-7Bd"/>
<constraint firstAttribute="trailing" secondItem="rTC-r5-1nY" secondAttribute="trailing" id="SD1-rQ-K9f"/>
<constraint firstItem="OQU-xT-TSP" firstAttribute="leading" secondItem="qdz-w1-Fnd" secondAttribute="leading" id="Ylv-YL-VNN"/>
<constraint firstItem="rTC-r5-1nY" firstAttribute="height" secondItem="OQU-xT-TSP" secondAttribute="height" id="c8v-Wf-j6b"/>
<constraint firstItem="OQU-xT-TSP" firstAttribute="leading" secondItem="qdz-w1-Fnd" secondAttribute="leading" id="cky-9G-OUa"/>
<constraint firstItem="YgU-XB-3Wp" firstAttribute="top" secondItem="rTC-r5-1nY" secondAttribute="bottom" id="diI-fy-02O"/>
<constraint firstAttribute="trailing" secondItem="OQU-xT-TSP" secondAttribute="trailing" id="eU7-t0-VFY"/>
<constraint firstItem="OQU-xT-TSP" firstAttribute="top" secondItem="qdz-w1-Fnd" secondAttribute="top" id="vV1-yG-7ff"/>
<constraint firstAttribute="trailing" secondItem="rTC-r5-1nY" secondAttribute="trailing" id="whu-w2-7Ne"/>
<constraint firstItem="OQU-xT-TSP" firstAttribute="top" secondItem="qdz-w1-Fnd" secondAttribute="top" id="zIe-GV-q0c"/>
</constraints>
</view>
<connections>
<outlet property="audioPlotFreq" destination="rTC-r5-1nY" id="CRN-vl-avP"/>
<outlet property="audioPlotTime" destination="OQU-xT-TSP" id="zfe-04-ywd"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="xe6-rr-s1W" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="537" y="40"/>
</scene>
</scenes>
</document>
@@ -7,14 +7,31 @@
objects = {
/* Begin PBXBuildFile section */
6628E10A1B39D8D000020E56 /* AEFloatConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E0E81B39D8D000020E56 /* AEFloatConverter.m */; };
6628E10B1B39D8D000020E56 /* EZAudio.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E0EA1B39D8D000020E56 /* EZAudio.m */; };
6628E10C1B39D8D000020E56 /* EZAudioDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E0EC1B39D8D000020E56 /* EZAudioDevice.m */; };
6628E10D1B39D8D000020E56 /* EZAudioFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E0EE1B39D8D000020E56 /* EZAudioFile.m */; };
6628E10E1B39D8D000020E56 /* EZAudioFloatConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E0F01B39D8D000020E56 /* EZAudioFloatConverter.m */; };
6628E10F1B39D8D000020E56 /* EZAudioFloatData.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E0F21B39D8D000020E56 /* EZAudioFloatData.m */; };
6628E1101B39D8D000020E56 /* EZAudioPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E0F41B39D8D000020E56 /* EZAudioPlayer.m */; };
6628E1111B39D8D000020E56 /* EZAudioPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E0F61B39D8D000020E56 /* EZAudioPlot.m */; };
6628E1121B39D8D000020E56 /* EZAudioPlotGL.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E0F81B39D8D000020E56 /* EZAudioPlotGL.m */; };
6628E1131B39D8D000020E56 /* EZAudioPlotGLKViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E0FA1B39D8D000020E56 /* EZAudioPlotGLKViewController.m */; };
6628E1141B39D8D000020E56 /* EZAudioUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E0FC1B39D8D000020E56 /* EZAudioUtilities.m */; };
6628E1151B39D8D000020E56 /* EZMicrophone.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E0FE1B39D8D000020E56 /* EZMicrophone.m */; };
6628E1161B39D8D000020E56 /* EZOutput.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E1001B39D8D000020E56 /* EZOutput.m */; };
6628E1171B39D8D000020E56 /* EZPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E1021B39D8D000020E56 /* EZPlot.m */; };
6628E1181B39D8D000020E56 /* EZRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E1041B39D8D000020E56 /* EZRecorder.m */; };
6628E1191B39D8D000020E56 /* TPCircularBuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 6628E1051B39D8D000020E56 /* TPCircularBuffer.c */; };
6628E11A1B39D8D000020E56 /* CHANGELOG in Resources */ = {isa = PBXBuildFile; fileRef = 6628E1081B39D8D000020E56 /* CHANGELOG */; };
6628E11B1B39D8D000020E56 /* VERSION in Resources */ = {isa = PBXBuildFile; fileRef = 6628E1091B39D8D000020E56 /* VERSION */; };
66DB85B81B05714F0018EFC5 /* MainStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 66DB85B71B05714F0018EFC5 /* MainStoryboard.storyboard */; };
94056FEC185E5EAF00EB94BA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 94056FEB185E5EAF00EB94BA /* Foundation.framework */; };
94056FEE185E5EAF00EB94BA /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 94056FED185E5EAF00EB94BA /* CoreGraphics.framework */; };
94056FF0185E5EAF00EB94BA /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 94056FEF185E5EAF00EB94BA /* UIKit.framework */; };
94056FF6185E5EAF00EB94BA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 94056FF4185E5EAF00EB94BA /* InfoPlist.strings */; };
94056FF8185E5EAF00EB94BA /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 94056FF7185E5EAF00EB94BA /* main.m */; };
94056FFC185E5EAF00EB94BA /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 94056FFB185E5EAF00EB94BA /* AppDelegate.m */; };
94056FFF185E5EAF00EB94BA /* Main_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 94056FFD185E5EAF00EB94BA /* Main_iPhone.storyboard */; };
94057002185E5EAF00EB94BA /* Main_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 94057000185E5EAF00EB94BA /* Main_iPad.storyboard */; };
94057007185E5EAF00EB94BA /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 94057006185E5EAF00EB94BA /* Images.xcassets */; };
9405700E185E5EAF00EB94BA /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9405700D185E5EAF00EB94BA /* XCTest.framework */; };
9405700F185E5EAF00EB94BA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 94056FEB185E5EAF00EB94BA /* Foundation.framework */; };
@@ -24,19 +41,6 @@
94057050185E636100EB94BA /* OpenGLWaveformViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9405704F185E636100EB94BA /* OpenGLWaveformViewController.m */; };
9417A6CB18658FC900D9D37B /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9417A6CA18658FC900D9D37B /* AudioToolbox.framework */; };
9417A6CD18658FCD00D9D37B /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9417A6CC18658FCD00D9D37B /* GLKit.framework */; };
9417A8011867DDE300D9D37B /* AEFloatConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7E91867DDE300D9D37B /* AEFloatConverter.m */; };
9417A8021867DDE300D9D37B /* EZAudio.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7EB1867DDE300D9D37B /* EZAudio.m */; };
9417A8031867DDE300D9D37B /* EZAudioFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7ED1867DDE300D9D37B /* EZAudioFile.m */; };
9417A8041867DDE300D9D37B /* EZAudioPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7EF1867DDE300D9D37B /* EZAudioPlot.m */; };
9417A8051867DDE300D9D37B /* EZAudioPlotGL.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7F11867DDE300D9D37B /* EZAudioPlotGL.m */; };
9417A8061867DDE300D9D37B /* EZAudioPlotGLKViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7F31867DDE300D9D37B /* EZAudioPlotGLKViewController.m */; };
9417A8071867DDE300D9D37B /* EZMicrophone.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7F51867DDE300D9D37B /* EZMicrophone.m */; };
9417A8081867DDE300D9D37B /* EZOutput.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7F71867DDE300D9D37B /* EZOutput.m */; };
9417A8091867DDE300D9D37B /* EZPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7F91867DDE300D9D37B /* EZPlot.m */; };
9417A80A1867DDE300D9D37B /* EZRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7FB1867DDE300D9D37B /* EZRecorder.m */; };
9417A80B1867DDE300D9D37B /* TPCircularBuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 9417A7FC1867DDE300D9D37B /* TPCircularBuffer.c */; };
9417A80C1867DDE300D9D37B /* CHANGELOG in Resources */ = {isa = PBXBuildFile; fileRef = 9417A7FF1867DDE300D9D37B /* CHANGELOG */; };
9417A80D1867DDE300D9D37B /* VERSION in Resources */ = {isa = PBXBuildFile; fileRef = 9417A8001867DDE300D9D37B /* VERSION */; };
94FBB77518B15698007CAE45 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 94FBB77418B15698007CAE45 /* AVFoundation.framework */; };
/* End PBXBuildFile section */
@@ -51,6 +55,41 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
6628E0E71B39D8D000020E56 /* AEFloatConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AEFloatConverter.h; sourceTree = "<group>"; };
6628E0E81B39D8D000020E56 /* AEFloatConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AEFloatConverter.m; sourceTree = "<group>"; };
6628E0E91B39D8D000020E56 /* EZAudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudio.h; sourceTree = "<group>"; };
6628E0EA1B39D8D000020E56 /* EZAudio.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudio.m; sourceTree = "<group>"; };
6628E0EB1B39D8D000020E56 /* EZAudioDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioDevice.h; sourceTree = "<group>"; };
6628E0EC1B39D8D000020E56 /* EZAudioDevice.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioDevice.m; sourceTree = "<group>"; };
6628E0ED1B39D8D000020E56 /* EZAudioFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFile.h; sourceTree = "<group>"; };
6628E0EE1B39D8D000020E56 /* EZAudioFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFile.m; sourceTree = "<group>"; };
6628E0EF1B39D8D000020E56 /* EZAudioFloatConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFloatConverter.h; sourceTree = "<group>"; };
6628E0F01B39D8D000020E56 /* EZAudioFloatConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFloatConverter.m; sourceTree = "<group>"; };
6628E0F11B39D8D000020E56 /* EZAudioFloatData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFloatData.h; sourceTree = "<group>"; };
6628E0F21B39D8D000020E56 /* EZAudioFloatData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFloatData.m; sourceTree = "<group>"; };
6628E0F31B39D8D000020E56 /* EZAudioPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlayer.h; sourceTree = "<group>"; };
6628E0F41B39D8D000020E56 /* EZAudioPlayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlayer.m; sourceTree = "<group>"; };
6628E0F51B39D8D000020E56 /* EZAudioPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlot.h; sourceTree = "<group>"; };
6628E0F61B39D8D000020E56 /* EZAudioPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlot.m; sourceTree = "<group>"; };
6628E0F71B39D8D000020E56 /* EZAudioPlotGL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGL.h; sourceTree = "<group>"; };
6628E0F81B39D8D000020E56 /* EZAudioPlotGL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGL.m; sourceTree = "<group>"; };
6628E0F91B39D8D000020E56 /* EZAudioPlotGLKViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGLKViewController.h; sourceTree = "<group>"; };
6628E0FA1B39D8D000020E56 /* EZAudioPlotGLKViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGLKViewController.m; sourceTree = "<group>"; };
6628E0FB1B39D8D000020E56 /* EZAudioUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioUtilities.h; sourceTree = "<group>"; };
6628E0FC1B39D8D000020E56 /* EZAudioUtilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioUtilities.m; sourceTree = "<group>"; };
6628E0FD1B39D8D000020E56 /* EZMicrophone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZMicrophone.h; sourceTree = "<group>"; };
6628E0FE1B39D8D000020E56 /* EZMicrophone.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZMicrophone.m; sourceTree = "<group>"; };
6628E0FF1B39D8D000020E56 /* EZOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZOutput.h; sourceTree = "<group>"; };
6628E1001B39D8D000020E56 /* EZOutput.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZOutput.m; sourceTree = "<group>"; };
6628E1011B39D8D000020E56 /* EZPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZPlot.h; sourceTree = "<group>"; };
6628E1021B39D8D000020E56 /* EZPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZPlot.m; sourceTree = "<group>"; };
6628E1031B39D8D000020E56 /* EZRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZRecorder.h; sourceTree = "<group>"; };
6628E1041B39D8D000020E56 /* EZRecorder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZRecorder.m; sourceTree = "<group>"; };
6628E1051B39D8D000020E56 /* TPCircularBuffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = TPCircularBuffer.c; sourceTree = "<group>"; };
6628E1061B39D8D000020E56 /* TPCircularBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TPCircularBuffer.h; sourceTree = "<group>"; };
6628E1081B39D8D000020E56 /* CHANGELOG */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CHANGELOG; sourceTree = "<group>"; };
6628E1091B39D8D000020E56 /* VERSION */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VERSION; sourceTree = "<group>"; };
66DB85B71B05714F0018EFC5 /* MainStoryboard.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = MainStoryboard.storyboard; sourceTree = "<group>"; };
94056FE8185E5EAF00EB94BA /* EZAudioOpenGLWaveformExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = EZAudioOpenGLWaveformExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
94056FEB185E5EAF00EB94BA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
94056FED185E5EAF00EB94BA /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
@@ -61,8 +100,6 @@
94056FF9185E5EAF00EB94BA /* EZAudioOpenGLWaveformExample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "EZAudioOpenGLWaveformExample-Prefix.pch"; sourceTree = "<group>"; };
94056FFA185E5EAF00EB94BA /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
94056FFB185E5EAF00EB94BA /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
94056FFE185E5EAF00EB94BA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main_iPhone.storyboard; sourceTree = "<group>"; };
94057001185E5EAF00EB94BA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main_iPad.storyboard; sourceTree = "<group>"; };
94057006185E5EAF00EB94BA /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
9405700C185E5EAF00EB94BA /* EZAudioOpenGLWaveformExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = EZAudioOpenGLWaveformExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
9405700D185E5EAF00EB94BA /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
@@ -73,30 +110,6 @@
9405704F185E636100EB94BA /* OpenGLWaveformViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OpenGLWaveformViewController.m; sourceTree = "<group>"; };
9417A6CA18658FC900D9D37B /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
9417A6CC18658FCD00D9D37B /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; };
9417A7E81867DDE300D9D37B /* AEFloatConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AEFloatConverter.h; sourceTree = "<group>"; };
9417A7E91867DDE300D9D37B /* AEFloatConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AEFloatConverter.m; sourceTree = "<group>"; };
9417A7EA1867DDE300D9D37B /* EZAudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudio.h; sourceTree = "<group>"; };
9417A7EB1867DDE300D9D37B /* EZAudio.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudio.m; sourceTree = "<group>"; };
9417A7EC1867DDE300D9D37B /* EZAudioFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFile.h; sourceTree = "<group>"; };
9417A7ED1867DDE300D9D37B /* EZAudioFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFile.m; sourceTree = "<group>"; };
9417A7EE1867DDE300D9D37B /* EZAudioPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlot.h; sourceTree = "<group>"; };
9417A7EF1867DDE300D9D37B /* EZAudioPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlot.m; sourceTree = "<group>"; };
9417A7F01867DDE300D9D37B /* EZAudioPlotGL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGL.h; sourceTree = "<group>"; };
9417A7F11867DDE300D9D37B /* EZAudioPlotGL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGL.m; sourceTree = "<group>"; };
9417A7F21867DDE300D9D37B /* EZAudioPlotGLKViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGLKViewController.h; sourceTree = "<group>"; };
9417A7F31867DDE300D9D37B /* EZAudioPlotGLKViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGLKViewController.m; sourceTree = "<group>"; };
9417A7F41867DDE300D9D37B /* EZMicrophone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZMicrophone.h; sourceTree = "<group>"; };
9417A7F51867DDE300D9D37B /* EZMicrophone.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZMicrophone.m; sourceTree = "<group>"; };
9417A7F61867DDE300D9D37B /* EZOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZOutput.h; sourceTree = "<group>"; };
9417A7F71867DDE300D9D37B /* EZOutput.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZOutput.m; sourceTree = "<group>"; };
9417A7F81867DDE300D9D37B /* EZPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZPlot.h; sourceTree = "<group>"; };
9417A7F91867DDE300D9D37B /* EZPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZPlot.m; sourceTree = "<group>"; };
9417A7FA1867DDE300D9D37B /* EZRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZRecorder.h; sourceTree = "<group>"; };
9417A7FB1867DDE300D9D37B /* EZRecorder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZRecorder.m; sourceTree = "<group>"; };
9417A7FC1867DDE300D9D37B /* TPCircularBuffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = TPCircularBuffer.c; sourceTree = "<group>"; };
9417A7FD1867DDE300D9D37B /* TPCircularBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TPCircularBuffer.h; sourceTree = "<group>"; };
9417A7FF1867DDE300D9D37B /* CHANGELOG */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CHANGELOG; sourceTree = "<group>"; };
9417A8001867DDE300D9D37B /* VERSION */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VERSION; sourceTree = "<group>"; };
94FBB77418B15698007CAE45 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */
@@ -127,6 +140,56 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
6628E0E61B39D8D000020E56 /* EZAudio */ = {
isa = PBXGroup;
children = (
6628E0E71B39D8D000020E56 /* AEFloatConverter.h */,
6628E0E81B39D8D000020E56 /* AEFloatConverter.m */,
6628E0E91B39D8D000020E56 /* EZAudio.h */,
6628E0EA1B39D8D000020E56 /* EZAudio.m */,
6628E0EB1B39D8D000020E56 /* EZAudioDevice.h */,
6628E0EC1B39D8D000020E56 /* EZAudioDevice.m */,
6628E0ED1B39D8D000020E56 /* EZAudioFile.h */,
6628E0EE1B39D8D000020E56 /* EZAudioFile.m */,
6628E0EF1B39D8D000020E56 /* EZAudioFloatConverter.h */,
6628E0F01B39D8D000020E56 /* EZAudioFloatConverter.m */,
6628E0F11B39D8D000020E56 /* EZAudioFloatData.h */,
6628E0F21B39D8D000020E56 /* EZAudioFloatData.m */,
6628E0F31B39D8D000020E56 /* EZAudioPlayer.h */,
6628E0F41B39D8D000020E56 /* EZAudioPlayer.m */,
6628E0F51B39D8D000020E56 /* EZAudioPlot.h */,
6628E0F61B39D8D000020E56 /* EZAudioPlot.m */,
6628E0F71B39D8D000020E56 /* EZAudioPlotGL.h */,
6628E0F81B39D8D000020E56 /* EZAudioPlotGL.m */,
6628E0F91B39D8D000020E56 /* EZAudioPlotGLKViewController.h */,
6628E0FA1B39D8D000020E56 /* EZAudioPlotGLKViewController.m */,
6628E0FB1B39D8D000020E56 /* EZAudioUtilities.h */,
6628E0FC1B39D8D000020E56 /* EZAudioUtilities.m */,
6628E0FD1B39D8D000020E56 /* EZMicrophone.h */,
6628E0FE1B39D8D000020E56 /* EZMicrophone.m */,
6628E0FF1B39D8D000020E56 /* EZOutput.h */,
6628E1001B39D8D000020E56 /* EZOutput.m */,
6628E1011B39D8D000020E56 /* EZPlot.h */,
6628E1021B39D8D000020E56 /* EZPlot.m */,
6628E1031B39D8D000020E56 /* EZRecorder.h */,
6628E1041B39D8D000020E56 /* EZRecorder.m */,
6628E1051B39D8D000020E56 /* TPCircularBuffer.c */,
6628E1061B39D8D000020E56 /* TPCircularBuffer.h */,
6628E1071B39D8D000020E56 /* VERSION */,
);
name = EZAudio;
path = ../../../../EZAudio;
sourceTree = "<group>";
};
6628E1071B39D8D000020E56 /* VERSION */ = {
isa = PBXGroup;
children = (
6628E1081B39D8D000020E56 /* CHANGELOG */,
6628E1091B39D8D000020E56 /* VERSION */,
);
path = VERSION;
sourceTree = "<group>";
};
94056FDF185E5EAF00EB94BA = {
isa = PBXGroup;
children = (
@@ -163,11 +226,10 @@
94056FF1185E5EAF00EB94BA /* EZAudioOpenGLWaveformExample */ = {
isa = PBXGroup;
children = (
9417A7E71867DDE300D9D37B /* EZAudio */,
6628E0E61B39D8D000020E56 /* EZAudio */,
94056FFA185E5EAF00EB94BA /* AppDelegate.h */,
94056FFB185E5EAF00EB94BA /* AppDelegate.m */,
94056FFD185E5EAF00EB94BA /* Main_iPhone.storyboard */,
94057000185E5EAF00EB94BA /* Main_iPad.storyboard */,
66DB85B71B05714F0018EFC5 /* MainStoryboard.storyboard */,
9405704E185E636100EB94BA /* OpenGLWaveformViewController.h */,
9405704F185E636100EB94BA /* OpenGLWaveformViewController.m */,
94057006185E5EAF00EB94BA /* Images.xcassets */,
@@ -205,46 +267,6 @@
name = "Supporting Files";
sourceTree = "<group>";
};
9417A7E71867DDE300D9D37B /* EZAudio */ = {
isa = PBXGroup;
children = (
9417A7E81867DDE300D9D37B /* AEFloatConverter.h */,
9417A7E91867DDE300D9D37B /* AEFloatConverter.m */,
9417A7EA1867DDE300D9D37B /* EZAudio.h */,
9417A7EB1867DDE300D9D37B /* EZAudio.m */,
9417A7EC1867DDE300D9D37B /* EZAudioFile.h */,
9417A7ED1867DDE300D9D37B /* EZAudioFile.m */,
9417A7EE1867DDE300D9D37B /* EZAudioPlot.h */,
9417A7EF1867DDE300D9D37B /* EZAudioPlot.m */,
9417A7F01867DDE300D9D37B /* EZAudioPlotGL.h */,
9417A7F11867DDE300D9D37B /* EZAudioPlotGL.m */,
9417A7F21867DDE300D9D37B /* EZAudioPlotGLKViewController.h */,
9417A7F31867DDE300D9D37B /* EZAudioPlotGLKViewController.m */,
9417A7F41867DDE300D9D37B /* EZMicrophone.h */,
9417A7F51867DDE300D9D37B /* EZMicrophone.m */,
9417A7F61867DDE300D9D37B /* EZOutput.h */,
9417A7F71867DDE300D9D37B /* EZOutput.m */,
9417A7F81867DDE300D9D37B /* EZPlot.h */,
9417A7F91867DDE300D9D37B /* EZPlot.m */,
9417A7FA1867DDE300D9D37B /* EZRecorder.h */,
9417A7FB1867DDE300D9D37B /* EZRecorder.m */,
9417A7FC1867DDE300D9D37B /* TPCircularBuffer.c */,
9417A7FD1867DDE300D9D37B /* TPCircularBuffer.h */,
9417A7FE1867DDE300D9D37B /* VERSION */,
);
name = EZAudio;
path = ../../../../EZAudio;
sourceTree = "<group>";
};
9417A7FE1867DDE300D9D37B /* VERSION */ = {
isa = PBXGroup;
children = (
9417A7FF1867DDE300D9D37B /* CHANGELOG */,
9417A8001867DDE300D9D37B /* VERSION */,
);
path = VERSION;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -321,12 +343,11 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
94057002185E5EAF00EB94BA /* Main_iPad.storyboard in Resources */,
94057007185E5EAF00EB94BA /* Images.xcassets in Resources */,
94056FFF185E5EAF00EB94BA /* Main_iPhone.storyboard in Resources */,
9417A80D1867DDE300D9D37B /* VERSION in Resources */,
6628E11A1B39D8D000020E56 /* CHANGELOG in Resources */,
66DB85B81B05714F0018EFC5 /* MainStoryboard.storyboard in Resources */,
94056FF6185E5EAF00EB94BA /* InfoPlist.strings in Resources */,
9417A80C1867DDE300D9D37B /* CHANGELOG in Resources */,
6628E11B1B39D8D000020E56 /* VERSION in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -345,20 +366,25 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9417A80B1867DDE300D9D37B /* TPCircularBuffer.c in Sources */,
9417A8081867DDE300D9D37B /* EZOutput.m in Sources */,
9417A8061867DDE300D9D37B /* EZAudioPlotGLKViewController.m in Sources */,
6628E1181B39D8D000020E56 /* EZRecorder.m in Sources */,
94057050185E636100EB94BA /* OpenGLWaveformViewController.m in Sources */,
9417A8011867DDE300D9D37B /* AEFloatConverter.m in Sources */,
6628E10E1B39D8D000020E56 /* EZAudioFloatConverter.m in Sources */,
6628E10F1B39D8D000020E56 /* EZAudioFloatData.m in Sources */,
6628E10A1B39D8D000020E56 /* AEFloatConverter.m in Sources */,
6628E10D1B39D8D000020E56 /* EZAudioFile.m in Sources */,
6628E1161B39D8D000020E56 /* EZOutput.m in Sources */,
6628E1121B39D8D000020E56 /* EZAudioPlotGL.m in Sources */,
6628E1191B39D8D000020E56 /* TPCircularBuffer.c in Sources */,
6628E1111B39D8D000020E56 /* EZAudioPlot.m in Sources */,
94056FFC185E5EAF00EB94BA /* AppDelegate.m in Sources */,
9417A8041867DDE300D9D37B /* EZAudioPlot.m in Sources */,
9417A8031867DDE300D9D37B /* EZAudioFile.m in Sources */,
9417A8051867DDE300D9D37B /* EZAudioPlotGL.m in Sources */,
6628E1151B39D8D000020E56 /* EZMicrophone.m in Sources */,
6628E1101B39D8D000020E56 /* EZAudioPlayer.m in Sources */,
6628E10C1B39D8D000020E56 /* EZAudioDevice.m in Sources */,
94056FF8185E5EAF00EB94BA /* main.m in Sources */,
9417A8091867DDE300D9D37B /* EZPlot.m in Sources */,
9417A8071867DDE300D9D37B /* EZMicrophone.m in Sources */,
9417A80A1867DDE300D9D37B /* EZRecorder.m in Sources */,
9417A8021867DDE300D9D37B /* EZAudio.m in Sources */,
6628E1171B39D8D000020E56 /* EZPlot.m in Sources */,
6628E10B1B39D8D000020E56 /* EZAudio.m in Sources */,
6628E1141B39D8D000020E56 /* EZAudioUtilities.m in Sources */,
6628E1131B39D8D000020E56 /* EZAudioPlotGLKViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -389,22 +415,6 @@
name = InfoPlist.strings;
sourceTree = "<group>";
};
94056FFD185E5EAF00EB94BA /* Main_iPhone.storyboard */ = {
isa = PBXVariantGroup;
children = (
94056FFE185E5EAF00EB94BA /* Base */,
);
name = Main_iPhone.storyboard;
sourceTree = "<group>";
};
94057000185E5EAF00EB94BA /* Main_iPad.storyboard */ = {
isa = PBXVariantGroup;
children = (
94057001185E5EAF00EB94BA /* Base */,
);
name = Main_iPad.storyboard;
sourceTree = "<group>";
};
94057016185E5EAF00EB94BA /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
@@ -1,41 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>FAA3D686-83B5-4A65-896F-992EE01AAC5B</string>
<key>IDESourceControlProjectName</key>
<string>EZAudioOpenGLWaveformExample</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>F77EC8D9-F815-4829-9274-5DA08EA98D6B</key>
<string>https://github.com/syedhali/EZAudio.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>EZAudioExamples/iOS/EZAudioOpenGLWaveformExample/EZAudioOpenGLWaveformExample.xcodeproj/project.xcworkspace</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>F77EC8D9-F815-4829-9274-5DA08EA98D6B</key>
<string>../../../../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>https://github.com/syedhali/EZAudio.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>110</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>F77EC8D9-F815-4829-9274-5DA08EA98D6B</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>F77EC8D9-F815-4829-9274-5DA08EA98D6B</string>
<key>IDESourceControlWCCName</key>
<string>EZAudio</string>
</dict>
</array>
</dict>
</plist>
@@ -1,96 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "94056FE7185E5EAF00EB94BA"
BuildableName = "EZAudioOpenGLWaveformExample.app"
BlueprintName = "EZAudioOpenGLWaveformExample"
ReferencedContainer = "container:EZAudioOpenGLWaveformExample.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9405700B185E5EAF00EB94BA"
BuildableName = "EZAudioOpenGLWaveformExampleTests.xctest"
BlueprintName = "EZAudioOpenGLWaveformExampleTests"
ReferencedContainer = "container:EZAudioOpenGLWaveformExample.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "94056FE7185E5EAF00EB94BA"
BuildableName = "EZAudioOpenGLWaveformExample.app"
BlueprintName = "EZAudioOpenGLWaveformExample"
ReferencedContainer = "container:EZAudioOpenGLWaveformExample.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "94056FE7185E5EAF00EB94BA"
BuildableName = "EZAudioOpenGLWaveformExample.app"
BlueprintName = "EZAudioOpenGLWaveformExample"
ReferencedContainer = "container:EZAudioOpenGLWaveformExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "94056FE7185E5EAF00EB94BA"
BuildableName = "EZAudioOpenGLWaveformExample.app"
BlueprintName = "EZAudioOpenGLWaveformExample"
ReferencedContainer = "container:EZAudioOpenGLWaveformExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -1,27 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>EZAudioOpenGLWaveformExample.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>94056FE7185E5EAF00EB94BA</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>9405700B185E5EAF00EB94BA</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
@@ -1,83 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4514" systemVersion="13A603" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3747"/>
</dependencies>
<scenes>
<!--OpenGL Waveform View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="OpenGLWaveformViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="J6F-Mt-G9c"/>
<viewControllerLayoutGuide type="bottom" id="Fyj-aA-S5n"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="2k0-a8-gua" customClass="EZAudioPlotGL">
<rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="PPK-Fx-VmZ">
<rect key="frame" x="20" y="973" width="51" height="31"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<connections>
<action selector="toggleMicrophone:" destination="BYZ-38-t0r" eventType="valueChanged" id="zW0-o9-U9h"/>
</connections>
</switch>
<segmentedControl opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="0" translatesAutoresizingMaskIntoConstraints="NO" id="9Q2-Q9-pND">
<rect key="frame" x="635" y="975" width="113" height="29"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<segments>
<segment title="Buffer"/>
<segment title="Rolling"/>
</segments>
<connections>
<action selector="changePlotType:" destination="BYZ-38-t0r" eventType="valueChanged" id="T2z-a2-dOz"/>
</connections>
</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="Lhg-Cv-9eP">
<rect key="frame" x="20" y="944" width="728" 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>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="Lhg-Cv-9eP" secondAttribute="trailing" constant="20" id="26a-iS-hv5"/>
<constraint firstAttribute="bottom" secondItem="PPK-Fx-VmZ" secondAttribute="bottom" constant="20" id="2rf-dR-kty"/>
<constraint firstItem="PPK-Fx-VmZ" firstAttribute="top" secondItem="Lhg-Cv-9eP" secondAttribute="bottom" constant="8" id="6VF-Vg-93u"/>
<constraint firstItem="Lhg-Cv-9eP" firstAttribute="leading" secondItem="2k0-a8-gua" secondAttribute="leading" constant="20" id="6tG-rD-88B"/>
<constraint firstAttribute="bottom" secondItem="9Q2-Q9-pND" secondAttribute="bottom" constant="21" id="Qen-VZ-dRf"/>
<constraint firstItem="PPK-Fx-VmZ" firstAttribute="leading" secondItem="2k0-a8-gua" secondAttribute="leading" constant="20" id="j1j-Uy-YDg"/>
<constraint firstAttribute="trailing" secondItem="9Q2-Q9-pND" secondAttribute="trailing" constant="20" id="jQB-83-QJN"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="2k0-a8-gua" secondAttribute="bottom" id="H8j-R8-LQA"/>
<constraint firstItem="2k0-a8-gua" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" id="NTd-hb-HPh"/>
<constraint firstItem="2k0-a8-gua" firstAttribute="top" secondItem="8bC-Xf-vdC" secondAttribute="top" id="UwQ-lL-3yx"/>
<constraint firstAttribute="trailing" secondItem="2k0-a8-gua" secondAttribute="trailing" id="nPK-sh-21h"/>
</constraints>
</view>
<connections>
<outlet property="audioPlot" destination="2k0-a8-gua" id="3Jb-7T-kwh"/>
<outlet property="microphoneTextLabel" destination="Lhg-Cv-9eP" id="C0v-xz-54v"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar" statusBarStyle="blackOpaque"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination"/>
</simulatedMetricsContainer>
</document>
@@ -1,83 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4514" systemVersion="13A603" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="vXZ-lx-hvc">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3747"/>
</dependencies>
<scenes>
<!--OpenGL Waveform View Controller-->
<scene sceneID="ufC-wZ-h7g">
<objects>
<viewController id="vXZ-lx-hvc" customClass="OpenGLWaveformViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="4rH-3h-KEa"/>
<viewControllerLayoutGuide type="bottom" id="a4w-9J-qhE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="7Fr-JE-F7l" customClass="EZAudioPlotGL">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="fZE-l6-E8f">
<rect key="frame" x="20" y="517" width="51" height="31"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<connections>
<action selector="toggleMicrophone:" destination="vXZ-lx-hvc" eventType="valueChanged" id="Ujy-dW-IRf"/>
</connections>
</switch>
<segmentedControl opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="0" translatesAutoresizingMaskIntoConstraints="NO" id="WKs-bx-GsP">
<rect key="frame" x="187" y="519" width="113" height="29"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<segments>
<segment title="Buffer"/>
<segment title="Rolling"/>
</segments>
<connections>
<action selector="changePlotType:" destination="vXZ-lx-hvc" eventType="valueChanged" id="HDU-5u-S8m"/>
</connections>
</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="MAP-vX-MFE">
<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>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="fZE-l6-E8f" firstAttribute="leading" secondItem="7Fr-JE-F7l" secondAttribute="leading" constant="20" id="9HK-Uj-81E"/>
<constraint firstItem="fZE-l6-E8f" firstAttribute="top" secondItem="MAP-vX-MFE" secondAttribute="bottom" constant="8" id="Cbj-Gs-3br"/>
<constraint firstAttribute="bottom" secondItem="WKs-bx-GsP" secondAttribute="bottom" constant="21" id="F5y-zx-YLE"/>
<constraint firstAttribute="trailing" secondItem="WKs-bx-GsP" secondAttribute="trailing" constant="20" id="fsI-hv-tvr"/>
<constraint firstItem="MAP-vX-MFE" firstAttribute="leading" secondItem="7Fr-JE-F7l" secondAttribute="leading" constant="20" id="n4R-Go-oBp"/>
<constraint firstAttribute="trailing" secondItem="MAP-vX-MFE" secondAttribute="trailing" constant="20" id="s95-gj-Z9p"/>
<constraint firstAttribute="bottom" secondItem="fZE-l6-E8f" secondAttribute="bottom" constant="20" id="wbE-5i-q1B"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="7Fr-JE-F7l" firstAttribute="leading" secondItem="kh9-bI-dsS" secondAttribute="leading" id="4Re-N4-wev"/>
<constraint firstAttribute="bottom" secondItem="7Fr-JE-F7l" secondAttribute="bottom" id="6kO-ch-SyH"/>
<constraint firstItem="7Fr-JE-F7l" firstAttribute="top" secondItem="kh9-bI-dsS" secondAttribute="top" id="LJb-Se-k6h"/>
<constraint firstAttribute="trailing" secondItem="7Fr-JE-F7l" secondAttribute="trailing" id="icT-tB-X3G"/>
</constraints>
</view>
<connections>
<outlet property="audioPlot" destination="7Fr-JE-F7l" id="tgu-2e-9Xn"/>
<outlet property="microphoneTextLabel" destination="MAP-vX-MFE" id="fgA-DC-lL6"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
</document>
@@ -25,13 +25,15 @@
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIMainStoryboardFile</key>
<string>Main_iPhone</string>
<string>MainStoryboard</string>
<key>UIMainStoryboardFile~ipad</key>
<string>Main_iPad</string>
<string>MainStoryboard</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleLightContent</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
@@ -0,0 +1,102 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7702" systemVersion="14C109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="1v1-63-VYU">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7701"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
</dependencies>
<scenes>
<!--OpenGL Waveform View Controller-->
<scene sceneID="Dby-fz-vJ6">
<objects>
<viewController id="1v1-63-VYU" customClass="OpenGLWaveformViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="FeB-FW-m5f"/>
<viewControllerLayoutGuide type="bottom" id="2Vk-A0-ofK"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="XwN-5T-qg2">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="6UW-GB-04u" customClass="EZAudioPlotGL">
<rect key="frame" x="0.0" y="-54" width="600" height="654"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
<segmentedControl opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="0" translatesAutoresizingMaskIntoConstraints="NO" id="XVj-h5-jTC">
<rect key="frame" x="16" y="520" width="157" height="29"/>
<constraints>
<constraint firstAttribute="width" constant="157" id="RcI-eU-AzL"/>
</constraints>
<segments>
<segment title="Buffer"/>
<segment title="Rolling"/>
</segments>
<color key="tintColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<connections>
<action selector="changePlotType:" destination="1v1-63-VYU" eventType="valueChanged" id="waP-n9-8PZ"/>
</connections>
</segmentedControl>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="roundedRect" showsTouchWhenHighlighted="YES" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ctj-9N-cJA">
<rect key="frame" x="16" y="556" width="568" height="28"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="tintColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<state key="normal" title="Change Microphone Input">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="toggleMicrophonePickerView:" destination="1v1-63-VYU" eventType="touchUpInside" id="9Cc-I7-eam"/>
</connections>
</button>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="wWh-lf-1kw">
<rect key="frame" x="16" y="479" width="51" height="31"/>
<color key="onTintColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<connections>
<action selector="toggleMicrophone:" destination="1v1-63-VYU" eventType="touchUpInside" id="ffA-YR-9jD"/>
</connections>
</switch>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ycQ-JZ-KGC">
<rect key="frame" x="73" y="487" width="33" height="16"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" red="1" green="1" blue="1" alpha="0.90000000000000002" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<pickerView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="wcz-Wm-zAv">
<rect key="frame" x="0.0" y="-216" width="600" height="162"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
</pickerView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="XVj-h5-jTC" firstAttribute="top" secondItem="wWh-lf-1kw" secondAttribute="bottom" constant="10" id="Awg-0Q-ZDb"/>
<constraint firstItem="2Vk-A0-ofK" firstAttribute="top" secondItem="6UW-GB-04u" secondAttribute="bottom" id="Hr1-dv-Z4E"/>
<constraint firstItem="wWh-lf-1kw" firstAttribute="leading" secondItem="XwN-5T-qg2" secondAttribute="leading" constant="16" id="JYf-cq-hEJ"/>
<constraint firstItem="ctj-9N-cJA" firstAttribute="leading" secondItem="XwN-5T-qg2" secondAttribute="leading" constant="16" id="LEG-b0-ZXV"/>
<constraint firstItem="XVj-h5-jTC" firstAttribute="leading" secondItem="XwN-5T-qg2" secondAttribute="leading" constant="16" id="N1u-yG-Hdv"/>
<constraint firstItem="6UW-GB-04u" firstAttribute="leading" secondItem="XwN-5T-qg2" secondAttribute="leading" id="QuF-Yw-5g8"/>
<constraint firstAttribute="trailing" secondItem="ctj-9N-cJA" secondAttribute="trailing" constant="16" id="R8I-8R-8fR"/>
<constraint firstItem="wWh-lf-1kw" firstAttribute="leading" secondItem="XVj-h5-jTC" secondAttribute="leading" id="S7T-EA-RwB"/>
<constraint firstItem="ycQ-JZ-KGC" firstAttribute="leading" secondItem="wWh-lf-1kw" secondAttribute="trailing" constant="8" symbolic="YES" id="Xb8-5L-lKe"/>
<constraint firstItem="2Vk-A0-ofK" firstAttribute="top" secondItem="ctj-9N-cJA" secondAttribute="bottom" constant="16" id="ZMl-bh-DOY"/>
<constraint firstItem="ctj-9N-cJA" firstAttribute="top" secondItem="XVj-h5-jTC" secondAttribute="bottom" constant="8" id="aKS-tU-6gs"/>
<constraint firstAttribute="trailing" secondItem="6UW-GB-04u" secondAttribute="trailing" id="dGn-el-QRB"/>
<constraint firstAttribute="trailing" secondItem="wcz-Wm-zAv" secondAttribute="trailing" id="hXo-el-N6L"/>
<constraint firstItem="6UW-GB-04u" firstAttribute="top" secondItem="wcz-Wm-zAv" secondAttribute="bottom" id="jTa-E6-bge"/>
<constraint firstItem="wcz-Wm-zAv" firstAttribute="leading" secondItem="XwN-5T-qg2" secondAttribute="leading" id="ljn-by-pCm"/>
<constraint firstItem="wcz-Wm-zAv" firstAttribute="top" secondItem="XwN-5T-qg2" secondAttribute="topMargin" constant="-216" id="vmP-px-0rM"/>
<constraint firstItem="XVj-h5-jTC" firstAttribute="top" secondItem="ycQ-JZ-KGC" secondAttribute="bottom" constant="17" id="whI-Gr-IoC"/>
</constraints>
</view>
<connections>
<outlet property="audioPlot" destination="6UW-GB-04u" id="fFy-SO-WX1"/>
<outlet property="microphoneInputPickerView" destination="wcz-Wm-zAv" id="qHe-UF-SZ9"/>
<outlet property="microphoneInputPickerViewTopConstraint" destination="vmP-px-0rM" id="DU0-3z-sts"/>
<outlet property="microphoneInputToggleButton" destination="ctj-9N-cJA" id="XPV-nW-Wa9"/>
<outlet property="microphoneTextLabel" destination="ycQ-JZ-KGC" id="BG8-nQ-K1r"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="2Ua-6O-X9Y" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="574" y="89"/>
</scene>
</scenes>
</document>
@@ -11,28 +11,62 @@
// Import EZAudio header
#import "EZAudio.h"
@interface OpenGLWaveformViewController : UIViewController <EZMicrophoneDelegate>
@interface OpenGLWaveformViewController : UIViewController <EZMicrophoneDelegate,
UIPickerViewDataSource,
UIPickerViewDelegate>
//------------------------------------------------------------------------------
#pragma mark - Components
//------------------------------------------------------------------------------
/**
The OpenGL based audio plot
*/
@property (nonatomic,weak) IBOutlet EZAudioPlotGL *audioPlot;
@property (nonatomic, weak) IBOutlet EZAudioPlot *audioPlot;
/**
The microphone component
*/
@property (nonatomic,strong) EZMicrophone *microphone;
@property (nonatomic, strong) EZMicrophone *microphone;
/**
The button at the bottom displaying the currently selected microphone input
*/
@property (nonatomic, weak) IBOutlet UIButton *microphoneInputToggleButton;
/**
The microphone input picker view to display the different microphone input sources
*/
@property (nonatomic, weak) IBOutlet UIPickerView *microphoneInputPickerView;
/**
The microphone input picker view's top layout constraint (we use this to hide the control)
*/
@property (nonatomic, weak) IBOutlet NSLayoutConstraint *microphoneInputPickerViewTopConstraint;
/**
The text label displaying "Microphone On" or "Microphone Off"
*/
@property (nonatomic, weak) IBOutlet UILabel *microphoneTextLabel;
//------------------------------------------------------------------------------
#pragma mark - Actions
//------------------------------------------------------------------------------
/**
Switches the plot drawing type between a buffer plot (visualizes the current stream of audio data from the update function) or a rolling plot (visualizes the audio data over time, this is the classic waveform look)
*/
-(IBAction)changePlotType:(id)sender;
- (IBAction)changePlotType:(id)sender;
/**
Toggles the microphone on and off. When the microphone is on it will send its delegate (aka this view controller) the audio data in various ways (check out the EZMicrophoneDelegate documentation for more details);
*/
-(IBAction)toggleMicrophone:(id)sender;
- (IBAction)toggleMicrophonePickerView:(id)sender;
/**
Toggles the microphone on and off. When the microphone is on it will send its delegate (aka this view controller) the audio data in various ways (check out the EZMicrophoneDelegate documentation for more details);
*/
- (IBAction)toggleMicrophone:(id)sender;
@end
@@ -8,136 +8,291 @@
#import "OpenGLWaveformViewController.h"
@interface OpenGLWaveformViewController ()
#pragma mark - UI Extras
@property (nonatomic,weak) IBOutlet UILabel *microphoneTextLabel;
@interface OpenGLWaveformViewController()
@property (nonatomic, strong) NSArray *inputs;
@end
@implementation OpenGLWaveformViewController
@synthesize audioPlot;
@synthesize microphone;
#pragma mark - Initialization
-(id)init {
self = [super init];
if(self){
[self initializeViewController];
}
return self;
}
-(id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
if(self){
[self initializeViewController];
}
return self;
}
#pragma mark - Initialize View Controller Here
-(void)initializeViewController {
// Create an instance of the microphone and tell it to use this view controller instance as the delegate
self.microphone = [EZMicrophone microphoneWithDelegate:self];
//------------------------------------------------------------------------------
#pragma mark - View Style
//------------------------------------------------------------------------------
- (UIStatusBarStyle)preferredStatusBarStyle
{
return UIStatusBarStyleLightContent;
}
//------------------------------------------------------------------------------
#pragma mark - Customize the Audio Plot
//------------------------------------------------------------------------------
- (void)viewDidLoad
{
[super viewDidLoad];
/*
Customizing the audio plot's look
*/
// Background color
self.audioPlot.backgroundColor = [UIColor colorWithRed: 0.569 green: 0.82 blue: 0.478 alpha: 1];
// Waveform color
self.audioPlot.color = [UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:1.0];
// Plot type
self.audioPlot.plotType = EZPlotTypeBuffer;
/*
Start the microphone
*/
[self.microphone startFetchingAudio];
self.microphoneTextLabel.text = @"Microphone On";
}
[super viewDidLoad];
#pragma mark - Actions
-(void)changePlotType:(id)sender {
NSInteger selectedSegment = [sender selectedSegmentIndex];
switch(selectedSegment){
case 0:
[self drawBufferPlot];
break;
case 1:
[self drawRollingPlot];
break;
default:
break;
}
}
//
// Setup the AVAudioSession. EZMicrophone will not work properly on iOS
// if you don't do this!
//
AVAudioSession *session = [AVAudioSession sharedInstance];
NSError *error;
[session setCategory:AVAudioSessionCategoryPlayAndRecord error:&error];
if (error)
{
NSLog(@"Error setting up audio session category: %@", error.localizedDescription);
}
[session setActive:YES error:&error];
if (error)
{
NSLog(@"Error setting up audio session active: %@", error.localizedDescription);
}
-(void)toggleMicrophone:(id)sender {
if( ![(UISwitch*)sender isOn] ){
[self.microphone stopFetchingAudio];
self.microphoneTextLabel.text = @"Microphone Off";
}
else {
//
// Customizing the audio plot's look
//
// Background color
self.audioPlot.backgroundColor = [UIColor colorWithRed:0.569 green:0.82 blue:0.478 alpha:1.0];
// Waveform color
self.audioPlot.color = [UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:1.0];
// Plot type
self.audioPlot.plotType = EZPlotTypeBuffer;
//
// Create the microphone
//
self.microphone = [EZMicrophone microphoneWithDelegate:self];
//
// Set up the microphone input UIPickerView items to select
// between different microphone inputs. Here what we're doing behind the hood
// is enumerating the available inputs provided by the AVAudioSession.
//
self.inputs = [EZAudioDevice inputDevices];
self.microphoneInputPickerView.dataSource = self;
self.microphoneInputPickerView.delegate = self;
//
// Start the microphone
//
[self.microphone startFetchingAudio];
self.microphoneTextLabel.text = @"Microphone On";
}
}
#pragma mark - Action Extensions
//------------------------------------------------------------------------------
#pragma mark - UIPickerViewDataSource
//------------------------------------------------------------------------------
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView
{
return 1;
}
//------------------------------------------------------------------------------
- (NSString *)pickerView:(UIPickerView *)pickerView
titleForRow:(NSInteger)row
forComponent:(NSInteger)component
{
EZAudioDevice *device = self.inputs[row];
return device.name;
}
//------------------------------------------------------------------------------
- (NSAttributedString *)pickerView:(UIPickerView *)pickerView
attributedTitleForRow:(NSInteger)row
forComponent:(NSInteger)component
{
EZAudioDevice *device = self.inputs[row];
UIColor *textColor = [device isEqual:self.microphone.device] ? self.audioPlot.backgroundColor : [UIColor blackColor];
return [[NSAttributedString alloc] initWithString:device.name
attributes:@{ NSForegroundColorAttributeName : textColor }];
}
//------------------------------------------------------------------------------
- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component
{
return self.inputs.count;
}
//------------------------------------------------------------------------------
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
EZAudioDevice *device = self.inputs[row];
[self.microphone setDevice:device];
}
//------------------------------------------------------------------------------
#pragma mark - Actions
//------------------------------------------------------------------------------
- (void)changePlotType:(id)sender
{
NSInteger selectedSegment = [sender selectedSegmentIndex];
switch (selectedSegment)
{
case 0:
[self drawBufferPlot];
break;
case 1:
[self drawRollingPlot];
break;
default:
break;
}
}
//------------------------------------------------------------------------------
- (void)toggleMicrophone:(id)sender
{
BOOL isOn = [sender isOn];
if (!isOn)
{
[self.microphone stopFetchingAudio];
self.microphoneTextLabel.text = @"Microphone Off";
}
else
{
[self.microphone startFetchingAudio];
self.microphoneTextLabel.text = @"Microphone On";
}
}
//------------------------------------------------------------------------------
- (void)toggleMicrophonePickerView:(id)sender
{
BOOL isHidden = self.microphoneInputPickerViewTopConstraint.constant != 0.0;
[self setMicrophonePickerViewHidden:!isHidden];
}
//------------------------------------------------------------------------------
- (void)setMicrophonePickerViewHidden:(BOOL)hidden
{
CGFloat pickerHeight = CGRectGetHeight(self.microphoneInputPickerView.bounds);
__weak typeof(self) weakSelf = self;
[UIView animateWithDuration:0.55
delay:0.0
usingSpringWithDamping:0.6
initialSpringVelocity:0.5
options:(UIViewAnimationOptionBeginFromCurrentState|
UIViewAnimationOptionCurveEaseInOut|
UIViewAnimationOptionLayoutSubviews)
animations:^{
weakSelf.microphoneInputPickerViewTopConstraint.constant = hidden ? -pickerHeight : 0.0f;
[weakSelf.view layoutSubviews];
} completion:nil];
}
//------------------------------------------------------------------------------
#pragma mark - Utility
//------------------------------------------------------------------------------
/*
Give the visualization of the current buffer (this is almost exactly the openFrameworks audio input eample)
*/
-(void)drawBufferPlot {
// Change the plot type to the buffer plot
self.audioPlot.plotType = EZPlotTypeBuffer;
// Don't mirror over the x-axis
self.audioPlot.shouldMirror = NO;
// Don't fill
self.audioPlot.shouldFill = NO;
- (void)drawBufferPlot
{
self.audioPlot.plotType = EZPlotTypeBuffer;
self.audioPlot.shouldMirror = NO;
self.audioPlot.shouldFill = NO;
}
//------------------------------------------------------------------------------
/*
Give the classic mirrored, rolling waveform look
*/
-(void)drawRollingPlot {
self.audioPlot.plotType = EZPlotTypeRolling;
self.audioPlot.shouldFill = YES;
self.audioPlot.shouldMirror = YES;
-(void)drawRollingPlot
{
self.audioPlot.plotType = EZPlotTypeRolling;
self.audioPlot.shouldFill = YES;
self.audioPlot.shouldMirror = YES;
}
#pragma mark - EZMicrophoneDelegate
#warning Thread Safety
// Note that any callback that provides streamed audio data (like streaming microphone input) happens on a separate audio thread that should not be blocked. When we feed audio data into any of the UI components we need to explicity create a GCD block on the main thread to properly get the UI to work.
-(void)microphone:(EZMicrophone *)microphone
hasAudioReceived:(float **)buffer
withBufferSize:(UInt32)bufferSize
withNumberOfChannels:(UInt32)numberOfChannels {
// Getting audio data as an array of float buffer arrays. What does that mean? Because the audio is coming in as a stereo signal the data is split into a left and right channel. So buffer[0] corresponds to the float* data for the left channel while buffer[1] corresponds to the float* data for the right channel.
// See the Thread Safety warning above, but in a nutshell these callbacks happen on a separate audio thread. We wrap any UI updating in a GCD block on the main thread to avoid blocking that audio flow.
dispatch_async(dispatch_get_main_queue(),^{
// All the audio plot needs is the buffer data (float*) and the size. Internally the audio plot will handle all the drawing related code, history management, and freeing its own resources. Hence, one badass line of code gets you a pretty plot :)
[self.audioPlot updateBuffer:buffer[0] withBufferSize:bufferSize];
});
// Note that any callback that provides streamed audio data (like streaming
// microphone input) happens on a separate audio thread that should not be
// blocked. When we feed audio data into any of the UI components we need to
// explicity create a GCD block on the main thread to properly get the UI
// to work.
- (void)microphone:(EZMicrophone *)microphone
hasAudioReceived:(float **)buffer
withBufferSize:(UInt32)bufferSize
withNumberOfChannels:(UInt32)numberOfChannels
{
// Getting audio data as an array of float buffer arrays. What does that mean?
// Because the audio is coming in as a stereo signal the data is split into
// a left and right channel. So buffer[0] corresponds to the float* data
// for the left channel while buffer[1] corresponds to the float* data
// for the right channel.
// See the Thread Safety warning above, but in a nutshell these callbacks
// happen on a separate audio thread. We wrap any UI updating in a GCD block
// on the main thread to avoid blocking that audio flow.
__weak typeof (self) weakSelf = self;
dispatch_async(dispatch_get_main_queue(), ^{
// All the audio plot needs is the buffer data (float*) and the size.
// Internally the audio plot will handle all the drawing related code,
// history management, and freeing its own resources.
// Hence, one badass line of code gets you a pretty plot :)
[weakSelf.audioPlot updateBuffer:buffer[0] withBufferSize:bufferSize];
});
}
-(void)microphone:(EZMicrophone *)microphone hasAudioStreamBasicDescription:(AudioStreamBasicDescription)audioStreamBasicDescription {
// The AudioStreamBasicDescription of the microphone stream. This is useful when configuring the EZRecorder or telling another component what audio format type to expect.
// Here's a print function to allow you to inspect it a little easier
[EZAudio printASBD:audioStreamBasicDescription];
//------------------------------------------------------------------------------
- (void)microphone:(EZMicrophone *)microphone hasAudioStreamBasicDescription:(AudioStreamBasicDescription)audioStreamBasicDescription
{
// The AudioStreamBasicDescription of the microphone stream. This is useful
// when configuring the EZRecorder or telling another component what
// audio format type to expect.
[EZAudioUtilities printASBD:audioStreamBasicDescription];
}
-(void)microphone:(EZMicrophone *)microphone
hasBufferList:(AudioBufferList *)bufferList
withBufferSize:(UInt32)bufferSize
withNumberOfChannels:(UInt32)numberOfChannels {
// Getting audio data as a buffer list that can be directly fed into the EZRecorder or EZOutput. Say whattt...
//------------------------------------------------------------------------------
- (void)microphone:(EZMicrophone *)microphone
hasBufferList:(AudioBufferList *)bufferList
withBufferSize:(UInt32)bufferSize
withNumberOfChannels:(UInt32)numberOfChannels
{
// Getting audio data as a buffer list that can be directly fed into the
// EZRecorder or EZOutput. Say whattt...
}
//------------------------------------------------------------------------------
- (void)microphone:(EZMicrophone *)microphone changedDevice:(EZAudioDevice *)device
{
NSLog(@"Microphone changed device: %@", device.name);
// Called anytime the microphone's device changes
__weak typeof(self) weakSelf = self;
dispatch_async(dispatch_get_main_queue(), ^{
NSString *name = device.name;
NSString *tapText = @" (Tap To Change)";
NSString *microphoneInputToggleButtonText = [NSString stringWithFormat:@"%@%@", device.name, tapText];
NSRange rangeOfName = [microphoneInputToggleButtonText rangeOfString:name];
NSMutableAttributedString *microphoneInputToggleButtonAttributedText = [[NSMutableAttributedString alloc] initWithString:microphoneInputToggleButtonText];
[microphoneInputToggleButtonAttributedText addAttribute:NSFontAttributeName value:[UIFont boldSystemFontOfSize:13.0f] range:rangeOfName];
[weakSelf.microphoneInputToggleButton setAttributedTitle:microphoneInputToggleButtonAttributedText forState:UIControlStateNormal];
// reset the device list (a device may have been plugged in/out)
weakSelf.inputs = [EZAudioDevice inputDevices];
[weakSelf.microphoneInputPickerView reloadAllComponents];
[weakSelf setMicrophonePickerViewHidden:YES];
});
}
//------------------------------------------------------------------------------
@end
@@ -7,14 +7,31 @@
objects = {
/* Begin PBXBuildFile section */
6628E1761B39D96F00020E56 /* AEFloatConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E1541B39D96F00020E56 /* AEFloatConverter.m */; };
6628E1771B39D96F00020E56 /* EZAudio.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E1561B39D96F00020E56 /* EZAudio.m */; };
6628E1781B39D96F00020E56 /* EZAudioDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E1581B39D96F00020E56 /* EZAudioDevice.m */; };
6628E1791B39D96F00020E56 /* EZAudioFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E15A1B39D96F00020E56 /* EZAudioFile.m */; };
6628E17A1B39D96F00020E56 /* EZAudioFloatConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E15C1B39D96F00020E56 /* EZAudioFloatConverter.m */; };
6628E17B1B39D96F00020E56 /* EZAudioFloatData.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E15E1B39D96F00020E56 /* EZAudioFloatData.m */; };
6628E17C1B39D96F00020E56 /* EZAudioPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E1601B39D96F00020E56 /* EZAudioPlayer.m */; };
6628E17D1B39D96F00020E56 /* EZAudioPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E1621B39D96F00020E56 /* EZAudioPlot.m */; };
6628E17E1B39D96F00020E56 /* EZAudioPlotGL.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E1641B39D96F00020E56 /* EZAudioPlotGL.m */; };
6628E17F1B39D96F00020E56 /* EZAudioPlotGLKViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E1661B39D96F00020E56 /* EZAudioPlotGLKViewController.m */; };
6628E1801B39D96F00020E56 /* EZAudioUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E1681B39D96F00020E56 /* EZAudioUtilities.m */; };
6628E1811B39D96F00020E56 /* EZMicrophone.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E16A1B39D96F00020E56 /* EZMicrophone.m */; };
6628E1821B39D96F00020E56 /* EZOutput.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E16C1B39D96F00020E56 /* EZOutput.m */; };
6628E1831B39D96F00020E56 /* EZPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E16E1B39D96F00020E56 /* EZPlot.m */; };
6628E1841B39D96F00020E56 /* EZRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 6628E1701B39D96F00020E56 /* EZRecorder.m */; };
6628E1851B39D96F00020E56 /* TPCircularBuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 6628E1711B39D96F00020E56 /* TPCircularBuffer.c */; };
6628E1861B39D96F00020E56 /* CHANGELOG in Resources */ = {isa = PBXBuildFile; fileRef = 6628E1741B39D96F00020E56 /* CHANGELOG */; };
6628E1871B39D96F00020E56 /* VERSION in Resources */ = {isa = PBXBuildFile; fileRef = 6628E1751B39D96F00020E56 /* VERSION */; };
6628E2311B39F7C300020E56 /* MainStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6628E2301B39F7C300020E56 /* MainStoryboard.storyboard */; };
9417A60E1864D4DC00D9D37B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9417A60D1864D4DC00D9D37B /* Foundation.framework */; };
9417A6101864D4DC00D9D37B /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9417A60F1864D4DC00D9D37B /* CoreGraphics.framework */; };
9417A6121864D4DC00D9D37B /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9417A6111864D4DC00D9D37B /* UIKit.framework */; };
9417A6181864D4DC00D9D37B /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 9417A6161864D4DC00D9D37B /* InfoPlist.strings */; };
9417A61A1864D4DC00D9D37B /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A6191864D4DC00D9D37B /* main.m */; };
9417A61E1864D4DC00D9D37B /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A61D1864D4DC00D9D37B /* AppDelegate.m */; };
9417A6211864D4DC00D9D37B /* Main_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9417A61F1864D4DC00D9D37B /* Main_iPhone.storyboard */; };
9417A6241864D4DC00D9D37B /* Main_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9417A6221864D4DC00D9D37B /* Main_iPad.storyboard */; };
9417A6291864D4DC00D9D37B /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9417A6281864D4DC00D9D37B /* Images.xcassets */; };
9417A6301864D4DC00D9D37B /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9417A62F1864D4DC00D9D37B /* XCTest.framework */; };
9417A6311864D4DC00D9D37B /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9417A60D1864D4DC00D9D37B /* Foundation.framework */; };
@@ -25,19 +42,6 @@
9417A6BD18658F8800D9D37B /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9417A6BC18658F8800D9D37B /* AudioToolbox.framework */; };
9417A6BF18658F8D00D9D37B /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9417A6BE18658F8D00D9D37B /* GLKit.framework */; };
9417A6C518658FAA00D9D37B /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9417A6C418658FAA00D9D37B /* AVFoundation.framework */; };
9417A89D1867DE1E00D9D37B /* AEFloatConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A8851867DE1E00D9D37B /* AEFloatConverter.m */; };
9417A89E1867DE1E00D9D37B /* EZAudio.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A8871867DE1E00D9D37B /* EZAudio.m */; };
9417A89F1867DE1E00D9D37B /* EZAudioFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A8891867DE1E00D9D37B /* EZAudioFile.m */; };
9417A8A01867DE1E00D9D37B /* EZAudioPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A88B1867DE1E00D9D37B /* EZAudioPlot.m */; };
9417A8A11867DE1E00D9D37B /* EZAudioPlotGL.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A88D1867DE1E00D9D37B /* EZAudioPlotGL.m */; };
9417A8A21867DE1E00D9D37B /* EZAudioPlotGLKViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A88F1867DE1E00D9D37B /* EZAudioPlotGLKViewController.m */; };
9417A8A31867DE1E00D9D37B /* EZMicrophone.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A8911867DE1E00D9D37B /* EZMicrophone.m */; };
9417A8A41867DE1E00D9D37B /* EZOutput.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A8931867DE1E00D9D37B /* EZOutput.m */; };
9417A8A51867DE1E00D9D37B /* EZPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A8951867DE1E00D9D37B /* EZPlot.m */; };
9417A8A61867DE1E00D9D37B /* EZRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 9417A8971867DE1E00D9D37B /* EZRecorder.m */; };
9417A8A71867DE1E00D9D37B /* TPCircularBuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 9417A8981867DE1E00D9D37B /* TPCircularBuffer.c */; };
9417A8A81867DE1E00D9D37B /* CHANGELOG in Resources */ = {isa = PBXBuildFile; fileRef = 9417A89B1867DE1E00D9D37B /* CHANGELOG */; };
9417A8A91867DE1E00D9D37B /* VERSION in Resources */ = {isa = PBXBuildFile; fileRef = 9417A89C1867DE1E00D9D37B /* VERSION */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -51,6 +55,41 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
6628E1531B39D96F00020E56 /* AEFloatConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AEFloatConverter.h; sourceTree = "<group>"; };
6628E1541B39D96F00020E56 /* AEFloatConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AEFloatConverter.m; sourceTree = "<group>"; };
6628E1551B39D96F00020E56 /* EZAudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudio.h; sourceTree = "<group>"; };
6628E1561B39D96F00020E56 /* EZAudio.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudio.m; sourceTree = "<group>"; };
6628E1571B39D96F00020E56 /* EZAudioDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioDevice.h; sourceTree = "<group>"; };
6628E1581B39D96F00020E56 /* EZAudioDevice.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioDevice.m; sourceTree = "<group>"; };
6628E1591B39D96F00020E56 /* EZAudioFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFile.h; sourceTree = "<group>"; };
6628E15A1B39D96F00020E56 /* EZAudioFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFile.m; sourceTree = "<group>"; };
6628E15B1B39D96F00020E56 /* EZAudioFloatConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFloatConverter.h; sourceTree = "<group>"; };
6628E15C1B39D96F00020E56 /* EZAudioFloatConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFloatConverter.m; sourceTree = "<group>"; };
6628E15D1B39D96F00020E56 /* EZAudioFloatData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFloatData.h; sourceTree = "<group>"; };
6628E15E1B39D96F00020E56 /* EZAudioFloatData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFloatData.m; sourceTree = "<group>"; };
6628E15F1B39D96F00020E56 /* EZAudioPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlayer.h; sourceTree = "<group>"; };
6628E1601B39D96F00020E56 /* EZAudioPlayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlayer.m; sourceTree = "<group>"; };
6628E1611B39D96F00020E56 /* EZAudioPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlot.h; sourceTree = "<group>"; };
6628E1621B39D96F00020E56 /* EZAudioPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlot.m; sourceTree = "<group>"; };
6628E1631B39D96F00020E56 /* EZAudioPlotGL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGL.h; sourceTree = "<group>"; };
6628E1641B39D96F00020E56 /* EZAudioPlotGL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGL.m; sourceTree = "<group>"; };
6628E1651B39D96F00020E56 /* EZAudioPlotGLKViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGLKViewController.h; sourceTree = "<group>"; };
6628E1661B39D96F00020E56 /* EZAudioPlotGLKViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGLKViewController.m; sourceTree = "<group>"; };
6628E1671B39D96F00020E56 /* EZAudioUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioUtilities.h; sourceTree = "<group>"; };
6628E1681B39D96F00020E56 /* EZAudioUtilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioUtilities.m; sourceTree = "<group>"; };
6628E1691B39D96F00020E56 /* EZMicrophone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZMicrophone.h; sourceTree = "<group>"; };
6628E16A1B39D96F00020E56 /* EZMicrophone.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZMicrophone.m; sourceTree = "<group>"; };
6628E16B1B39D96F00020E56 /* EZOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZOutput.h; sourceTree = "<group>"; };
6628E16C1B39D96F00020E56 /* EZOutput.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZOutput.m; sourceTree = "<group>"; };
6628E16D1B39D96F00020E56 /* EZPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZPlot.h; sourceTree = "<group>"; };
6628E16E1B39D96F00020E56 /* EZPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZPlot.m; sourceTree = "<group>"; };
6628E16F1B39D96F00020E56 /* EZRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZRecorder.h; sourceTree = "<group>"; };
6628E1701B39D96F00020E56 /* EZRecorder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZRecorder.m; sourceTree = "<group>"; };
6628E1711B39D96F00020E56 /* TPCircularBuffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = TPCircularBuffer.c; sourceTree = "<group>"; };
6628E1721B39D96F00020E56 /* TPCircularBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TPCircularBuffer.h; sourceTree = "<group>"; };
6628E1741B39D96F00020E56 /* CHANGELOG */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CHANGELOG; sourceTree = "<group>"; };
6628E1751B39D96F00020E56 /* VERSION */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VERSION; sourceTree = "<group>"; };
6628E2301B39F7C300020E56 /* MainStoryboard.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = MainStoryboard.storyboard; sourceTree = "<group>"; };
9417A60A1864D4DC00D9D37B /* EZAudioPassThroughExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = EZAudioPassThroughExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
9417A60D1864D4DC00D9D37B /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
9417A60F1864D4DC00D9D37B /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
@@ -61,8 +100,6 @@
9417A61B1864D4DC00D9D37B /* EZAudioPassThroughExample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "EZAudioPassThroughExample-Prefix.pch"; sourceTree = "<group>"; };
9417A61C1864D4DC00D9D37B /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
9417A61D1864D4DC00D9D37B /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
9417A6201864D4DC00D9D37B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main_iPhone.storyboard; sourceTree = "<group>"; };
9417A6231864D4DC00D9D37B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main_iPad.storyboard; sourceTree = "<group>"; };
9417A6281864D4DC00D9D37B /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
9417A62E1864D4DC00D9D37B /* EZAudioPassThroughExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = EZAudioPassThroughExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
9417A62F1864D4DC00D9D37B /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
@@ -74,30 +111,6 @@
9417A6BC18658F8800D9D37B /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
9417A6BE18658F8D00D9D37B /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; };
9417A6C418658FAA00D9D37B /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
9417A8841867DE1E00D9D37B /* AEFloatConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AEFloatConverter.h; sourceTree = "<group>"; };
9417A8851867DE1E00D9D37B /* AEFloatConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AEFloatConverter.m; sourceTree = "<group>"; };
9417A8861867DE1E00D9D37B /* EZAudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudio.h; sourceTree = "<group>"; };
9417A8871867DE1E00D9D37B /* EZAudio.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudio.m; sourceTree = "<group>"; };
9417A8881867DE1E00D9D37B /* EZAudioFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFile.h; sourceTree = "<group>"; };
9417A8891867DE1E00D9D37B /* EZAudioFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFile.m; sourceTree = "<group>"; };
9417A88A1867DE1E00D9D37B /* EZAudioPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlot.h; sourceTree = "<group>"; };
9417A88B1867DE1E00D9D37B /* EZAudioPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlot.m; sourceTree = "<group>"; };
9417A88C1867DE1E00D9D37B /* EZAudioPlotGL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGL.h; sourceTree = "<group>"; };
9417A88D1867DE1E00D9D37B /* EZAudioPlotGL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGL.m; sourceTree = "<group>"; };
9417A88E1867DE1E00D9D37B /* EZAudioPlotGLKViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGLKViewController.h; sourceTree = "<group>"; };
9417A88F1867DE1E00D9D37B /* EZAudioPlotGLKViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGLKViewController.m; sourceTree = "<group>"; };
9417A8901867DE1E00D9D37B /* EZMicrophone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZMicrophone.h; sourceTree = "<group>"; };
9417A8911867DE1E00D9D37B /* EZMicrophone.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZMicrophone.m; sourceTree = "<group>"; };
9417A8921867DE1E00D9D37B /* EZOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZOutput.h; sourceTree = "<group>"; };
9417A8931867DE1E00D9D37B /* EZOutput.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZOutput.m; sourceTree = "<group>"; };
9417A8941867DE1E00D9D37B /* EZPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZPlot.h; sourceTree = "<group>"; };
9417A8951867DE1E00D9D37B /* EZPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZPlot.m; sourceTree = "<group>"; };
9417A8961867DE1E00D9D37B /* EZRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZRecorder.h; sourceTree = "<group>"; };
9417A8971867DE1E00D9D37B /* EZRecorder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZRecorder.m; sourceTree = "<group>"; };
9417A8981867DE1E00D9D37B /* TPCircularBuffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = TPCircularBuffer.c; sourceTree = "<group>"; };
9417A8991867DE1E00D9D37B /* TPCircularBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TPCircularBuffer.h; sourceTree = "<group>"; };
9417A89B1867DE1E00D9D37B /* CHANGELOG */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CHANGELOG; sourceTree = "<group>"; };
9417A89C1867DE1E00D9D37B /* VERSION */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = VERSION; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -127,6 +140,56 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
6628E1521B39D96F00020E56 /* EZAudio */ = {
isa = PBXGroup;
children = (
6628E1531B39D96F00020E56 /* AEFloatConverter.h */,
6628E1541B39D96F00020E56 /* AEFloatConverter.m */,
6628E1551B39D96F00020E56 /* EZAudio.h */,
6628E1561B39D96F00020E56 /* EZAudio.m */,
6628E1571B39D96F00020E56 /* EZAudioDevice.h */,
6628E1581B39D96F00020E56 /* EZAudioDevice.m */,
6628E1591B39D96F00020E56 /* EZAudioFile.h */,
6628E15A1B39D96F00020E56 /* EZAudioFile.m */,
6628E15B1B39D96F00020E56 /* EZAudioFloatConverter.h */,
6628E15C1B39D96F00020E56 /* EZAudioFloatConverter.m */,
6628E15D1B39D96F00020E56 /* EZAudioFloatData.h */,
6628E15E1B39D96F00020E56 /* EZAudioFloatData.m */,
6628E15F1B39D96F00020E56 /* EZAudioPlayer.h */,
6628E1601B39D96F00020E56 /* EZAudioPlayer.m */,
6628E1611B39D96F00020E56 /* EZAudioPlot.h */,
6628E1621B39D96F00020E56 /* EZAudioPlot.m */,
6628E1631B39D96F00020E56 /* EZAudioPlotGL.h */,
6628E1641B39D96F00020E56 /* EZAudioPlotGL.m */,
6628E1651B39D96F00020E56 /* EZAudioPlotGLKViewController.h */,
6628E1661B39D96F00020E56 /* EZAudioPlotGLKViewController.m */,
6628E1671B39D96F00020E56 /* EZAudioUtilities.h */,
6628E1681B39D96F00020E56 /* EZAudioUtilities.m */,
6628E1691B39D96F00020E56 /* EZMicrophone.h */,
6628E16A1B39D96F00020E56 /* EZMicrophone.m */,
6628E16B1B39D96F00020E56 /* EZOutput.h */,
6628E16C1B39D96F00020E56 /* EZOutput.m */,
6628E16D1B39D96F00020E56 /* EZPlot.h */,
6628E16E1B39D96F00020E56 /* EZPlot.m */,
6628E16F1B39D96F00020E56 /* EZRecorder.h */,
6628E1701B39D96F00020E56 /* EZRecorder.m */,
6628E1711B39D96F00020E56 /* TPCircularBuffer.c */,
6628E1721B39D96F00020E56 /* TPCircularBuffer.h */,
6628E1731B39D96F00020E56 /* VERSION */,
);
name = EZAudio;
path = ../../../../EZAudio;
sourceTree = "<group>";
};
6628E1731B39D96F00020E56 /* VERSION */ = {
isa = PBXGroup;
children = (
6628E1741B39D96F00020E56 /* CHANGELOG */,
6628E1751B39D96F00020E56 /* VERSION */,
);
path = VERSION;
sourceTree = "<group>";
};
9417A6011864D4DC00D9D37B = {
isa = PBXGroup;
children = (
@@ -163,11 +226,10 @@
9417A6131864D4DC00D9D37B /* EZAudioPassThroughExample */ = {
isa = PBXGroup;
children = (
9417A8831867DE1E00D9D37B /* EZAudio */,
6628E1521B39D96F00020E56 /* EZAudio */,
9417A61C1864D4DC00D9D37B /* AppDelegate.h */,
9417A61D1864D4DC00D9D37B /* AppDelegate.m */,
9417A61F1864D4DC00D9D37B /* Main_iPhone.storyboard */,
9417A6221864D4DC00D9D37B /* Main_iPad.storyboard */,
6628E2301B39F7C300020E56 /* MainStoryboard.storyboard */,
9417A64E1864D51C00D9D37B /* PassThroughViewController.h */,
9417A64F1864D51C00D9D37B /* PassThroughViewController.m */,
9417A6281864D4DC00D9D37B /* Images.xcassets */,
@@ -205,46 +267,6 @@
name = "Supporting Files";
sourceTree = "<group>";
};
9417A8831867DE1E00D9D37B /* EZAudio */ = {
isa = PBXGroup;
children = (
9417A8841867DE1E00D9D37B /* AEFloatConverter.h */,
9417A8851867DE1E00D9D37B /* AEFloatConverter.m */,
9417A8861867DE1E00D9D37B /* EZAudio.h */,
9417A8871867DE1E00D9D37B /* EZAudio.m */,
9417A8881867DE1E00D9D37B /* EZAudioFile.h */,
9417A8891867DE1E00D9D37B /* EZAudioFile.m */,
9417A88A1867DE1E00D9D37B /* EZAudioPlot.h */,
9417A88B1867DE1E00D9D37B /* EZAudioPlot.m */,
9417A88C1867DE1E00D9D37B /* EZAudioPlotGL.h */,
9417A88D1867DE1E00D9D37B /* EZAudioPlotGL.m */,
9417A88E1867DE1E00D9D37B /* EZAudioPlotGLKViewController.h */,
9417A88F1867DE1E00D9D37B /* EZAudioPlotGLKViewController.m */,
9417A8901867DE1E00D9D37B /* EZMicrophone.h */,
9417A8911867DE1E00D9D37B /* EZMicrophone.m */,
9417A8921867DE1E00D9D37B /* EZOutput.h */,
9417A8931867DE1E00D9D37B /* EZOutput.m */,
9417A8941867DE1E00D9D37B /* EZPlot.h */,
9417A8951867DE1E00D9D37B /* EZPlot.m */,
9417A8961867DE1E00D9D37B /* EZRecorder.h */,
9417A8971867DE1E00D9D37B /* EZRecorder.m */,
9417A8981867DE1E00D9D37B /* TPCircularBuffer.c */,
9417A8991867DE1E00D9D37B /* TPCircularBuffer.h */,
9417A89A1867DE1E00D9D37B /* VERSION */,
);
name = EZAudio;
path = ../../../../EZAudio;
sourceTree = "<group>";
};
9417A89A1867DE1E00D9D37B /* VERSION */ = {
isa = PBXGroup;
children = (
9417A89B1867DE1E00D9D37B /* CHANGELOG */,
9417A89C1867DE1E00D9D37B /* VERSION */,
);
path = VERSION;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -321,12 +343,11 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9417A6241864D4DC00D9D37B /* Main_iPad.storyboard in Resources */,
9417A6291864D4DC00D9D37B /* Images.xcassets in Resources */,
9417A6211864D4DC00D9D37B /* Main_iPhone.storyboard in Resources */,
9417A8A91867DE1E00D9D37B /* VERSION in Resources */,
6628E2311B39F7C300020E56 /* MainStoryboard.storyboard in Resources */,
6628E1871B39D96F00020E56 /* VERSION in Resources */,
9417A6181864D4DC00D9D37B /* InfoPlist.strings in Resources */,
9417A8A81867DE1E00D9D37B /* CHANGELOG in Resources */,
6628E1861B39D96F00020E56 /* CHANGELOG in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -345,20 +366,25 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9417A8A71867DE1E00D9D37B /* TPCircularBuffer.c in Sources */,
9417A8A41867DE1E00D9D37B /* EZOutput.m in Sources */,
9417A8A21867DE1E00D9D37B /* EZAudioPlotGLKViewController.m in Sources */,
6628E1841B39D96F00020E56 /* EZRecorder.m in Sources */,
9417A61E1864D4DC00D9D37B /* AppDelegate.m in Sources */,
9417A89D1867DE1E00D9D37B /* AEFloatConverter.m in Sources */,
6628E17A1B39D96F00020E56 /* EZAudioFloatConverter.m in Sources */,
6628E17B1B39D96F00020E56 /* EZAudioFloatData.m in Sources */,
6628E1761B39D96F00020E56 /* AEFloatConverter.m in Sources */,
6628E1791B39D96F00020E56 /* EZAudioFile.m in Sources */,
6628E1821B39D96F00020E56 /* EZOutput.m in Sources */,
6628E17E1B39D96F00020E56 /* EZAudioPlotGL.m in Sources */,
6628E1851B39D96F00020E56 /* TPCircularBuffer.c in Sources */,
6628E17D1B39D96F00020E56 /* EZAudioPlot.m in Sources */,
9417A61A1864D4DC00D9D37B /* main.m in Sources */,
9417A8A01867DE1E00D9D37B /* EZAudioPlot.m in Sources */,
9417A89F1867DE1E00D9D37B /* EZAudioFile.m in Sources */,
9417A8A11867DE1E00D9D37B /* EZAudioPlotGL.m in Sources */,
6628E1811B39D96F00020E56 /* EZMicrophone.m in Sources */,
6628E17C1B39D96F00020E56 /* EZAudioPlayer.m in Sources */,
6628E1781B39D96F00020E56 /* EZAudioDevice.m in Sources */,
9417A6501864D51C00D9D37B /* PassThroughViewController.m in Sources */,
9417A8A51867DE1E00D9D37B /* EZPlot.m in Sources */,
9417A8A31867DE1E00D9D37B /* EZMicrophone.m in Sources */,
9417A8A61867DE1E00D9D37B /* EZRecorder.m in Sources */,
9417A89E1867DE1E00D9D37B /* EZAudio.m in Sources */,
6628E1831B39D96F00020E56 /* EZPlot.m in Sources */,
6628E1771B39D96F00020E56 /* EZAudio.m in Sources */,
6628E1801B39D96F00020E56 /* EZAudioUtilities.m in Sources */,
6628E17F1B39D96F00020E56 /* EZAudioPlotGLKViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -389,22 +415,6 @@
name = InfoPlist.strings;
sourceTree = "<group>";
};
9417A61F1864D4DC00D9D37B /* Main_iPhone.storyboard */ = {
isa = PBXVariantGroup;
children = (
9417A6201864D4DC00D9D37B /* Base */,
);
name = Main_iPhone.storyboard;
sourceTree = "<group>";
};
9417A6221864D4DC00D9D37B /* Main_iPad.storyboard */ = {
isa = PBXVariantGroup;
children = (
9417A6231864D4DC00D9D37B /* Base */,
);
name = Main_iPad.storyboard;
sourceTree = "<group>";
};
9417A6381864D4DC00D9D37B /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
@@ -1,96 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9417A6091864D4DC00D9D37B"
BuildableName = "EZAudioPassThroughExample.app"
BlueprintName = "EZAudioPassThroughExample"
ReferencedContainer = "container:EZAudioPassThroughExample.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9417A62D1864D4DC00D9D37B"
BuildableName = "EZAudioPassThroughExampleTests.xctest"
BlueprintName = "EZAudioPassThroughExampleTests"
ReferencedContainer = "container:EZAudioPassThroughExample.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9417A6091864D4DC00D9D37B"
BuildableName = "EZAudioPassThroughExample.app"
BlueprintName = "EZAudioPassThroughExample"
ReferencedContainer = "container:EZAudioPassThroughExample.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9417A6091864D4DC00D9D37B"
BuildableName = "EZAudioPassThroughExample.app"
BlueprintName = "EZAudioPassThroughExample"
ReferencedContainer = "container:EZAudioPassThroughExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9417A6091864D4DC00D9D37B"
BuildableName = "EZAudioPassThroughExample.app"
BlueprintName = "EZAudioPassThroughExample"
ReferencedContainer = "container:EZAudioPassThroughExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -1,27 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>EZAudioPassThroughExample.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>5</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>9417A6091864D4DC00D9D37B</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>9417A62D1864D4DC00D9D37B</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
@@ -31,21 +31,8 @@
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
// Remember to configure your audio session
AVAudioSession *audioSession = [AVAudioSession sharedInstance];
NSError *err = NULL;
[audioSession setCategory:AVAudioSessionCategoryPlayAndRecord error:&err];
if( err ){
NSLog(@"There was an error creating the audio session");
}
[audioSession overrideOutputAudioPort:AVAudioSessionPortOverrideSpeaker error:NULL];
if( err ){
NSLog(@"There was an error sending the audio to the speakers");
}
return YES;
// Override point for customization after application launch.
return YES;
}
- (void)applicationWillResignActive:(UIApplication *)application
@@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4451" systemVersion="13A461" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3676"/>
</dependencies>
<scenes>
<!--class Prefix:identifier View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="20" width="768" height="1004"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar" statusBarStyle="blackOpaque"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination"/>
</simulatedMetricsContainer>
</document>
@@ -1,83 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4514" systemVersion="13A603" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="boc-4o-td3">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3747"/>
</dependencies>
<scenes>
<!--Pass Through View Controller-->
<scene sceneID="LEs-a1-pwJ">
<objects>
<viewController id="boc-4o-td3" customClass="PassThroughViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Ssm-5v-32v"/>
<viewControllerLayoutGuide type="bottom" id="sgd-RW-HU4"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="hn7-VO-Dg0">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="DlJ-yJ-pqm" customClass="EZAudioPlotGL">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="D9E-Be-Dwa">
<rect key="frame" x="20" y="517" width="51" height="31"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<connections>
<action selector="toggleMicrophone:" destination="boc-4o-td3" eventType="valueChanged" id="j1I-Ur-WGI"/>
</connections>
</switch>
<segmentedControl opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="0" translatesAutoresizingMaskIntoConstraints="NO" id="JXN-Zp-f3t">
<rect key="frame" x="187" y="519" width="113" height="29"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<segments>
<segment title="Buffer"/>
<segment title="Rolling"/>
</segments>
<connections>
<action selector="changePlotType:" destination="boc-4o-td3" eventType="valueChanged" id="Rlc-as-1OB"/>
</connections>
</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="rRX-dv-hkp">
<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>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="D9E-Be-Dwa" firstAttribute="top" secondItem="rRX-dv-hkp" secondAttribute="bottom" constant="8" id="1l1-Fc-qK7"/>
<constraint firstItem="D9E-Be-Dwa" firstAttribute="leading" secondItem="DlJ-yJ-pqm" secondAttribute="leading" constant="20" id="2td-l3-g6A"/>
<constraint firstItem="rRX-dv-hkp" firstAttribute="leading" secondItem="DlJ-yJ-pqm" secondAttribute="leading" constant="20" id="KGn-Qu-krD"/>
<constraint firstAttribute="bottom" secondItem="JXN-Zp-f3t" secondAttribute="bottom" constant="21" id="OtG-O0-Rof"/>
<constraint firstAttribute="trailing" secondItem="JXN-Zp-f3t" secondAttribute="trailing" constant="20" id="etZ-FR-SD7"/>
<constraint firstAttribute="bottom" secondItem="D9E-Be-Dwa" secondAttribute="bottom" constant="20" id="iIo-aP-BNd"/>
<constraint firstAttribute="trailing" secondItem="rRX-dv-hkp" secondAttribute="trailing" constant="20" id="z83-Xc-aCH"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="DlJ-yJ-pqm" secondAttribute="bottom" id="D93-bu-NaK"/>
<constraint firstAttribute="trailing" secondItem="DlJ-yJ-pqm" secondAttribute="trailing" id="ZJD-3w-Idf"/>
<constraint firstItem="DlJ-yJ-pqm" firstAttribute="leading" secondItem="hn7-VO-Dg0" secondAttribute="leading" id="bTA-h4-urB"/>
<constraint firstItem="DlJ-yJ-pqm" firstAttribute="top" secondItem="hn7-VO-Dg0" secondAttribute="top" id="xzM-zD-ON2"/>
</constraints>
</view>
<connections>
<outlet property="audioPlot" destination="DlJ-yJ-pqm" id="Axx-Gt-CHu"/>
<outlet property="microphoneTextLabel" destination="rRX-dv-hkp" id="Tgf-IC-fkT"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="V3q-ay-XFK" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
</document>

Some files were not shown because too many files have changed in this diff Show More