diff --git a/EZAudio/Core-Components/EZOutput.h b/EZAudio/Core-Components/EZOutput.h index a33eafc..c9dbb2e 100644 --- a/EZAudio/Core-Components/EZOutput.h +++ b/EZAudio/Core-Components/EZOutput.h @@ -36,13 +36,21 @@ */ @protocol EZOutputDataSource -@required +@optional ///----------------------------------------------------------- /// @name Pulling The Audio Data ///----------------------------------------------------------- +// Manual override, will not call `output:needsBufferListWithFrames:withBufferSize:` +-(void)output:(EZOutput*)output +callbackWithActionFlags:(AudioUnitRenderActionFlags*)ioActionFlags + inTimeStamp:(const AudioTimeStamp*)inTimeStamp + inBusNumber:(UInt32)inBusNumber +inNumberFrames:(UInt32)inNumberFrames + ioData:(AudioBufferList*)ioData; + /** - Called anytime the EZOutput needs audio data to play. This function expects you to allocate a chunk of memory for an AudioBufferList (see EZAudio function `audioBufferList`) and will try to free it on a seperate thread (see EZAudio function `freeBufferList:`) when it is done to prevent leaking since this is expected to be the end of the road for the audio signal. If the EZOutputDataSource receives a nil or NULL AudioBufferList then the EZOutput component will output silence. + Alternate way to provide output with data anytime the EZOutput needs audio data to play. This function expects you to allocate a chunk of memory for an AudioBufferList (see EZAudio function `audioBufferList`) and will try to free it on a seperate thread (see EZAudio function `freeBufferList:`) when it is done to prevent leaking since this is expected to be the end of the road for the audio signal. If the EZOutputDataSource receives a nil or NULL AudioBufferList then the EZOutput component will output silence. @param output The instance of the EZOutput that asked for the data. @param frames The amount of frames as a UInt32 that output will need to properly fill its output buffer. @param bufferSize The pointer to the bufferSize the dataSource is expected to set. For instance, if the bufferSize ended up being 512 you'd say *bufferSize = 512. diff --git a/EZAudio/Core-Components/EZOutput.m b/EZAudio/Core-Components/EZOutput.m index 5cf4b0f..41d4c46 100644 --- a/EZAudio/Core-Components/EZOutput.m +++ b/EZAudio/Core-Components/EZOutput.m @@ -43,39 +43,50 @@ static OSStatus OutputRenderCallback(void *inRefCon, UInt32 inNumberFrames, AudioBufferList *ioData){ EZOutput *output = (__bridge EZOutput*)inRefCon; - - UInt32 bufferSize; - AudioBufferList *bufferList = [output.outputDataSource output:output - needsBufferListWithFrames:inNumberFrames - withBufferSize:&bufferSize]; - - BOOL isInterleaved = ioData->mNumberBuffers == 1; - - if( !isInterleaved ){ - Float32 *left = (Float32*)ioData->mBuffers[0].mData; - Float32 *right = (Float32*)ioData->mBuffers[1].mData; - for(int i = 0; i < inNumberFrames; i++ ){ - if( bufferList ){ - Float32 *interleaved = (Float32*)bufferList->mBuffers[0].mData; - left[i] = interleaved[i]; - right[i] = interleaved[i]; - } - else { - left[i] = 0.0f; - right[i] = 0.0f; + // Manual override + if( [output.outputDataSource respondsToSelector:@selector(output:callbackWithActionFlags:inTimeStamp:inBusNumber:inNumberFrames:ioData:)] ){ + [output.outputDataSource output:output + callbackWithActionFlags:ioActionFlags + inTimeStamp:inTimeStamp + inBusNumber:inBusNumber + inNumberFrames:inNumberFrames + ioData:ioData]; + } + // Provided an AudioBufferList (defaults to silence) + else { + UInt32 bufferSize; + AudioBufferList *bufferList = [output.outputDataSource output:output + needsBufferListWithFrames:inNumberFrames + withBufferSize:&bufferSize]; + // Interleaved + if( !(ioData->mNumberBuffers == 1) ){ + Float32 *left = (Float32*)ioData->mBuffers[0].mData; + Float32 *right = (Float32*)ioData->mBuffers[1].mData; + for(int i = 0; i < inNumberFrames; i++ ){ + if( bufferList ){ + Float32 *interleaved = (Float32*)bufferList->mBuffers[0].mData; + left[i] = interleaved[i]; + right[i] = interleaved[i]; + } + else { + left[i] = 0.0f; + right[i] = 0.0f; + } } } - } - else { + // Non-interleaved + else { memcpy(ioData, bufferList, sizeof(AudioBufferList)+(bufferList->mNumberBuffers-1)*sizeof(AudioBuffer)); + } + if( bufferList ){ + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0ul),^{ + [EZAudio freeBufferList:bufferList]; + }); + } } - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0ul),^{ - [EZAudio freeBufferList:bufferList]; - }); - return noErr; } diff --git a/EZAudioExamples/OSX/EZAudioExamplesOSX.xcworkspace/contents.xcworkspacedata b/EZAudioExamples/OSX/EZAudioExamplesOSX.xcworkspace/contents.xcworkspacedata index 8f55bfa..1fef1f8 100644 --- a/EZAudioExamples/OSX/EZAudioExamplesOSX.xcworkspace/contents.xcworkspacedata +++ b/EZAudioExamples/OSX/EZAudioExamplesOSX.xcworkspace/contents.xcworkspacedata @@ -16,4 +16,7 @@ + + diff --git a/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExample.xcodeproj/project.pbxproj b/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExample.xcodeproj/project.pbxproj new file mode 100644 index 0000000..1bedb8f --- /dev/null +++ b/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExample.xcodeproj/project.pbxproj @@ -0,0 +1,618 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 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 */; }; + 941D71C81864C457007D52D8 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 941D71C61864C457007D52D8 /* Credits.rtf */; }; + 941D71CB1864C457007D52D8 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 941D71CA1864C457007D52D8 /* AppDelegate.m */; }; + 941D71CE1864C457007D52D8 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 941D71CC1864C457007D52D8 /* MainMenu.xib */; }; + 941D71D01864C457007D52D8 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 941D71CF1864C457007D52D8 /* Images.xcassets */; }; + 941D71D71864C457007D52D8 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 941D71D61864C457007D52D8 /* XCTest.framework */; }; + 941D71D81864C457007D52D8 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 941D71B71864C457007D52D8 /* Cocoa.framework */; }; + 941D71E01864C457007D52D8 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 941D71DE1864C457007D52D8 /* InfoPlist.strings */; }; + 941D71E21864C457007D52D8 /* EZAudioPassThroughExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 941D71E11864C457007D52D8 /* EZAudioPassThroughExampleTests.m */; }; + 941D72061864C47C007D52D8 /* AEFloatConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 941D71EE1864C47C007D52D8 /* AEFloatConverter.m */; }; + 941D72071864C47C007D52D8 /* TPCircularBuffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 941D71EF1864C47C007D52D8 /* TPCircularBuffer.c */; }; + 941D72081864C47C007D52D8 /* EZAudioFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 941D71F31864C47C007D52D8 /* EZAudioFile.m */; }; + 941D72091864C47C007D52D8 /* EZMicrophone.m in Sources */ = {isa = PBXBuildFile; fileRef = 941D71F51864C47C007D52D8 /* EZMicrophone.m */; }; + 941D720A1864C47C007D52D8 /* EZOutput.m in Sources */ = {isa = PBXBuildFile; fileRef = 941D71F71864C47C007D52D8 /* EZOutput.m */; }; + 941D720B1864C47C007D52D8 /* EZRecorder.m in Sources */ = {isa = PBXBuildFile; fileRef = 941D71F91864C47C007D52D8 /* EZRecorder.m */; }; + 941D720C1864C47C007D52D8 /* EZAudio.m in Sources */ = {isa = PBXBuildFile; fileRef = 941D71FB1864C47C007D52D8 /* EZAudio.m */; }; + 941D720D1864C47C007D52D8 /* EZAudioPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 941D71FE1864C47C007D52D8 /* EZAudioPlot.m */; }; + 941D720E1864C47C007D52D8 /* EZAudioPlotGL.m in Sources */ = {isa = PBXBuildFile; fileRef = 941D72001864C47C007D52D8 /* EZAudioPlotGL.m */; }; + 941D720F1864C47C007D52D8 /* EZAudioPlotGLKViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 941D72021864C47C007D52D8 /* EZAudioPlotGLKViewController.m */; }; + 941D72101864C47C007D52D8 /* EZPlot.m in Sources */ = {isa = PBXBuildFile; fileRef = 941D72041864C47C007D52D8 /* EZPlot.m */; }; + 941D72111864C47C007D52D8 /* simple-drum-beat.wav in Resources */ = {isa = PBXBuildFile; fileRef = 941D72051864C47C007D52D8 /* simple-drum-beat.wav */; }; + 941D72151864C4A0007D52D8 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 941D72121864C4A0007D52D8 /* AudioToolbox.framework */; }; + 941D72161864C4A0007D52D8 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 941D72131864C4A0007D52D8 /* AudioUnit.framework */; }; + 941D72171864C4A0007D52D8 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 941D72141864C4A0007D52D8 /* CoreAudio.framework */; }; + 941D721A1864C4AD007D52D8 /* GLKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 941D72181864C4AD007D52D8 /* GLKit.framework */; }; + 941D721B1864C4AD007D52D8 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 941D72191864C4AD007D52D8 /* OpenGL.framework */; }; + 941D721D1864C4C0007D52D8 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 941D721C1864C4C0007D52D8 /* QuartzCore.framework */; }; + 941D72211864C4D7007D52D8 /* PassThroughViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 941D721F1864C4D7007D52D8 /* PassThroughViewController.m */; }; + 941D72221864C4D7007D52D8 /* PassThroughViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 941D72201864C4D7007D52D8 /* PassThroughViewController.xib */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 941D71D91864C457007D52D8 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 941D71AC1864C456007D52D8 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 941D71B31864C457007D52D8; + remoteInfo = EZAudioPassThroughExample; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 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; }; + 941D71BB1864C457007D52D8 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; + 941D71BC1864C457007D52D8 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 941D71BF1864C457007D52D8 /* EZAudioPassThroughExample-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "EZAudioPassThroughExample-Info.plist"; sourceTree = ""; }; + 941D71C11864C457007D52D8 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 941D71C31864C457007D52D8 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 941D71C51864C457007D52D8 /* EZAudioPassThroughExample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "EZAudioPassThroughExample-Prefix.pch"; sourceTree = ""; }; + 941D71C71864C457007D52D8 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = ""; }; + 941D71C91864C457007D52D8 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 941D71CA1864C457007D52D8 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 941D71CD1864C457007D52D8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; + 941D71CF1864C457007D52D8 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + 941D71D51864C457007D52D8 /* EZAudioPassThroughExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = EZAudioPassThroughExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 941D71D61864C457007D52D8 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 941D71DD1864C457007D52D8 /* EZAudioPassThroughExampleTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "EZAudioPassThroughExampleTests-Info.plist"; sourceTree = ""; }; + 941D71DF1864C457007D52D8 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 941D71E11864C457007D52D8 /* EZAudioPassThroughExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = EZAudioPassThroughExampleTests.m; sourceTree = ""; }; + 941D71ED1864C47C007D52D8 /* AEFloatConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AEFloatConverter.h; sourceTree = ""; }; + 941D71EE1864C47C007D52D8 /* AEFloatConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AEFloatConverter.m; sourceTree = ""; }; + 941D71EF1864C47C007D52D8 /* TPCircularBuffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = TPCircularBuffer.c; sourceTree = ""; }; + 941D71F01864C47C007D52D8 /* TPCircularBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TPCircularBuffer.h; sourceTree = ""; }; + 941D71F21864C47C007D52D8 /* EZAudioFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioFile.h; sourceTree = ""; }; + 941D71F31864C47C007D52D8 /* EZAudioFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioFile.m; sourceTree = ""; }; + 941D71F41864C47C007D52D8 /* EZMicrophone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZMicrophone.h; sourceTree = ""; }; + 941D71F51864C47C007D52D8 /* EZMicrophone.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZMicrophone.m; sourceTree = ""; }; + 941D71F61864C47C007D52D8 /* EZOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZOutput.h; sourceTree = ""; }; + 941D71F71864C47C007D52D8 /* EZOutput.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZOutput.m; sourceTree = ""; }; + 941D71F81864C47C007D52D8 /* EZRecorder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZRecorder.h; sourceTree = ""; }; + 941D71F91864C47C007D52D8 /* EZRecorder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZRecorder.m; sourceTree = ""; }; + 941D71FA1864C47C007D52D8 /* EZAudio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudio.h; sourceTree = ""; }; + 941D71FB1864C47C007D52D8 /* EZAudio.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudio.m; sourceTree = ""; }; + 941D71FD1864C47C007D52D8 /* EZAudioPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlot.h; sourceTree = ""; }; + 941D71FE1864C47C007D52D8 /* EZAudioPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlot.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; + 941D71FF1864C47C007D52D8 /* EZAudioPlotGL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGL.h; sourceTree = ""; }; + 941D72001864C47C007D52D8 /* EZAudioPlotGL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGL.m; sourceTree = ""; }; + 941D72011864C47C007D52D8 /* EZAudioPlotGLKViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZAudioPlotGLKViewController.h; sourceTree = ""; }; + 941D72021864C47C007D52D8 /* EZAudioPlotGLKViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZAudioPlotGLKViewController.m; sourceTree = ""; }; + 941D72031864C47C007D52D8 /* EZPlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZPlot.h; sourceTree = ""; }; + 941D72041864C47C007D52D8 /* EZPlot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZPlot.m; sourceTree = ""; }; + 941D72051864C47C007D52D8 /* simple-drum-beat.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = "simple-drum-beat.wav"; sourceTree = ""; }; + 941D72121864C4A0007D52D8 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; + 941D72131864C4A0007D52D8 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = System/Library/Frameworks/AudioUnit.framework; sourceTree = SDKROOT; }; + 941D72141864C4A0007D52D8 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = System/Library/Frameworks/CoreAudio.framework; sourceTree = SDKROOT; }; + 941D72181864C4AD007D52D8 /* GLKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GLKit.framework; path = System/Library/Frameworks/GLKit.framework; sourceTree = SDKROOT; }; + 941D72191864C4AD007D52D8 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; }; + 941D721C1864C4C0007D52D8 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + 941D721E1864C4D7007D52D8 /* PassThroughViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PassThroughViewController.h; sourceTree = ""; }; + 941D721F1864C4D7007D52D8 /* PassThroughViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PassThroughViewController.m; sourceTree = ""; }; + 941D72201864C4D7007D52D8 /* PassThroughViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PassThroughViewController.xib; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 941D71B11864C457007D52D8 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 941D721D1864C4C0007D52D8 /* QuartzCore.framework in Frameworks */, + 941D721A1864C4AD007D52D8 /* GLKit.framework in Frameworks */, + 941D721B1864C4AD007D52D8 /* OpenGL.framework in Frameworks */, + 941D72151864C4A0007D52D8 /* AudioToolbox.framework in Frameworks */, + 941D72161864C4A0007D52D8 /* AudioUnit.framework in Frameworks */, + 941D72171864C4A0007D52D8 /* CoreAudio.framework in Frameworks */, + 941D71B81864C457007D52D8 /* Cocoa.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 941D71D21864C457007D52D8 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 941D71D81864C457007D52D8 /* Cocoa.framework in Frameworks */, + 941D71D71864C457007D52D8 /* XCTest.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 941D71AB1864C456007D52D8 = { + isa = PBXGroup; + children = ( + 941D71BD1864C457007D52D8 /* EZAudioPassThroughExample */, + 941D71DB1864C457007D52D8 /* EZAudioPassThroughExampleTests */, + 941D71B61864C457007D52D8 /* Frameworks */, + 941D71B51864C457007D52D8 /* Products */, + ); + sourceTree = ""; + }; + 941D71B51864C457007D52D8 /* Products */ = { + isa = PBXGroup; + children = ( + 941D71B41864C457007D52D8 /* EZAudioPassThroughExample.app */, + 941D71D51864C457007D52D8 /* EZAudioPassThroughExampleTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 941D71B61864C457007D52D8 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 941D721C1864C4C0007D52D8 /* QuartzCore.framework */, + 941D72181864C4AD007D52D8 /* GLKit.framework */, + 941D72191864C4AD007D52D8 /* OpenGL.framework */, + 941D72121864C4A0007D52D8 /* AudioToolbox.framework */, + 941D72131864C4A0007D52D8 /* AudioUnit.framework */, + 941D72141864C4A0007D52D8 /* CoreAudio.framework */, + 941D71B71864C457007D52D8 /* Cocoa.framework */, + 941D71D61864C457007D52D8 /* XCTest.framework */, + 941D71B91864C457007D52D8 /* Other Frameworks */, + ); + name = Frameworks; + sourceTree = ""; + }; + 941D71B91864C457007D52D8 /* Other Frameworks */ = { + isa = PBXGroup; + children = ( + 941D71BA1864C457007D52D8 /* AppKit.framework */, + 941D71BB1864C457007D52D8 /* CoreData.framework */, + 941D71BC1864C457007D52D8 /* Foundation.framework */, + ); + name = "Other Frameworks"; + sourceTree = ""; + }; + 941D71BD1864C457007D52D8 /* EZAudioPassThroughExample */ = { + isa = PBXGroup; + children = ( + 941D71EB1864C47C007D52D8 /* EZAudio */, + 941D71C91864C457007D52D8 /* AppDelegate.h */, + 941D71CA1864C457007D52D8 /* AppDelegate.m */, + 941D721E1864C4D7007D52D8 /* PassThroughViewController.h */, + 941D721F1864C4D7007D52D8 /* PassThroughViewController.m */, + 941D72201864C4D7007D52D8 /* PassThroughViewController.xib */, + 941D71CC1864C457007D52D8 /* MainMenu.xib */, + 941D71CF1864C457007D52D8 /* Images.xcassets */, + 941D71BE1864C457007D52D8 /* Supporting Files */, + ); + path = EZAudioPassThroughExample; + sourceTree = ""; + }; + 941D71BE1864C457007D52D8 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 941D71BF1864C457007D52D8 /* EZAudioPassThroughExample-Info.plist */, + 941D71C01864C457007D52D8 /* InfoPlist.strings */, + 941D71C31864C457007D52D8 /* main.m */, + 941D71C51864C457007D52D8 /* EZAudioPassThroughExample-Prefix.pch */, + 941D71C61864C457007D52D8 /* Credits.rtf */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 941D71DB1864C457007D52D8 /* EZAudioPassThroughExampleTests */ = { + isa = PBXGroup; + children = ( + 941D71E11864C457007D52D8 /* EZAudioPassThroughExampleTests.m */, + 941D71DC1864C457007D52D8 /* Supporting Files */, + ); + path = EZAudioPassThroughExampleTests; + sourceTree = ""; + }; + 941D71DC1864C457007D52D8 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 941D71DD1864C457007D52D8 /* EZAudioPassThroughExampleTests-Info.plist */, + 941D71DE1864C457007D52D8 /* InfoPlist.strings */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 941D71EB1864C47C007D52D8 /* EZAudio */ = { + isa = PBXGroup; + children = ( + 941D71EC1864C47C007D52D8 /* 3rd-Party-Components */, + 941D71F11864C47C007D52D8 /* Core-Components */, + 941D71FA1864C47C007D52D8 /* EZAudio.h */, + 941D71FB1864C47C007D52D8 /* EZAudio.m */, + 941D71FC1864C47C007D52D8 /* Interface-Components */, + 941D72051864C47C007D52D8 /* simple-drum-beat.wav */, + ); + name = EZAudio; + path = ../../../../EZAudio; + sourceTree = ""; + }; + 941D71EC1864C47C007D52D8 /* 3rd-Party-Components */ = { + isa = PBXGroup; + children = ( + 941D71ED1864C47C007D52D8 /* AEFloatConverter.h */, + 941D71EE1864C47C007D52D8 /* AEFloatConverter.m */, + 941D71EF1864C47C007D52D8 /* TPCircularBuffer.c */, + 941D71F01864C47C007D52D8 /* TPCircularBuffer.h */, + ); + path = "3rd-Party-Components"; + sourceTree = ""; + }; + 941D71F11864C47C007D52D8 /* Core-Components */ = { + isa = PBXGroup; + children = ( + 941D71F21864C47C007D52D8 /* EZAudioFile.h */, + 941D71F31864C47C007D52D8 /* EZAudioFile.m */, + 941D71F41864C47C007D52D8 /* EZMicrophone.h */, + 941D71F51864C47C007D52D8 /* EZMicrophone.m */, + 941D71F61864C47C007D52D8 /* EZOutput.h */, + 941D71F71864C47C007D52D8 /* EZOutput.m */, + 941D71F81864C47C007D52D8 /* EZRecorder.h */, + 941D71F91864C47C007D52D8 /* EZRecorder.m */, + ); + path = "Core-Components"; + sourceTree = ""; + }; + 941D71FC1864C47C007D52D8 /* Interface-Components */ = { + isa = PBXGroup; + children = ( + 941D71FD1864C47C007D52D8 /* EZAudioPlot.h */, + 941D71FE1864C47C007D52D8 /* EZAudioPlot.m */, + 941D71FF1864C47C007D52D8 /* EZAudioPlotGL.h */, + 941D72001864C47C007D52D8 /* EZAudioPlotGL.m */, + 941D72011864C47C007D52D8 /* EZAudioPlotGLKViewController.h */, + 941D72021864C47C007D52D8 /* EZAudioPlotGLKViewController.m */, + 941D72031864C47C007D52D8 /* EZPlot.h */, + 941D72041864C47C007D52D8 /* EZPlot.m */, + ); + path = "Interface-Components"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 941D71B31864C457007D52D8 /* EZAudioPassThroughExample */ = { + isa = PBXNativeTarget; + buildConfigurationList = 941D71E51864C457007D52D8 /* Build configuration list for PBXNativeTarget "EZAudioPassThroughExample" */; + buildPhases = ( + 941D71B01864C457007D52D8 /* Sources */, + 941D71B11864C457007D52D8 /* Frameworks */, + 941D71B21864C457007D52D8 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = EZAudioPassThroughExample; + productName = EZAudioPassThroughExample; + productReference = 941D71B41864C457007D52D8 /* EZAudioPassThroughExample.app */; + productType = "com.apple.product-type.application"; + }; + 941D71D41864C457007D52D8 /* EZAudioPassThroughExampleTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 941D71E81864C457007D52D8 /* Build configuration list for PBXNativeTarget "EZAudioPassThroughExampleTests" */; + buildPhases = ( + 941D71D11864C457007D52D8 /* Sources */, + 941D71D21864C457007D52D8 /* Frameworks */, + 941D71D31864C457007D52D8 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 941D71DA1864C457007D52D8 /* PBXTargetDependency */, + ); + name = EZAudioPassThroughExampleTests; + productName = EZAudioPassThroughExampleTests; + productReference = 941D71D51864C457007D52D8 /* EZAudioPassThroughExampleTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 941D71AC1864C456007D52D8 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0500; + ORGANIZATIONNAME = "Syed Haris Ali"; + TargetAttributes = { + 941D71D41864C457007D52D8 = { + TestTargetID = 941D71B31864C457007D52D8; + }; + }; + }; + buildConfigurationList = 941D71AF1864C456007D52D8 /* Build configuration list for PBXProject "EZAudioPassThroughExample" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 941D71AB1864C456007D52D8; + productRefGroup = 941D71B51864C457007D52D8 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 941D71B31864C457007D52D8 /* EZAudioPassThroughExample */, + 941D71D41864C457007D52D8 /* EZAudioPassThroughExampleTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 941D71B21864C457007D52D8 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 941D72111864C47C007D52D8 /* simple-drum-beat.wav in Resources */, + 941D72221864C4D7007D52D8 /* PassThroughViewController.xib in Resources */, + 941D71C21864C457007D52D8 /* InfoPlist.strings in Resources */, + 941D71D01864C457007D52D8 /* Images.xcassets in Resources */, + 941D71C81864C457007D52D8 /* Credits.rtf in Resources */, + 941D71CE1864C457007D52D8 /* MainMenu.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 941D71D31864C457007D52D8 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 941D71E01864C457007D52D8 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 941D71B01864C457007D52D8 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 941D720E1864C47C007D52D8 /* EZAudioPlotGL.m in Sources */, + 941D72211864C4D7007D52D8 /* PassThroughViewController.m in Sources */, + 941D72061864C47C007D52D8 /* AEFloatConverter.m in Sources */, + 941D71CB1864C457007D52D8 /* AppDelegate.m in Sources */, + 941D720A1864C47C007D52D8 /* EZOutput.m in Sources */, + 941D720C1864C47C007D52D8 /* EZAudio.m in Sources */, + 941D72091864C47C007D52D8 /* EZMicrophone.m in Sources */, + 941D720F1864C47C007D52D8 /* EZAudioPlotGLKViewController.m in Sources */, + 941D720B1864C47C007D52D8 /* EZRecorder.m in Sources */, + 941D72081864C47C007D52D8 /* EZAudioFile.m in Sources */, + 941D72071864C47C007D52D8 /* TPCircularBuffer.c in Sources */, + 941D720D1864C47C007D52D8 /* EZAudioPlot.m in Sources */, + 941D71C41864C457007D52D8 /* main.m in Sources */, + 941D72101864C47C007D52D8 /* EZPlot.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 941D71D11864C457007D52D8 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 941D71E21864C457007D52D8 /* EZAudioPassThroughExampleTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 941D71DA1864C457007D52D8 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 941D71B31864C457007D52D8 /* EZAudioPassThroughExample */; + targetProxy = 941D71D91864C457007D52D8 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 941D71C01864C457007D52D8 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 941D71C11864C457007D52D8 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 941D71C61864C457007D52D8 /* Credits.rtf */ = { + isa = PBXVariantGroup; + children = ( + 941D71C71864C457007D52D8 /* en */, + ); + name = Credits.rtf; + sourceTree = ""; + }; + 941D71CC1864C457007D52D8 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 941D71CD1864C457007D52D8 /* Base */, + ); + name = MainMenu.xib; + sourceTree = ""; + }; + 941D71DE1864C457007D52D8 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 941D71DF1864C457007D52D8 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 941D71E31864C457007D52D8 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.9; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + 941D71E41864C457007D52D8 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.9; + SDKROOT = macosx; + }; + name = Release; + }; + 941D71E61864C457007D52D8 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + COMBINE_HIDPI_IMAGES = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "EZAudioPassThroughExample/EZAudioPassThroughExample-Prefix.pch"; + INFOPLIST_FILE = "EZAudioPassThroughExample/EZAudioPassThroughExample-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 941D71E71864C457007D52D8 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + COMBINE_HIDPI_IMAGES = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "EZAudioPassThroughExample/EZAudioPassThroughExample-Prefix.pch"; + INFOPLIST_FILE = "EZAudioPassThroughExample/EZAudioPassThroughExample-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 941D71E91864C457007D52D8 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/EZAudioPassThroughExample.app/Contents/MacOS/EZAudioPassThroughExample"; + COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(DEVELOPER_FRAMEWORKS_DIR)", + "$(inherited)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "EZAudioPassThroughExample/EZAudioPassThroughExample-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "EZAudioPassThroughExampleTests/EZAudioPassThroughExampleTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 941D71EA1864C457007D52D8 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/EZAudioPassThroughExample.app/Contents/MacOS/EZAudioPassThroughExample"; + COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(DEVELOPER_FRAMEWORKS_DIR)", + "$(inherited)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "EZAudioPassThroughExample/EZAudioPassThroughExample-Prefix.pch"; + INFOPLIST_FILE = "EZAudioPassThroughExampleTests/EZAudioPassThroughExampleTests-Info.plist"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUNDLE_LOADER)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 941D71AF1864C456007D52D8 /* Build configuration list for PBXProject "EZAudioPassThroughExample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 941D71E31864C457007D52D8 /* Debug */, + 941D71E41864C457007D52D8 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 941D71E51864C457007D52D8 /* Build configuration list for PBXNativeTarget "EZAudioPassThroughExample" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 941D71E61864C457007D52D8 /* Debug */, + 941D71E71864C457007D52D8 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 941D71E81864C457007D52D8 /* Build configuration list for PBXNativeTarget "EZAudioPassThroughExampleTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 941D71E91864C457007D52D8 /* Debug */, + 941D71EA1864C457007D52D8 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 941D71AC1864C456007D52D8 /* Project object */; +} diff --git a/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExample/AppDelegate.h b/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExample/AppDelegate.h new file mode 100644 index 0000000..a0896b0 --- /dev/null +++ b/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExample/AppDelegate.h @@ -0,0 +1,22 @@ +// +// AppDelegate.h +// EZAudioPassThroughExample +// +// Created by Syed Haris Ali on 12/20/13. +// Copyright (c) 2013 Syed Haris Ali. All rights reserved. +// + +#import + +#import "PassThroughViewController.h" + +@interface AppDelegate : NSObject + +@property (assign) IBOutlet NSWindow *window; + +/** + The PassThroughViewController + */ +@property (nonatomic,strong) PassThroughViewController *passThroughViewController; + +@end diff --git a/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExample/AppDelegate.m b/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExample/AppDelegate.m new file mode 100644 index 0000000..e3d862a --- /dev/null +++ b/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExample/AppDelegate.m @@ -0,0 +1,28 @@ +// +// AppDelegate.m +// EZAudioPassThroughExample +// +// Created by Syed Haris Ali on 12/20/13. +// Copyright (c) 2013 Syed Haris Ali. All rights reserved. +// + +#import "AppDelegate.h" + +@implementation AppDelegate +@synthesize passThroughViewController; + +- (void)applicationDidFinishLaunching:(NSNotification *)aNotification +{ + + // Swap in our view controller in the window's content view + self.passThroughViewController = [[PassThroughViewController alloc] init]; + // Resize view controller to content view's current size + self.passThroughViewController.view.frame = [self.window.contentView frame]; + // Add resizing flags to make the view controller resize with the window + self.passThroughViewController.view.autoresizingMask = (NSViewWidthSizable|NSViewHeightSizable); + // Add in the core graphics view controller as subview + [self.window.contentView addSubview:self.passThroughViewController.view]; + +} + +@end diff --git a/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExample/Base.lproj/MainMenu.xib b/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExample/Base.lproj/MainMenu.xib new file mode 100644 index 0000000..a348c30 --- /dev/null +++ b/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExample/Base.lproj/MainMenu.xib @@ -0,0 +1,467 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Default + + + + Left to Right + + + + Right to Left + + + + + + + + Default + + + + Left to Right + + + + Right to Left + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExample/EZAudioPassThroughExample-Info.plist b/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExample/EZAudioPassThroughExample-Info.plist new file mode 100644 index 0000000..c5c3139 --- /dev/null +++ b/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExample/EZAudioPassThroughExample-Info.plist @@ -0,0 +1,34 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + com.sha.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSMinimumSystemVersion + ${MACOSX_DEPLOYMENT_TARGET} + NSHumanReadableCopyright + Copyright © 2013 Syed Haris Ali. All rights reserved. + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExample/EZAudioPassThroughExample-Prefix.pch b/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExample/EZAudioPassThroughExample-Prefix.pch new file mode 100644 index 0000000..4187f19 --- /dev/null +++ b/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExample/EZAudioPassThroughExample-Prefix.pch @@ -0,0 +1,9 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#ifdef __OBJC__ + #import +#endif diff --git a/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExample/Images.xcassets/AppIcon.appiconset/Contents.json b/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExample/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..2db2b1c --- /dev/null +++ b/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExample/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,58 @@ +{ + "images" : [ + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExample/PassThroughViewController.h b/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExample/PassThroughViewController.h new file mode 100644 index 0000000..9a9ec54 --- /dev/null +++ b/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExample/PassThroughViewController.h @@ -0,0 +1,35 @@ +// +// PassThroughViewController.h +// EZAudioPassThroughExample +// +// Created by Syed Haris Ali on 12/20/13. +// Copyright (c) 2013 Syed Haris Ali. All rights reserved. +// + +#import + +/** + Import EZAudio + */ +#import "EZAudio.h" + +@interface PassThroughViewController : NSViewController + +#pragma mark - Components +/** + The OpenGL based audio plot + */ +@property (nonatomic,weak) IBOutlet EZAudioPlotGL *audioPlot; + +#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 diff --git a/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExample/PassThroughViewController.m b/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExample/PassThroughViewController.m new file mode 100644 index 0000000..2bc8b5d --- /dev/null +++ b/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExample/PassThroughViewController.m @@ -0,0 +1,179 @@ +// +// PassThroughViewController.m +// EZAudioPassThroughExample +// +// Created by Syed Haris Ali on 12/20/13. +// Copyright (c) 2013 Syed Haris Ali. All rights reserved. +// + +#import "PassThroughViewController.h" + +@interface PassThroughViewController (){ + TPCircularBuffer _circularBuffer; +} +@end + +@implementation PassThroughViewController + +#pragma mark - Initialization +-(id)init { + self = [super initWithNibName:NSStringFromClass(self.class) bundle:nil]; + if(self){ + } + return self; +} + +-(id)initWithCoder:(NSCoder *)aDecoder { + self = [super initWithNibName:NSStringFromClass(self.class) bundle:nil]; + if(self){ + } + return self; +} + +-(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { + self = [super initWithNibName:NSStringFromClass(self.class) bundle:nil]; + if(self){ + } + return 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; + + /** + Initialize the circular buffer + */ + TPCircularBufferInit(&_circularBuffer,1024); + + /* + Start the microphone + */ + [EZMicrophone sharedMicrophone].microphoneDelegate = self; + [[EZMicrophone sharedMicrophone] startFetchingAudio]; + + /** + Start the output + */ + [EZOutput sharedOutput].outputDataSource = self; + [[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)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 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 + hasBufferList:(AudioBufferList *)bufferList + withBufferSize:(UInt32)bufferSize +withNumberOfChannels:(UInt32)numberOfChannels { + /** + Append the audio data to a circular buffer + */ + TPCircularBufferProduceBytes(&_circularBuffer, + bufferList->mBuffers[0].mData, + bufferList->mBuffers[0].mDataByteSize); +} + +#pragma mark - EZOutputDelegate +-(void)output:(EZOutput *)output +callbackWithActionFlags:(AudioUnitRenderActionFlags *)ioActionFlags + inTimeStamp:(const AudioTimeStamp *)inTimeStamp + inBusNumber:(UInt32)inBusNumber +inNumberFrames:(UInt32)inNumberFrames + ioData:(AudioBufferList *)ioData { + + /** + Below is how you could pass the data to the output using the circular buffer. + Thank you Michael Tyson (A Tasty Pixel) for writing the TPCircularBuffer, you are amazing! + */ + + // Get the desired amount of bytes to copy + int32_t bytesToCopy = ioData->mBuffers[0].mDataByteSize; + AudioSampleType *targetBuffer = (AudioSampleType*)ioData->mBuffers[0].mData; + + // Get the available bytes in the circular buffer + int32_t availableBytes; + AudioSampleType *buffer = TPCircularBufferTail(&_circularBuffer,&availableBytes); + + // 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(targetBuffer,buffer,amount); + + // Consume those bytes ( this will internally push the head of the circular buffer ) + TPCircularBufferConsume(&_circularBuffer,amount); + +} + +#pragma mark - Cleanup +-(void)dealloc { + TPCircularBufferClear(&_circularBuffer); +} + +@end diff --git a/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExample/PassThroughViewController.xib b/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExample/PassThroughViewController.xib new file mode 100644 index 0000000..e613eb8 --- /dev/null +++ b/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExample/PassThroughViewController.xib @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExample/en.lproj/Credits.rtf b/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExample/en.lproj/Credits.rtf new file mode 100644 index 0000000..46576ef --- /dev/null +++ b/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExample/en.lproj/Credits.rtf @@ -0,0 +1,29 @@ +{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} +{\colortbl;\red255\green255\blue255;} +\paperw9840\paperh8400 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural + +\f0\b\fs24 \cf0 Engineering: +\b0 \ + Some people\ +\ + +\b Human Interface Design: +\b0 \ + Some other people\ +\ + +\b Testing: +\b0 \ + Hopefully not nobody\ +\ + +\b Documentation: +\b0 \ + Whoever\ +\ + +\b With special thanks to: +\b0 \ + Mom\ +} diff --git a/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExample/en.lproj/InfoPlist.strings b/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExample/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExample/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExample/main.m b/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExample/main.m new file mode 100644 index 0000000..1dd2466 --- /dev/null +++ b/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExample/main.m @@ -0,0 +1,14 @@ +// +// main.m +// EZAudioPassThroughExample +// +// Created by Syed Haris Ali on 12/20/13. +// Copyright (c) 2013 Syed Haris Ali. All rights reserved. +// + +#import + +int main(int argc, const char * argv[]) +{ + return NSApplicationMain(argc, argv); +} diff --git a/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExampleTests/EZAudioPassThroughExampleTests-Info.plist b/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExampleTests/EZAudioPassThroughExampleTests-Info.plist new file mode 100644 index 0000000..7077e10 --- /dev/null +++ b/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExampleTests/EZAudioPassThroughExampleTests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + com.sha.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExampleTests/EZAudioPassThroughExampleTests.m b/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExampleTests/EZAudioPassThroughExampleTests.m new file mode 100644 index 0000000..1fcb94a --- /dev/null +++ b/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExampleTests/EZAudioPassThroughExampleTests.m @@ -0,0 +1,34 @@ +// +// EZAudioPassThroughExampleTests.m +// EZAudioPassThroughExampleTests +// +// Created by Syed Haris Ali on 12/20/13. +// Copyright (c) 2013 Syed Haris Ali. All rights reserved. +// + +#import + +@interface EZAudioPassThroughExampleTests : XCTestCase + +@end + +@implementation EZAudioPassThroughExampleTests + +- (void)setUp +{ + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown +{ + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample +{ + XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); +} + +@end diff --git a/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExampleTests/en.lproj/InfoPlist.strings b/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExampleTests/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..477b28f --- /dev/null +++ b/EZAudioExamples/OSX/EZAudioPassThroughExample/EZAudioPassThroughExampleTests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/EZAudioExamples/iOS/EZAudioPlayFileExample/EZAudioPlayFileExample/PlayFileViewController.m b/EZAudioExamples/iOS/EZAudioPlayFileExample/EZAudioPlayFileExample/PlayFileViewController.m index 850842e..782e8fb 100644 --- a/EZAudioExamples/iOS/EZAudioPlayFileExample/EZAudioPlayFileExample/PlayFileViewController.m +++ b/EZAudioExamples/iOS/EZAudioPlayFileExample/EZAudioPlayFileExample/PlayFileViewController.m @@ -138,7 +138,6 @@ self.filePathLabel.text = filePathURL.lastPathComponent; self.framePositionSlider.maximumValue = (float)self.audioFile.totalFrames; - // Plot the whole waveform // Plot the whole waveform self.audioPlot.plotType = EZPlotTypeBuffer; self.audioPlot.shouldFill = YES;