├── .gitignore ├── .idea ├── .name ├── FBAudio.iml ├── encodings.xml ├── find.xml ├── misc.xml ├── modules.xml ├── scopes │ └── scope_settings.xml ├── vcs.xml ├── workspace.xml └── xcode.xml ├── FBAudio.xcworkspace ├── contents.xcworkspacedata └── xcuserdata │ ├── mc.xcuserdatad │ ├── UserInterfaceState.xcuserstate │ ├── WorkspaceSettings.xcsettings │ └── xcdebugger │ │ └── Breakpoints.xcbkptlist │ └── mhagedorn.xcuserdatad │ ├── UserInterfaceState.xcuserstate │ └── xcdebugger │ └── Breakpoints.xcbkptlist ├── FBAudioLib ├── FBAVAssetPlayer.h ├── FBAVAssetPlayer.m ├── FBAudioLib.h ├── FBAudioQueuePlayer.h ├── FBAudioQueuePlayer.m ├── FBDebugSupport.h ├── FBSoundTouchAVAssetPlayer.h ├── FBSoundTouchAVAssetPlayer.mm └── SoundTouch.framework │ ├── Headers │ ├── BPMDetect.h │ ├── FIFOSampleBuffer.h │ ├── FIFOSamplePipe.h │ ├── STTypes.h │ ├── SoundTouch.h │ └── soundtouch_config.h │ ├── Info.plist │ ├── SoundTouch │ └── en.lproj │ └── InfoPlist.strings ├── FBAudioLibTester ├── Default-568h@2x.png ├── FBAudioLibTester.xcodeproj │ ├── project.pbxproj │ └── xcuserdata │ │ ├── mc.xcuserdatad │ │ └── xcschemes │ │ │ ├── FBAudioLibTester.xcscheme │ │ │ └── xcschememanagement.plist │ │ └── mhagedorn.xcuserdatad │ │ └── xcschemes │ │ ├── FBAudioLibTester.xcscheme │ │ └── xcschememanagement.plist ├── FBAudioLibTester │ ├── FBAudioLibTester-Info.plist │ ├── FBAudioLibTester-Prefix.pch │ ├── FBAudioLibTesterAppDelegate.h │ ├── FBAudioLibTesterAppDelegate.m │ ├── FBAudioLibTesterViewController.h │ ├── FBAudioLibTesterViewController.m │ ├── en.lproj │ │ ├── FBAudioLibTesterViewController.xib │ │ ├── InfoPlist.strings │ │ └── MainWindow.xib │ └── main.m └── FBAudioLibTesterTests │ ├── FBAudioLibTesterTests-Info.plist │ ├── FBAudioLibTesterTests.h │ ├── FBAudioLibTesterTests.m │ └── en.lproj │ └── InfoPlist.strings └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | build 3 | *.pbxuser 4 | *.perspectivev3 5 | *.mode1v3 6 | .DS_Store 7 | -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | FBAudio -------------------------------------------------------------------------------- /.idea/FBAudio.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/find.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $APPLICATION_HOME_DIR$/lib/idea.jar!/resources/html5-schema/html5.rnc 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 25 | 26 | 27 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 99 | 100 | 105 | 106 | 107 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | CSS 121 | 122 | 123 | Code style issuesJavaScript 124 | 125 | 126 | Control flow issuesJavaScript 127 | 128 | 129 | JavaScript 130 | 131 | 132 | JavaScript function metricsJavaScript 133 | 134 | 135 | JavaScript validity issuesJavaScript 136 | 137 | 138 | Potentially confusing code constructsJavaScript 139 | 140 | 141 | 142 | 143 | Classes 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 182 | 183 | 186 | 187 | 188 | 189 | 192 | 193 | 196 | 197 | 200 | 201 | 202 | 203 | 206 | 207 | 210 | 211 | 214 | 215 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 268 | 269 | 270 | 1352472377015 271 | 1352472377015 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 300 | 301 | 312 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | -------------------------------------------------------------------------------- /.idea/xcode.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /FBAudio.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /FBAudio.xcworkspace/xcuserdata/mc.xcuserdatad/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEWorkspaceUserSettings_BuildLocationStyle 6 | 1 7 | IDEWorkspaceUserSettings_BuildSubfolderNameStyle 8 | 0 9 | IDEWorkspaceUserSettings_DerivedDataLocationStyle 10 | 0 11 | IDEWorkspaceUserSettings_HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges 12 | 13 | IDEWorkspaceUserSettings_IssueFilterStyle 14 | 0 15 | IDEWorkspaceUserSettings_LiveSourceIssuesEnabled 16 | 17 | IDEWorkspaceUserSettings_SnapshotAutomaticallyBeforeSignificantChanges 18 | 19 | IDEWorkspaceUserSettings_SnapshotLocationStyle 20 | 0 21 | 22 | 23 | -------------------------------------------------------------------------------- /FBAudio.xcworkspace/xcuserdata/mc.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /FBAudio.xcworkspace/xcuserdata/mhagedorn.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mwhagedorn/FBAudio/a7e937fe6db1d59151132499c9ef10d52d88506f/FBAudio.xcworkspace/xcuserdata/mhagedorn.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /FBAudio.xcworkspace/xcuserdata/mhagedorn.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /FBAudioLib/FBAVAssetPlayer.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 Mike Coleman 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // 15 | // Note: You are NOT required to make the license available from within your 16 | // iOS application. Including it in your project is sufficient. 17 | // 18 | // Attribution is not required, but appreciated :) 19 | // 20 | 21 | #import 22 | #import 23 | #import 24 | #import "FBAudioQueuePlayer.h" 25 | @class FBAVAssetPlayer; 26 | 27 | typedef void (^FBAudioFilteringCallback)( FBAVAssetPlayer *player, char *srcBuffer, UInt32 srcBytesAvailable, char *dstBuffer, UInt32 dstBufferCapacity, UInt32 *dstBytesWritten ); 28 | 29 | @protocol FBAVAssetPlayerDelegate 30 | @optional 31 | -(void) audioAssetPlayerDidStartPlayback:(FBAVAssetPlayer*)player; 32 | -(void) audioAssetPlayerDidStopPlayback:(FBAVAssetPlayer*)player; 33 | @end 34 | 35 | @interface FBAVAssetPlayer : NSObject 36 | { 37 | FBAudioFilteringCallback filteringCallback; 38 | } 39 | @property(nonatomic, copy) FBAudioFilteringCallback filteringCallback; 40 | @property(nonatomic, retain) FBAudioQueuePlayer *audioPlayer; 41 | @property(nonatomic, assign) id delegate; 42 | 43 | -(void)playFromAssetURL:(NSURL*)assetURL; 44 | -(void)stop; 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /FBAudioLib/FBAVAssetPlayer.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 Mike Coleman 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // 15 | // Note: You are NOT required to make the license available from within your 16 | // iOS application. Including it in your project is sufficient. 17 | // 18 | // Attribution is not required, but appreciated :) 19 | // 20 | 21 | #import "FBAVAssetPlayer.h" 22 | #import "FBAudioQueuePlayer.h" 23 | //#define FB_DEBUG 24 | #import "FBDebugSupport.h" 25 | 26 | @interface FBAVAssetPlayer() 27 | { 28 | AVAssetReader *assetReader; 29 | AVAssetReaderOutput *assetReaderOutput; 30 | char *tempBuffer; 31 | } 32 | 33 | @end 34 | 35 | @implementation FBAVAssetPlayer 36 | @synthesize audioPlayer; 37 | @synthesize filteringCallback; 38 | @synthesize delegate; 39 | 40 | - (id)init 41 | { 42 | self = [super init]; 43 | if (self) 44 | { 45 | NSError *err = nil; 46 | tempBuffer = calloc( 32768, 1 ); 47 | filteringCallback = nil; 48 | [[AVAudioSession sharedInstance] setDelegate:self]; 49 | if ( NO == [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil] ) 50 | { 51 | NSLog( @"error setting audio session category: %@", [err localizedDescription]); 52 | } 53 | if ( NO == [[AVAudioSession sharedInstance] setPreferredHardwareSampleRate: 44100.0f error: &err] ) 54 | { 55 | NSLog( @"error setting hardware sampling rate: %@", [err localizedDescription]); 56 | } 57 | UInt32 one = 1; 58 | OSStatus status = AudioSessionSetProperty( kAudioSessionProperty_OverrideCategoryMixWithOthers, 59 | sizeof(UInt32), &one ); 60 | if ( status != kAudioSessionNoError ) 61 | { 62 | NSLog( @"error setting mix override: %04lx", status ); 63 | } 64 | if ( NO == [[AVAudioSession sharedInstance] setActive: YES error: &err] ) 65 | { 66 | NSLog( @"error activating audio session: %@", [err localizedDescription]); 67 | } 68 | if ( NO == [[AVAudioSession sharedInstance] setPreferredIOBufferDuration: 1024.0/44100.0 error: &err] ) 69 | { 70 | NSLog( @"error setting audio buffer duration: %@", [err localizedDescription]); 71 | } 72 | } 73 | return self; 74 | } 75 | 76 | - (void)dealloc 77 | { 78 | delegate = nil; 79 | [assetReader release], assetReader = nil; 80 | [assetReaderOutput release], assetReaderOutput = nil; 81 | free( tempBuffer ), tempBuffer = NULL; 82 | [super dealloc]; 83 | } 84 | 85 | -(void)playFromAssetURL:(NSURL *)assetURL 86 | { 87 | LOGFUNC_ENTRY; 88 | AVURLAsset *songAsset = [AVURLAsset URLAssetWithURL:assetURL options:nil]; 89 | 90 | NSError *assetError = nil; 91 | assetReader = [[AVAssetReader assetReaderWithAsset:songAsset error:&assetError] retain]; 92 | if (assetError) 93 | { 94 | NSLog (@"error: %@", assetError); 95 | return; 96 | } 97 | assetReaderOutput = [[AVAssetReaderAudioMixOutput assetReaderAudioMixOutputWithAudioTracks:songAsset.tracks audioSettings: nil] retain]; 98 | if (! [assetReader canAddOutput: assetReaderOutput]) 99 | { 100 | NSLog (@"error adding asset reader output"); 101 | return; 102 | } 103 | [assetReader addOutput: assetReaderOutput]; 104 | [assetReader startReading]; 105 | 106 | self.audioPlayer = [[[FBAudioQueuePlayer alloc] init] autorelease]; 107 | audioPlayer.delegate = self; 108 | audioPlayer.addSampleCallback = ^(FBAudioQueuePlayer *player, AudioQueueBufferRef inBuffer) 109 | { 110 | OSStatus err; 111 | AVAssetReaderStatus status = [assetReader status]; 112 | DLog(@"addSampleCallback: status is %d", status ); 113 | AVAssetReaderOutput *readerOutput = [[assetReader outputs] objectAtIndex:0]; 114 | if (readerOutput) 115 | { 116 | CMSampleBufferRef nextBuffer = NULL; 117 | if ( status == AVAssetReaderStatusReading ) 118 | { 119 | nextBuffer = [readerOutput copyNextSampleBuffer]; 120 | DLog( @"nextBuffer = 0x%x", (unsigned) nextBuffer ); 121 | if ( nextBuffer == NULL ) 122 | { 123 | return; 124 | } 125 | } 126 | if ( nextBuffer != NULL ) 127 | { 128 | size_t totalSampleSize = CMSampleBufferGetTotalSampleSize(nextBuffer); 129 | UInt32 bufferCapacity = inBuffer->mAudioDataBytesCapacity; 130 | DLog( @"totalSampleSize = %lu, bufferCapacity = %lu", totalSampleSize, bufferCapacity ); 131 | inBuffer->mAudioDataByteSize = totalSampleSize; 132 | if ( totalSampleSize > bufferCapacity ) 133 | { 134 | inBuffer->mAudioDataByteSize = bufferCapacity; 135 | } 136 | CMBlockBufferRef buffer = CMSampleBufferGetDataBuffer( nextBuffer ); 137 | if ( filteringCallback == nil ) 138 | { 139 | err = CMBlockBufferCopyDataBytes( buffer, 0, inBuffer->mAudioDataByteSize, inBuffer->mAudioData ); 140 | if ( err != noErr ) 141 | { 142 | NSLog( @"got error %ld from CMBlockBufferCopyDataBytes", err ); 143 | } 144 | } 145 | else 146 | { 147 | char *srcBytes; 148 | status = CMBlockBufferAccessDataBytes( buffer, 0, inBuffer->mAudioDataByteSize, tempBuffer, &srcBytes ); 149 | filteringCallback( self, srcBytes, inBuffer->mAudioDataByteSize, inBuffer->mAudioData, inBuffer->mAudioDataBytesCapacity, &inBuffer->mAudioDataByteSize ); 150 | } 151 | CFRelease( nextBuffer ); 152 | } 153 | else 154 | { 155 | if ( status != AVAssetReaderStatusReading ) 156 | { 157 | NSLog( @"done. (%d)\n", status ); 158 | [player stop]; 159 | } 160 | } 161 | } 162 | else 163 | { 164 | NSLog( @"no readerOutput"); 165 | } 166 | }; 167 | [audioPlayer start]; 168 | 169 | } 170 | 171 | 172 | -(void)stop 173 | { 174 | LOGFUNC_ENTRY; 175 | [audioPlayer stop]; 176 | } 177 | 178 | #pragma mark FBAudioQueuePlayerDelegate 179 | 180 | -(void) audioQueuePlayerDidStartPlayback:(FBAudioQueuePlayer*)player 181 | { 182 | LOGFUNC_ENTRY; 183 | if ( delegate && [delegate respondsToSelector:@selector(audioAssetPlayerDidStartPlayback:)] ) 184 | { 185 | [delegate audioAssetPlayerDidStartPlayback:self]; 186 | } 187 | } 188 | 189 | -(void) audioQueuePlayerDidStopPlayback:(FBAudioQueuePlayer*)player 190 | { 191 | LOGFUNC_ENTRY; 192 | if ( delegate && [delegate respondsToSelector:@selector(audioAssetPlayerDidStopPlayback:)] ) 193 | { 194 | [delegate audioAssetPlayerDidStopPlayback:self]; 195 | } 196 | } 197 | 198 | @end 199 | -------------------------------------------------------------------------------- /FBAudioLib/FBAudioLib.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 Mike Coleman 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // 15 | // Note: You are NOT required to make the license available from within your 16 | // iOS application. Including it in your project is sufficient. 17 | // 18 | // Attribution is not required, but appreciated :) 19 | // 20 | 21 | #ifndef FBAudioLibTester_FBAudioLib_h 22 | #define FBAudioLibTester_FBAudioLib_h 23 | 24 | #import "FBAudioQueuePlayer.h" 25 | #import "FBAVAssetPlayer.h" 26 | #import "FBSoundTouchAVAssetPlayer.h" 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /FBAudioLib/FBAudioQueuePlayer.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 Mike Coleman 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // 15 | // Note: You are NOT required to make the license available from within your 16 | // iOS application. Including it in your project is sufficient. 17 | // 18 | // Attribution is not required, but appreciated :) 19 | // 20 | 21 | #import 22 | #import 23 | #import 24 | #import 25 | 26 | @class FBAudioQueuePlayer; 27 | 28 | typedef void (^AddSampleCallback)( FBAudioQueuePlayer *player, AudioQueueBufferRef inBuffer ); 29 | 30 | @protocol FBAudioQueuePlayerDelegate 31 | @optional 32 | -(void) audioQueuePlayerDidStartPlayback:(FBAudioQueuePlayer*)player; 33 | -(void) audioQueuePlayerDidStopPlayback:(FBAudioQueuePlayer*)player; 34 | @end 35 | 36 | @interface FBAudioQueuePlayer : NSObject 37 | 38 | @property(readwrite, copy) AddSampleCallback addSampleCallback; 39 | @property(nonatomic, assign) id delegate; 40 | 41 | -(void) start; 42 | -(void) stop; 43 | -(BOOL) running; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /FBAudioLib/FBAudioQueuePlayer.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 Mike Coleman 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // 15 | // Note: You are NOT required to make the license available from within your 16 | // iOS application. Including it in your project is sufficient. 17 | // 18 | // Attribution is not required, but appreciated :) 19 | // 20 | 21 | #import "FBAudioQueuePlayer.h" 22 | //#define FB_DEBUG 23 | #import "FBDebugSupport.h" 24 | 25 | #define NUM_AUDIO_BUFFERS 3 26 | 27 | @interface FBAudioQueuePlayer() 28 | { 29 | AudioStreamBasicDescription audioDesc; 30 | AudioQueueRef audioQueue; 31 | AudioQueueBufferRef audioBuffers[ NUM_AUDIO_BUFFERS ]; 32 | BOOL m_running; 33 | } 34 | 35 | -(void)setupAudioFormat; 36 | -(void)cleanupAudioQueue; 37 | -(void)makeAudioQueue; 38 | -(void)makeBuffers; 39 | -(void)handleQueuePropertyChange:(AudioQueueRef) inAQ propertyID: (AudioQueuePropertyID) inID; 40 | 41 | @end 42 | 43 | @implementation FBAudioQueuePlayer 44 | 45 | @synthesize addSampleCallback; 46 | @synthesize delegate; 47 | 48 | -(BOOL) running 49 | { 50 | return m_running; 51 | } 52 | 53 | static void MyAudioQueuePropertyListenerProc( void *inUserData, AudioQueueRef inAQ, AudioQueuePropertyID inID ) 54 | { 55 | FBAudioQueuePlayer *player = (FBAudioQueuePlayer*)inUserData; 56 | [player handleQueuePropertyChange:inAQ propertyID:inID]; 57 | } 58 | 59 | static void HandleOutputBuffer( void *inData, AudioQueueRef inAQ, AudioQueueBufferRef inBuffer ) 60 | { 61 | LOGFUNC_ENTRY; 62 | OSStatus err = noErr; 63 | FBAudioQueuePlayer *player = (FBAudioQueuePlayer*) inData; 64 | if ( player == nil ) 65 | { 66 | NSLog( @"nil player!" ); 67 | return; 68 | } 69 | DLog(@"%s: running = %d, addSampleCallback %@", __func__, player->m_running, player.addSampleCallback ? @"present" : @"missing" ); 70 | if ( player->m_running && player.addSampleCallback ) 71 | { 72 | inBuffer->mAudioDataByteSize = 0; 73 | (player.addSampleCallback)( player, inBuffer ); 74 | if ( inBuffer->mAudioDataByteSize ) 75 | { 76 | DLog( @"enqueue" ); 77 | err = AudioQueueEnqueueBuffer( player->audioQueue, inBuffer, 0, 0 ); 78 | } 79 | } 80 | else 81 | { 82 | DLog(@"%s: stopping audio queue", __func__ ); 83 | err = AudioQueueStop( player->audioQueue, NO ); 84 | } 85 | } 86 | 87 | - (id)init 88 | { 89 | self = [super init]; 90 | if (self) 91 | { 92 | m_running = NO; 93 | } 94 | return self; 95 | } 96 | 97 | - (void)dealloc 98 | { 99 | delegate = nil; 100 | [super dealloc]; 101 | } 102 | 103 | 104 | -(void)setupAudioFormat 105 | { 106 | LOGFUNC_ENTRY; 107 | audioDesc.mSampleRate = 44100.00; 108 | audioDesc.mFormatID = kAudioFormatLinearPCM; 109 | audioDesc.mFormatFlags = kAudioFormatFlagsCanonical; 110 | audioDesc.mChannelsPerFrame = 2; 111 | 112 | audioDesc.mFramesPerPacket = 1; 113 | audioDesc.mBitsPerChannel = 16; 114 | audioDesc.mBytesPerPacket = 4; 115 | audioDesc.mBytesPerFrame = 4; 116 | //ok canonicial implies interleaved, 2 channels, 16 bits per channel == 32 bits == 4 bytesPerFrame/Packet 117 | //TODO why isnt this ABSD populated from the file selected? 118 | //TODO using AudioFileGetProperty, kAudioFilePropertyDataFormat? 119 | 120 | } 121 | 122 | -(void)cleanupAudioQueue 123 | { 124 | LOGFUNC_ENTRY; 125 | if ( audioQueue != NULL ) 126 | { 127 | AudioQueueDispose( audioQueue, true ); 128 | } 129 | audioQueue = NULL; 130 | } 131 | 132 | -(void)makeAudioQueue 133 | { 134 | LOGFUNC_ENTRY; 135 | OSStatus err; 136 | [self cleanupAudioQueue]; 137 | err = AudioQueueNewOutput( &audioDesc, HandleOutputBuffer, self, 138 | CFRunLoopGetCurrent(), kCFRunLoopCommonModes, 0, &audioQueue ); 139 | NSAssert(err == noErr, @"expected noErr", err ); 140 | err = AudioQueueAddPropertyListener( audioQueue, kAudioQueueProperty_IsRunning, MyAudioQueuePropertyListenerProc, self ); 141 | NSAssert(err == noErr, @"expected noErr", err ); 142 | } 143 | 144 | -(void)makeBuffers 145 | { 146 | OSStatus err; 147 | LOGFUNC_ENTRY; 148 | for ( int i = 0; i < NUM_AUDIO_BUFFERS; ++i ) 149 | { 150 | err = AudioQueueAllocateBufferWithPacketDescriptions( audioQueue, 32768, 0, &audioBuffers[i]); 151 | NSAssert(err == noErr, @"expected noErr", err ); 152 | HandleOutputBuffer( self, audioQueue, audioBuffers[i] ); 153 | } 154 | } 155 | 156 | -(void)start 157 | { 158 | LOGFUNC_ENTRY; 159 | OSStatus err = noErr; 160 | m_running = YES; 161 | [self setupAudioFormat]; 162 | [self makeAudioQueue]; 163 | [self makeBuffers]; 164 | err = AudioQueueStart( audioQueue, NULL ); 165 | NSAssert(err == noErr, @"expected noErr", err ); 166 | DLog( @"leaving %s", __func__ ); 167 | } 168 | 169 | -(void)stop 170 | { 171 | LOGFUNC_ENTRY; 172 | OSStatus err = noErr; 173 | m_running = NO; 174 | if ( audioQueue ) 175 | { 176 | err = AudioQueueStop( audioQueue, NO ); 177 | NSAssert(err == noErr, @"expected noErr", err ); 178 | } 179 | } 180 | 181 | -(void)handleQueuePropertyChange:(AudioQueueRef) inAQ propertyID: (AudioQueuePropertyID) inID; 182 | { 183 | LOGFUNC_ENTRY; 184 | if ( delegate ) 185 | { 186 | switch (inID) 187 | { 188 | case kAudioQueueProperty_IsRunning: 189 | { 190 | UInt32 isRunning; 191 | UInt32 ioDataSize = sizeof(isRunning); 192 | AudioQueueGetProperty( inAQ, inID, &isRunning, &ioDataSize ); 193 | if ( isRunning ) 194 | { 195 | if ([delegate respondsToSelector:@selector(audioQueuePlayerDidStartPlayback:)] ) 196 | { 197 | [delegate audioQueuePlayerDidStartPlayback:self]; 198 | } 199 | } 200 | else 201 | { 202 | if ([delegate respondsToSelector:@selector(audioQueuePlayerDidStopPlayback:)] ) 203 | { 204 | [delegate audioQueuePlayerDidStopPlayback:self]; 205 | } 206 | } 207 | } 208 | break; 209 | 210 | default: 211 | break; 212 | } 213 | } 214 | } 215 | @end 216 | -------------------------------------------------------------------------------- /FBAudioLib/FBDebugSupport.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 Mike Coleman 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // 15 | // Note: You are NOT required to make the license available from within your 16 | // iOS application. Including it in your project is sufficient. 17 | // 18 | // Attribution is not required, but appreciated :) 19 | // 20 | 21 | #if defined(FB_DEBUG) && defined( DEBUG ) && DEBUG == 1 22 | # define LOGFUNC_ENTRY NSLog( @"%s", __PRETTY_FUNCTION__ ) 23 | # define DLog(...) NSLog(__VA_ARGS__) 24 | #else 25 | # define LOGFUNC_ENTRY 26 | # define DLog(...) /* */ 27 | #endif 28 | 29 | -------------------------------------------------------------------------------- /FBAudioLib/FBSoundTouchAVAssetPlayer.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 Mike Coleman 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // 15 | // Note: You are NOT required to make the license available from within your 16 | // iOS application. Including it in your project is sufficient. 17 | // 18 | // Attribution is not required, but appreciated :) 19 | // 20 | // NOTE: Uses SoundTouch Audio Processing Library. License is below: 21 | // 22 | //////////////////////////////////////////////////////////////////////////////// 23 | // 24 | // License : 25 | // 26 | // SoundTouch audio processing library 27 | // Copyright (c) Olli Parviainen 28 | // 29 | // This library is free software; you can redistribute it and/or 30 | // modify it under the terms of the GNU Lesser General Public 31 | // License as published by the Free Software Foundation; either 32 | // version 2.1 of the License, or (at your option) any later version. 33 | // 34 | // This library is distributed in the hope that it will be useful, 35 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 36 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 37 | // Lesser General Public License for more details. 38 | // 39 | // You should have received a copy of the GNU Lesser General Public 40 | // License along with this library; if not, write to the Free Software 41 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 42 | // 43 | //////////////////////////////////////////////////////////////////////////////// 44 | 45 | #import "FBAVAssetPlayer.h" 46 | 47 | @interface FBSoundTouchAVAssetPlayer : FBAVAssetPlayer 48 | { 49 | float tempo; 50 | } 51 | @property (nonatomic, assign) float tempo; // tempo delta in percents: -95.0..+5000.0 52 | /* 53 | from superclass: 54 | -(void)playFromAssetURL:(NSURL*)assetURL; 55 | -(void)stop; 56 | */ 57 | @end 58 | -------------------------------------------------------------------------------- /FBAudioLib/FBSoundTouchAVAssetPlayer.mm: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 Mike Coleman 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // 15 | // Note: You are NOT required to make the license available from within your 16 | // iOS application. Including it in your project is sufficient. 17 | // 18 | // Attribution is not required, but appreciated :) 19 | // 20 | 21 | #import "FBSoundTouchAVAssetPlayer.h" 22 | #include 23 | //#define FB_DEBUG 24 | #import "FBDebugSupport.h" 25 | 26 | @interface FBSoundTouchAVAssetPlayer() 27 | { 28 | soundtouch::SoundTouch soundTouchEngine; 29 | } 30 | -(void)setupSoundTouch; 31 | 32 | @end 33 | 34 | @implementation FBSoundTouchAVAssetPlayer 35 | 36 | - (id)init 37 | { 38 | self = [super init]; 39 | if (self) 40 | { 41 | [self setupSoundTouch]; 42 | self.filteringCallback = ^(FBAVAssetPlayer *player, char *srcBuffer, UInt32 srcBytesAvailable, char *dstBuffer, UInt32 dstBufferCapacity, UInt32 *dstBytesWritten ) 43 | { 44 | soundTouchEngine.setTempoChange( tempo ); 45 | soundTouchEngine.putSamples((soundtouch::SAMPLETYPE*)srcBuffer, srcBytesAvailable / 4); 46 | UInt32 samplesWritten = soundTouchEngine.receiveSamples((soundtouch::SAMPLETYPE*) dstBuffer, 32768 / 4 ); 47 | *dstBytesWritten = samplesWritten * 4; 48 | }; 49 | } 50 | 51 | return self; 52 | } 53 | 54 | - (float)tempo 55 | { 56 | LOGFUNC_ENTRY; 57 | return tempo; 58 | } 59 | 60 | - (void)setTempo:(float)aTempo 61 | { 62 | LOGFUNC_ENTRY; 63 | if ( aTempo < -95.0f ) 64 | { 65 | aTempo = -95.0f; 66 | } 67 | else if ( aTempo > 5000.0f ) 68 | { 69 | aTempo = 5000.0f; 70 | } 71 | tempo = aTempo; 72 | soundTouchEngine.setTempoChange( tempo ); 73 | } 74 | 75 | -(void)setupSoundTouch 76 | { 77 | LOGFUNC_ENTRY; 78 | int sampleRate = 44100; 79 | int channels = 2; 80 | soundTouchEngine.setSampleRate( sampleRate ); 81 | soundTouchEngine.setChannels( channels ); 82 | soundTouchEngine.setTempoChange( 0.0f ); 83 | soundTouchEngine.setPitchSemiTones( 0.0f ); 84 | soundTouchEngine.setRateChange( 0.0f ); 85 | soundTouchEngine.setSetting( SETTING_USE_QUICKSEEK, TRUE ); 86 | soundTouchEngine.setSetting( SETTING_USE_AA_FILTER, FALSE ); 87 | } 88 | 89 | -(void)stop 90 | { 91 | LOGFUNC_ENTRY; 92 | soundTouchEngine.clear(); 93 | [super stop]; 94 | } 95 | 96 | @end 97 | -------------------------------------------------------------------------------- /FBAudioLib/SoundTouch.framework/Headers/BPMDetect.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | /// 3 | /// Beats-per-minute (BPM) detection routine. 4 | /// 5 | /// The beat detection algorithm works as follows: 6 | /// - Use function 'inputSamples' to input a chunks of samples to the class for 7 | /// analysis. It's a good idea to enter a large sound file or stream in smallish 8 | /// chunks of around few kilosamples in order not to extinguish too much RAM memory. 9 | /// - Input sound data is decimated to approx 500 Hz to reduce calculation burden, 10 | /// which is basically ok as low (bass) frequencies mostly determine the beat rate. 11 | /// Simple averaging is used for anti-alias filtering because the resulting signal 12 | /// quality isn't of that high importance. 13 | /// - Decimated sound data is enveloped, i.e. the amplitude shape is detected by 14 | /// taking absolute value that's smoothed by sliding average. Signal levels that 15 | /// are below a couple of times the general RMS amplitude level are cut away to 16 | /// leave only notable peaks there. 17 | /// - Repeating sound patterns (e.g. beats) are detected by calculating short-term 18 | /// autocorrelation function of the enveloped signal. 19 | /// - After whole sound data file has been analyzed as above, the bpm level is 20 | /// detected by function 'getBpm' that finds the highest peak of the autocorrelation 21 | /// function, calculates it's precise location and converts this reading to bpm's. 22 | /// 23 | /// Author : Copyright (c) Olli Parviainen 24 | /// Author e-mail : oparviai 'at' iki.fi 25 | /// SoundTouch WWW: http://www.surina.net/soundtouch 26 | /// 27 | //////////////////////////////////////////////////////////////////////////////// 28 | // 29 | // Last changed : $Date: 2009-02-21 18:00:14 +0200 (Sat, 21 Feb 2009) $ 30 | // File revision : $Revision: 4 $ 31 | // 32 | // $Id: BPMDetect.h 63 2009-02-21 16:00:14Z oparviai $ 33 | // 34 | //////////////////////////////////////////////////////////////////////////////// 35 | // 36 | // License : 37 | // 38 | // SoundTouch audio processing library 39 | // Copyright (c) Olli Parviainen 40 | // 41 | // This library is free software; you can redistribute it and/or 42 | // modify it under the terms of the GNU Lesser General Public 43 | // License as published by the Free Software Foundation; either 44 | // version 2.1 of the License, or (at your option) any later version. 45 | // 46 | // This library is distributed in the hope that it will be useful, 47 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 48 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 49 | // Lesser General Public License for more details. 50 | // 51 | // You should have received a copy of the GNU Lesser General Public 52 | // License along with this library; if not, write to the Free Software 53 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 54 | // 55 | //////////////////////////////////////////////////////////////////////////////// 56 | 57 | #ifndef _BPMDetect_H_ 58 | #define _BPMDetect_H_ 59 | 60 | #include "STTypes.h" 61 | #include "FIFOSampleBuffer.h" 62 | 63 | namespace soundtouch 64 | { 65 | 66 | /// Minimum allowed BPM rate. Used to restrict accepted result above a reasonable limit. 67 | #define MIN_BPM 29 68 | 69 | /// Maximum allowed BPM rate. Used to restrict accepted result below a reasonable limit. 70 | #define MAX_BPM 230 71 | 72 | 73 | /// Class for calculating BPM rate for audio data. 74 | class BPMDetect 75 | { 76 | protected: 77 | /// Auto-correlation accumulator bins. 78 | float *xcorr; 79 | 80 | /// Amplitude envelope sliding average approximation level accumulator 81 | float envelopeAccu; 82 | 83 | /// RMS volume sliding average approximation level accumulator 84 | float RMSVolumeAccu; 85 | 86 | /// Sample average counter. 87 | int decimateCount; 88 | 89 | /// Sample average accumulator for FIFO-like decimation. 90 | soundtouch::LONG_SAMPLETYPE decimateSum; 91 | 92 | /// Decimate sound by this coefficient to reach approx. 500 Hz. 93 | int decimateBy; 94 | 95 | /// Auto-correlation window length 96 | int windowLen; 97 | 98 | /// Number of channels (1 = mono, 2 = stereo) 99 | int channels; 100 | 101 | /// sample rate 102 | int sampleRate; 103 | 104 | /// Beginning of auto-correlation window: Autocorrelation isn't being updated for 105 | /// the first these many correlation bins. 106 | int windowStart; 107 | 108 | /// FIFO-buffer for decimated processing samples. 109 | soundtouch::FIFOSampleBuffer *buffer; 110 | 111 | /// Updates auto-correlation function for given number of decimated samples that 112 | /// are read from the internal 'buffer' pipe (samples aren't removed from the pipe 113 | /// though). 114 | void updateXCorr(int process_samples /// How many samples are processed. 115 | ); 116 | 117 | /// Decimates samples to approx. 500 Hz. 118 | /// 119 | /// \return Number of output samples. 120 | int decimate(soundtouch::SAMPLETYPE *dest, ///< Destination buffer 121 | const soundtouch::SAMPLETYPE *src, ///< Source sample buffer 122 | int numsamples ///< Number of source samples. 123 | ); 124 | 125 | /// Calculates amplitude envelope for the buffer of samples. 126 | /// Result is output to 'samples'. 127 | void calcEnvelope(soundtouch::SAMPLETYPE *samples, ///< Pointer to input/output data buffer 128 | int numsamples ///< Number of samples in buffer 129 | ); 130 | 131 | public: 132 | /// Constructor. 133 | BPMDetect(int numChannels, ///< Number of channels in sample data. 134 | int sampleRate ///< Sample rate in Hz. 135 | ); 136 | 137 | /// Destructor. 138 | virtual ~BPMDetect(); 139 | 140 | /// Inputs a block of samples for analyzing: Envelopes the samples and then 141 | /// updates the autocorrelation estimation. When whole song data has been input 142 | /// in smaller blocks using this function, read the resulting bpm with 'getBpm' 143 | /// function. 144 | /// 145 | /// Notice that data in 'samples' array can be disrupted in processing. 146 | void inputSamples(const soundtouch::SAMPLETYPE *samples, ///< Pointer to input/working data buffer 147 | int numSamples ///< Number of samples in buffer 148 | ); 149 | 150 | 151 | /// Analyzes the results and returns the BPM rate. Use this function to read result 152 | /// after whole song data has been input to the class by consecutive calls of 153 | /// 'inputSamples' function. 154 | /// 155 | /// \return Beats-per-minute rate, or zero if detection failed. 156 | float getBpm(); 157 | }; 158 | 159 | } 160 | 161 | #endif // _BPMDetect_H_ 162 | -------------------------------------------------------------------------------- /FBAudioLib/SoundTouch.framework/Headers/FIFOSampleBuffer.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | /// 3 | /// A buffer class for temporarily storaging sound samples, operates as a 4 | /// first-in-first-out pipe. 5 | /// 6 | /// Samples are added to the end of the sample buffer with the 'putSamples' 7 | /// function, and are received from the beginning of the buffer by calling 8 | /// the 'receiveSamples' function. The class automatically removes the 9 | /// output samples from the buffer as well as grows the storage size 10 | /// whenever necessary. 11 | /// 12 | /// Author : Copyright (c) Olli Parviainen 13 | /// Author e-mail : oparviai 'at' iki.fi 14 | /// SoundTouch WWW: http://www.surina.net/soundtouch 15 | /// 16 | //////////////////////////////////////////////////////////////////////////////// 17 | // 18 | // Last changed : $Date: 2009-02-21 18:00:14 +0200 (Sat, 21 Feb 2009) $ 19 | // File revision : $Revision: 4 $ 20 | // 21 | // $Id: FIFOSampleBuffer.h 63 2009-02-21 16:00:14Z oparviai $ 22 | // 23 | //////////////////////////////////////////////////////////////////////////////// 24 | // 25 | // License : 26 | // 27 | // SoundTouch audio processing library 28 | // Copyright (c) Olli Parviainen 29 | // 30 | // This library is free software; you can redistribute it and/or 31 | // modify it under the terms of the GNU Lesser General Public 32 | // License as published by the Free Software Foundation; either 33 | // version 2.1 of the License, or (at your option) any later version. 34 | // 35 | // This library is distributed in the hope that it will be useful, 36 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 37 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 38 | // Lesser General Public License for more details. 39 | // 40 | // You should have received a copy of the GNU Lesser General Public 41 | // License along with this library; if not, write to the Free Software 42 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 43 | // 44 | //////////////////////////////////////////////////////////////////////////////// 45 | 46 | #ifndef FIFOSampleBuffer_H 47 | #define FIFOSampleBuffer_H 48 | 49 | #include "FIFOSamplePipe.h" 50 | 51 | namespace soundtouch 52 | { 53 | 54 | /// Sample buffer working in FIFO (first-in-first-out) principle. The class takes 55 | /// care of storage size adjustment and data moving during input/output operations. 56 | /// 57 | /// Notice that in case of stereo audio, one sample is considered to consist of 58 | /// both channel data. 59 | class FIFOSampleBuffer : public FIFOSamplePipe 60 | { 61 | private: 62 | /// Sample buffer. 63 | SAMPLETYPE *buffer; 64 | 65 | // Raw unaligned buffer memory. 'buffer' is made aligned by pointing it to first 66 | // 16-byte aligned location of this buffer 67 | SAMPLETYPE *bufferUnaligned; 68 | 69 | /// Sample buffer size in bytes 70 | uint sizeInBytes; 71 | 72 | /// How many samples are currently in buffer. 73 | uint samplesInBuffer; 74 | 75 | /// Channels, 1=mono, 2=stereo. 76 | uint channels; 77 | 78 | /// Current position pointer to the buffer. This pointer is increased when samples are 79 | /// removed from the pipe so that it's necessary to actually rewind buffer (move data) 80 | /// only new data when is put to the pipe. 81 | uint bufferPos; 82 | 83 | /// Rewind the buffer by moving data from position pointed by 'bufferPos' to real 84 | /// beginning of the buffer. 85 | void rewind(); 86 | 87 | /// Ensures that the buffer has capacity for at least this many samples. 88 | void ensureCapacity(uint capacityRequirement); 89 | 90 | /// Returns current capacity. 91 | uint getCapacity() const; 92 | 93 | public: 94 | 95 | /// Constructor 96 | FIFOSampleBuffer(int numChannels = 2 ///< Number of channels, 1=mono, 2=stereo. 97 | ///< Default is stereo. 98 | ); 99 | 100 | /// destructor 101 | ~FIFOSampleBuffer(); 102 | 103 | /// Returns a pointer to the beginning of the output samples. 104 | /// This function is provided for accessing the output samples directly. 105 | /// Please be careful for not to corrupt the book-keeping! 106 | /// 107 | /// When using this function to output samples, also remember to 'remove' the 108 | /// output samples from the buffer by calling the 109 | /// 'receiveSamples(numSamples)' function 110 | virtual SAMPLETYPE *ptrBegin(); 111 | 112 | /// Returns a pointer to the end of the used part of the sample buffer (i.e. 113 | /// where the new samples are to be inserted). This function may be used for 114 | /// inserting new samples into the sample buffer directly. Please be careful 115 | /// not corrupt the book-keeping! 116 | /// 117 | /// When using this function as means for inserting new samples, also remember 118 | /// to increase the sample count afterwards, by calling the 119 | /// 'putSamples(numSamples)' function. 120 | SAMPLETYPE *ptrEnd( 121 | uint slackCapacity ///< How much free capacity (in samples) there _at least_ 122 | ///< should be so that the caller can succesfully insert the 123 | ///< desired samples to the buffer. If necessary, the function 124 | ///< grows the buffer size to comply with this requirement. 125 | ); 126 | 127 | /// Adds 'numSamples' pcs of samples from the 'samples' memory position to 128 | /// the sample buffer. 129 | virtual void putSamples(const SAMPLETYPE *samples, ///< Pointer to samples. 130 | uint numSamples ///< Number of samples to insert. 131 | ); 132 | 133 | /// Adjusts the book-keeping to increase number of samples in the buffer without 134 | /// copying any actual samples. 135 | /// 136 | /// This function is used to update the number of samples in the sample buffer 137 | /// when accessing the buffer directly with 'ptrEnd' function. Please be 138 | /// careful though! 139 | virtual void putSamples(uint numSamples ///< Number of samples been inserted. 140 | ); 141 | 142 | /// Output samples from beginning of the sample buffer. Copies requested samples to 143 | /// output buffer and removes them from the sample buffer. If there are less than 144 | /// 'numsample' samples in the buffer, returns all that available. 145 | /// 146 | /// \return Number of samples returned. 147 | virtual uint receiveSamples(SAMPLETYPE *output, ///< Buffer where to copy output samples. 148 | uint maxSamples ///< How many samples to receive at max. 149 | ); 150 | 151 | /// Adjusts book-keeping so that given number of samples are removed from beginning of the 152 | /// sample buffer without copying them anywhere. 153 | /// 154 | /// Used to reduce the number of samples in the buffer when accessing the sample buffer directly 155 | /// with 'ptrBegin' function. 156 | virtual uint receiveSamples(uint maxSamples ///< Remove this many samples from the beginning of pipe. 157 | ); 158 | 159 | /// Returns number of samples currently available. 160 | virtual uint numSamples() const; 161 | 162 | /// Sets number of channels, 1 = mono, 2 = stereo. 163 | void setChannels(int numChannels); 164 | 165 | /// Returns nonzero if there aren't any samples available for outputting. 166 | virtual int isEmpty() const; 167 | 168 | /// Clears all the samples. 169 | virtual void clear(); 170 | }; 171 | 172 | } 173 | 174 | #endif 175 | -------------------------------------------------------------------------------- /FBAudioLib/SoundTouch.framework/Headers/FIFOSamplePipe.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | /// 3 | /// 'FIFOSamplePipe' : An abstract base class for classes that manipulate sound 4 | /// samples by operating like a first-in-first-out pipe: New samples are fed 5 | /// into one end of the pipe with the 'putSamples' function, and the processed 6 | /// samples are received from the other end with the 'receiveSamples' function. 7 | /// 8 | /// 'FIFOProcessor' : A base class for classes the do signal processing with 9 | /// the samples while operating like a first-in-first-out pipe. When samples 10 | /// are input with the 'putSamples' function, the class processes them 11 | /// and moves the processed samples to the given 'output' pipe object, which 12 | /// may be either another processing stage, or a fifo sample buffer object. 13 | /// 14 | /// Author : Copyright (c) Olli Parviainen 15 | /// Author e-mail : oparviai 'at' iki.fi 16 | /// SoundTouch WWW: http://www.surina.net/soundtouch 17 | /// 18 | //////////////////////////////////////////////////////////////////////////////// 19 | // 20 | // Last changed : $Date: 2009-04-13 16:18:48 +0300 (Mon, 13 Apr 2009) $ 21 | // File revision : $Revision: 4 $ 22 | // 23 | // $Id: FIFOSamplePipe.h 69 2009-04-13 13:18:48Z oparviai $ 24 | // 25 | //////////////////////////////////////////////////////////////////////////////// 26 | // 27 | // License : 28 | // 29 | // SoundTouch audio processing library 30 | // Copyright (c) Olli Parviainen 31 | // 32 | // This library is free software; you can redistribute it and/or 33 | // modify it under the terms of the GNU Lesser General Public 34 | // License as published by the Free Software Foundation; either 35 | // version 2.1 of the License, or (at your option) any later version. 36 | // 37 | // This library is distributed in the hope that it will be useful, 38 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 39 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 40 | // Lesser General Public License for more details. 41 | // 42 | // You should have received a copy of the GNU Lesser General Public 43 | // License along with this library; if not, write to the Free Software 44 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 45 | // 46 | //////////////////////////////////////////////////////////////////////////////// 47 | 48 | #ifndef FIFOSamplePipe_H 49 | #define FIFOSamplePipe_H 50 | 51 | #include 52 | #include 53 | #include "STTypes.h" 54 | 55 | namespace soundtouch 56 | { 57 | 58 | /// Abstract base class for FIFO (first-in-first-out) sample processing classes. 59 | class FIFOSamplePipe 60 | { 61 | public: 62 | // virtual default destructor 63 | virtual ~FIFOSamplePipe() {} 64 | 65 | 66 | /// Returns a pointer to the beginning of the output samples. 67 | /// This function is provided for accessing the output samples directly. 68 | /// Please be careful for not to corrupt the book-keeping! 69 | /// 70 | /// When using this function to output samples, also remember to 'remove' the 71 | /// output samples from the buffer by calling the 72 | /// 'receiveSamples(numSamples)' function 73 | virtual SAMPLETYPE *ptrBegin() = 0; 74 | 75 | /// Adds 'numSamples' pcs of samples from the 'samples' memory position to 76 | /// the sample buffer. 77 | virtual void putSamples(const SAMPLETYPE *samples, ///< Pointer to samples. 78 | uint numSamples ///< Number of samples to insert. 79 | ) = 0; 80 | 81 | 82 | // Moves samples from the 'other' pipe instance to this instance. 83 | void moveSamples(FIFOSamplePipe &other ///< Other pipe instance where from the receive the data. 84 | ) 85 | { 86 | int oNumSamples = other.numSamples(); 87 | 88 | putSamples(other.ptrBegin(), oNumSamples); 89 | other.receiveSamples(oNumSamples); 90 | }; 91 | 92 | /// Output samples from beginning of the sample buffer. Copies requested samples to 93 | /// output buffer and removes them from the sample buffer. If there are less than 94 | /// 'numsample' samples in the buffer, returns all that available. 95 | /// 96 | /// \return Number of samples returned. 97 | virtual uint receiveSamples(SAMPLETYPE *output, ///< Buffer where to copy output samples. 98 | uint maxSamples ///< How many samples to receive at max. 99 | ) = 0; 100 | 101 | /// Adjusts book-keeping so that given number of samples are removed from beginning of the 102 | /// sample buffer without copying them anywhere. 103 | /// 104 | /// Used to reduce the number of samples in the buffer when accessing the sample buffer directly 105 | /// with 'ptrBegin' function. 106 | virtual uint receiveSamples(uint maxSamples ///< Remove this many samples from the beginning of pipe. 107 | ) = 0; 108 | 109 | /// Returns number of samples currently available. 110 | virtual uint numSamples() const = 0; 111 | 112 | // Returns nonzero if there aren't any samples available for outputting. 113 | virtual int isEmpty() const = 0; 114 | 115 | /// Clears all the samples. 116 | virtual void clear() = 0; 117 | }; 118 | 119 | 120 | 121 | /// Base-class for sound processing routines working in FIFO principle. With this base 122 | /// class it's easy to implement sound processing stages that can be chained together, 123 | /// so that samples that are fed into beginning of the pipe automatically go through 124 | /// all the processing stages. 125 | /// 126 | /// When samples are input to this class, they're first processed and then put to 127 | /// the FIFO pipe that's defined as output of this class. This output pipe can be 128 | /// either other processing stage or a FIFO sample buffer. 129 | class FIFOProcessor :public FIFOSamplePipe 130 | { 131 | protected: 132 | /// Internal pipe where processed samples are put. 133 | FIFOSamplePipe *output; 134 | 135 | /// Sets output pipe. 136 | void setOutPipe(FIFOSamplePipe *pOutput) 137 | { 138 | assert(output == NULL); 139 | assert(pOutput != NULL); 140 | output = pOutput; 141 | } 142 | 143 | 144 | /// Constructor. Doesn't define output pipe; it has to be set be 145 | /// 'setOutPipe' function. 146 | FIFOProcessor() 147 | { 148 | output = NULL; 149 | } 150 | 151 | 152 | /// Constructor. Configures output pipe. 153 | FIFOProcessor(FIFOSamplePipe *pOutput ///< Output pipe. 154 | ) 155 | { 156 | output = pOutput; 157 | } 158 | 159 | 160 | /// Destructor. 161 | virtual ~FIFOProcessor() 162 | { 163 | } 164 | 165 | 166 | /// Returns a pointer to the beginning of the output samples. 167 | /// This function is provided for accessing the output samples directly. 168 | /// Please be careful for not to corrupt the book-keeping! 169 | /// 170 | /// When using this function to output samples, also remember to 'remove' the 171 | /// output samples from the buffer by calling the 172 | /// 'receiveSamples(numSamples)' function 173 | virtual SAMPLETYPE *ptrBegin() 174 | { 175 | return output->ptrBegin(); 176 | } 177 | 178 | public: 179 | 180 | /// Output samples from beginning of the sample buffer. Copies requested samples to 181 | /// output buffer and removes them from the sample buffer. If there are less than 182 | /// 'numsample' samples in the buffer, returns all that available. 183 | /// 184 | /// \return Number of samples returned. 185 | virtual uint receiveSamples(SAMPLETYPE *outBuffer, ///< Buffer where to copy output samples. 186 | uint maxSamples ///< How many samples to receive at max. 187 | ) 188 | { 189 | return output->receiveSamples(outBuffer, maxSamples); 190 | } 191 | 192 | 193 | /// Adjusts book-keeping so that given number of samples are removed from beginning of the 194 | /// sample buffer without copying them anywhere. 195 | /// 196 | /// Used to reduce the number of samples in the buffer when accessing the sample buffer directly 197 | /// with 'ptrBegin' function. 198 | virtual uint receiveSamples(uint maxSamples ///< Remove this many samples from the beginning of pipe. 199 | ) 200 | { 201 | return output->receiveSamples(maxSamples); 202 | } 203 | 204 | 205 | /// Returns number of samples currently available. 206 | virtual uint numSamples() const 207 | { 208 | return output->numSamples(); 209 | } 210 | 211 | 212 | /// Returns nonzero if there aren't any samples available for outputting. 213 | virtual int isEmpty() const 214 | { 215 | return output->isEmpty(); 216 | } 217 | }; 218 | 219 | } 220 | 221 | #endif 222 | -------------------------------------------------------------------------------- /FBAudioLib/SoundTouch.framework/Headers/STTypes.h: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////////////////////////// 2 | /// 3 | /// Common type definitions for SoundTouch audio processing library. 4 | /// 5 | /// Author : Copyright (c) Olli Parviainen 6 | /// Author e-mail : oparviai 'at' iki.fi 7 | /// SoundTouch WWW: http://www.surina.net/soundtouch 8 | /// 9 | //////////////////////////////////////////////////////////////////////////////// 10 | // 11 | // Last changed : $Date: 2009-05-17 14:30:57 +0300 (Sun, 17 May 2009) $ 12 | // File revision : $Revision: 3 $ 13 | // 14 | // $Id: STTypes.h 70 2009-05-17 11:30:57Z oparviai $ 15 | // 16 | //////////////////////////////////////////////////////////////////////////////// 17 | // 18 | // License : 19 | // 20 | // SoundTouch audio processing library 21 | // Copyright (c) Olli Parviainen 22 | // 23 | // This library is free software; you can redistribute it and/or 24 | // modify it under the terms of the GNU Lesser General Public 25 | // License as published by the Free Software Foundation; either 26 | // version 2.1 of the License, or (at your option) any later version. 27 | // 28 | // This library is distributed in the hope that it will be useful, 29 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 30 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 31 | // Lesser General Public License for more details. 32 | // 33 | // You should have received a copy of the GNU Lesser General Public 34 | // License along with this library; if not, write to the Free Software 35 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 36 | // 37 | //////////////////////////////////////////////////////////////////////////////// 38 | 39 | #ifndef STTypes_H 40 | #define STTypes_H 41 | 42 | typedef unsigned int uint; 43 | typedef unsigned long ulong; 44 | 45 | #ifdef __GNUC__ 46 | // In GCC, include soundtouch_config.h made by config scritps 47 | #include "soundtouch_config.h" 48 | #endif 49 | 50 | #ifndef _WINDEF_ 51 | #ifndef __OBJC__ 52 | // if these aren't defined already by Windows headers, define now 53 | 54 | typedef int BOOL; 55 | 56 | #define FALSE 0 57 | #define TRUE 1 58 | 59 | #endif // __OBJC__ 60 | #endif // _WINDEF_ 61 | 62 | 63 | namespace soundtouch 64 | { 65 | 66 | /// Activate these undef's to overrule the possible sampletype 67 | /// setting inherited from some other header file: 68 | //#undef INTEGER_SAMPLES 69 | //#undef FLOAT_SAMPLES 70 | 71 | #if !(INTEGER_SAMPLES || FLOAT_SAMPLES) 72 | 73 | /// Choose either 32bit floating point or 16bit integer sampletype 74 | /// by choosing one of the following defines, unless this selection 75 | /// has already been done in some other file. 76 | //// 77 | /// Notes: 78 | /// - In Windows environment, choose the sample format with the 79 | /// following defines. 80 | /// - In GNU environment, the floating point samples are used by 81 | /// default, but integer samples can be chosen by giving the 82 | /// following switch to the configure script: 83 | /// ./configure --enable-integer-samples 84 | /// However, if you still prefer to select the sample format here 85 | /// also in GNU environment, then please #undef the INTEGER_SAMPLE 86 | /// and FLOAT_SAMPLE defines first as in comments above. 87 | //#define INTEGER_SAMPLES 1 //< 16bit integer samples 88 | #define FLOAT_SAMPLES 1 //< 32bit float samples 89 | 90 | #endif 91 | 92 | #if (WIN32 || __i386__ || __x86_64__) 93 | /// Define this to allow X86-specific assembler/intrinsic optimizations. 94 | /// Notice that library contains also usual C++ versions of each of these 95 | /// these routines, so if you're having difficulties getting the optimized 96 | /// routines compiled for whatever reason, you may disable these optimizations 97 | /// to make the library compile. 98 | 99 | #ifndef ALLOW_X86_OPTIMIZATIONS 100 | #define ALLOW_X86_OPTIMIZATIONS 1 101 | #endif 102 | 103 | #endif 104 | 105 | // If defined, allows the SIMD-optimized routines to take minor shortcuts 106 | // for improved performance. Undefine to require faithfully similar SIMD 107 | // calculations as in normal C implementation. 108 | #define ALLOW_NONEXACT_SIMD_OPTIMIZATION 1 109 | 110 | 111 | #ifdef INTEGER_SAMPLES 112 | // 16bit integer sample type 113 | typedef short SAMPLETYPE; 114 | // data type for sample accumulation: Use 32bit integer to prevent overflows 115 | typedef long LONG_SAMPLETYPE; 116 | 117 | #ifdef FLOAT_SAMPLES 118 | // check that only one sample type is defined 119 | #error "conflicting sample types defined" 120 | #endif // FLOAT_SAMPLES 121 | 122 | #if ALLOW_X86_OPTIMIZATIONS 123 | // Allow MMX optimizations 124 | #define ALLOW_MMX 1 125 | #endif 126 | 127 | #else 128 | 129 | // floating point samples 130 | typedef float SAMPLETYPE; 131 | // data type for sample accumulation: Use double to utilize full precision. 132 | typedef double LONG_SAMPLETYPE; 133 | 134 | #if ALLOW_X86_OPTIMIZATIONS 135 | // Allow 3DNow! and SSE optimizations 136 | #if WIN32 137 | #define ALLOW_3DNOW 1 138 | #endif 139 | 140 | #define ALLOW_SSE 1 141 | #endif 142 | 143 | #endif // INTEGER_SAMPLES 144 | }; 145 | 146 | 147 | // When this #define is active, eliminates a clicking sound when the "rate" or "pitch" 148 | // parameter setting crosses from value <1 to >=1 or vice versa during processing. 149 | // Default is off as such crossover is untypical case and involves a slight sound 150 | // quality compromise. 151 | //#define PREVENT_CLICK_AT_RATE_CROSSOVER 1 152 | 153 | #endif 154 | -------------------------------------------------------------------------------- /FBAudioLib/SoundTouch.framework/Headers/SoundTouch.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | /// 3 | /// SoundTouch - main class for tempo/pitch/rate adjusting routines. 4 | /// 5 | /// Notes: 6 | /// - Initialize the SoundTouch object instance by setting up the sound stream 7 | /// parameters with functions 'setSampleRate' and 'setChannels', then set 8 | /// desired tempo/pitch/rate settings with the corresponding functions. 9 | /// 10 | /// - The SoundTouch class behaves like a first-in-first-out pipeline: The 11 | /// samples that are to be processed are fed into one of the pipe by calling 12 | /// function 'putSamples', while the ready processed samples can be read 13 | /// from the other end of the pipeline with function 'receiveSamples'. 14 | /// 15 | /// - The SoundTouch processing classes require certain sized 'batches' of 16 | /// samples in order to process the sound. For this reason the classes buffer 17 | /// incoming samples until there are enough of samples available for 18 | /// processing, then they carry out the processing step and consequently 19 | /// make the processed samples available for outputting. 20 | /// 21 | /// - For the above reason, the processing routines introduce a certain 22 | /// 'latency' between the input and output, so that the samples input to 23 | /// SoundTouch may not be immediately available in the output, and neither 24 | /// the amount of outputtable samples may not immediately be in direct 25 | /// relationship with the amount of previously input samples. 26 | /// 27 | /// - The tempo/pitch/rate control parameters can be altered during processing. 28 | /// Please notice though that they aren't currently protected by semaphores, 29 | /// so in multi-thread application external semaphore protection may be 30 | /// required. 31 | /// 32 | /// - This class utilizes classes 'TDStretch' for tempo change (without modifying 33 | /// pitch) and 'RateTransposer' for changing the playback rate (that is, both 34 | /// tempo and pitch in the same ratio) of the sound. The third available control 35 | /// 'pitch' (change pitch but maintain tempo) is produced by a combination of 36 | /// combining the two other controls. 37 | /// 38 | /// Author : Copyright (c) Olli Parviainen 39 | /// Author e-mail : oparviai 'at' iki.fi 40 | /// SoundTouch WWW: http://www.surina.net/soundtouch 41 | /// 42 | //////////////////////////////////////////////////////////////////////////////// 43 | // 44 | // Last changed : $Date: 2009-12-28 22:10:14 +0200 (Mon, 28 Dec 2009) $ 45 | // File revision : $Revision: 4 $ 46 | // 47 | // $Id: SoundTouch.h 78 2009-12-28 20:10:14Z oparviai $ 48 | // 49 | //////////////////////////////////////////////////////////////////////////////// 50 | // 51 | // License : 52 | // 53 | // SoundTouch audio processing library 54 | // Copyright (c) Olli Parviainen 55 | // 56 | // This library is free software; you can redistribute it and/or 57 | // modify it under the terms of the GNU Lesser General Public 58 | // License as published by the Free Software Foundation; either 59 | // version 2.1 of the License, or (at your option) any later version. 60 | // 61 | // This library is distributed in the hope that it will be useful, 62 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 63 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 64 | // Lesser General Public License for more details. 65 | // 66 | // You should have received a copy of the GNU Lesser General Public 67 | // License along with this library; if not, write to the Free Software 68 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 69 | // 70 | //////////////////////////////////////////////////////////////////////////////// 71 | 72 | #ifndef SoundTouch_H 73 | #define SoundTouch_H 74 | 75 | #include "FIFOSamplePipe.h" 76 | #include "STTypes.h" 77 | 78 | namespace soundtouch 79 | { 80 | 81 | /// Soundtouch library version string 82 | #define SOUNDTOUCH_VERSION "1.5.0" 83 | 84 | /// SoundTouch library version id 85 | #define SOUNDTOUCH_VERSION_ID (10500) 86 | 87 | // 88 | // Available setting IDs for the 'setSetting' & 'get_setting' functions: 89 | 90 | /// Enable/disable anti-alias filter in pitch transposer (0 = disable) 91 | #define SETTING_USE_AA_FILTER 0 92 | 93 | /// Pitch transposer anti-alias filter length (8 .. 128 taps, default = 32) 94 | #define SETTING_AA_FILTER_LENGTH 1 95 | 96 | /// Enable/disable quick seeking algorithm in tempo changer routine 97 | /// (enabling quick seeking lowers CPU utilization but causes a minor sound 98 | /// quality compromising) 99 | #define SETTING_USE_QUICKSEEK 2 100 | 101 | /// Time-stretch algorithm single processing sequence length in milliseconds. This determines 102 | /// to how long sequences the original sound is chopped in the time-stretch algorithm. 103 | /// See "STTypes.h" or README for more information. 104 | #define SETTING_SEQUENCE_MS 3 105 | 106 | /// Time-stretch algorithm seeking window length in milliseconds for algorithm that finds the 107 | /// best possible overlapping location. This determines from how wide window the algorithm 108 | /// may look for an optimal joining location when mixing the sound sequences back together. 109 | /// See "STTypes.h" or README for more information. 110 | #define SETTING_SEEKWINDOW_MS 4 111 | 112 | /// Time-stretch algorithm overlap length in milliseconds. When the chopped sound sequences 113 | /// are mixed back together, to form a continuous sound stream, this parameter defines over 114 | /// how long period the two consecutive sequences are let to overlap each other. 115 | /// See "STTypes.h" or README for more information. 116 | #define SETTING_OVERLAP_MS 5 117 | 118 | 119 | class SoundTouch : public FIFOProcessor 120 | { 121 | private: 122 | /// Rate transposer class instance 123 | class RateTransposer *pRateTransposer; 124 | 125 | /// Time-stretch class instance 126 | class TDStretch *pTDStretch; 127 | 128 | /// Virtual pitch parameter. Effective rate & tempo are calculated from these parameters. 129 | float virtualRate; 130 | 131 | /// Virtual pitch parameter. Effective rate & tempo are calculated from these parameters. 132 | float virtualTempo; 133 | 134 | /// Virtual pitch parameter. Effective rate & tempo are calculated from these parameters. 135 | float virtualPitch; 136 | 137 | /// Flag: Has sample rate been set? 138 | BOOL bSrateSet; 139 | 140 | /// Calculates effective rate & tempo valuescfrom 'virtualRate', 'virtualTempo' and 141 | /// 'virtualPitch' parameters. 142 | void calcEffectiveRateAndTempo(); 143 | 144 | protected : 145 | /// Number of channels 146 | uint channels; 147 | 148 | /// Effective 'rate' value calculated from 'virtualRate', 'virtualTempo' and 'virtualPitch' 149 | float rate; 150 | 151 | /// Effective 'tempo' value calculated from 'virtualRate', 'virtualTempo' and 'virtualPitch' 152 | float tempo; 153 | 154 | public: 155 | SoundTouch(); 156 | virtual ~SoundTouch(); 157 | 158 | /// Get SoundTouch library version string 159 | static const char *getVersionString(); 160 | 161 | /// Get SoundTouch library version Id 162 | static uint getVersionId(); 163 | 164 | /// Sets new rate control value. Normal rate = 1.0, smaller values 165 | /// represent slower rate, larger faster rates. 166 | void setRate(float newRate); 167 | 168 | /// Sets new tempo control value. Normal tempo = 1.0, smaller values 169 | /// represent slower tempo, larger faster tempo. 170 | void setTempo(float newTempo); 171 | 172 | /// Sets new rate control value as a difference in percents compared 173 | /// to the original rate (-50 .. +100 %) 174 | void setRateChange(float newRate); 175 | 176 | /// Sets new tempo control value as a difference in percents compared 177 | /// to the original tempo (-50 .. +100 %) 178 | void setTempoChange(float newTempo); 179 | 180 | /// Sets new pitch control value. Original pitch = 1.0, smaller values 181 | /// represent lower pitches, larger values higher pitch. 182 | void setPitch(float newPitch); 183 | 184 | /// Sets pitch change in octaves compared to the original pitch 185 | /// (-1.00 .. +1.00) 186 | void setPitchOctaves(float newPitch); 187 | 188 | /// Sets pitch change in semi-tones compared to the original pitch 189 | /// (-12 .. +12) 190 | void setPitchSemiTones(int newPitch); 191 | void setPitchSemiTones(float newPitch); 192 | 193 | /// Sets the number of channels, 1 = mono, 2 = stereo 194 | void setChannels(uint numChannels); 195 | 196 | /// Sets sample rate. 197 | void setSampleRate(uint srate); 198 | 199 | /// Flushes the last samples from the processing pipeline to the output. 200 | /// Clears also the internal processing buffers. 201 | // 202 | /// Note: This function is meant for extracting the last samples of a sound 203 | /// stream. This function may introduce additional blank samples in the end 204 | /// of the sound stream, and thus it's not recommended to call this function 205 | /// in the middle of a sound stream. 206 | void flush(); 207 | 208 | /// Adds 'numSamples' pcs of samples from the 'samples' memory position into 209 | /// the input of the object. Notice that sample rate _has_to_ be set before 210 | /// calling this function, otherwise throws a runtime_error exception. 211 | virtual void putSamples( 212 | const SAMPLETYPE *samples, ///< Pointer to sample buffer. 213 | uint numSamples ///< Number of samples in buffer. Notice 214 | ///< that in case of stereo-sound a single sample 215 | ///< contains data for both channels. 216 | ); 217 | 218 | /// Clears all the samples in the object's output and internal processing 219 | /// buffers. 220 | virtual void clear(); 221 | 222 | /// Changes a setting controlling the processing system behaviour. See the 223 | /// 'SETTING_...' defines for available setting ID's. 224 | /// 225 | /// \return 'TRUE' if the setting was succesfully changed 226 | BOOL setSetting(int settingId, ///< Setting ID number. see SETTING_... defines. 227 | int value ///< New setting value. 228 | ); 229 | 230 | /// Reads a setting controlling the processing system behaviour. See the 231 | /// 'SETTING_...' defines for available setting ID's. 232 | /// 233 | /// \return the setting value. 234 | int getSetting(int settingId ///< Setting ID number, see SETTING_... defines. 235 | ) const; 236 | 237 | /// Returns number of samples currently unprocessed. 238 | virtual uint numUnprocessedSamples() const; 239 | 240 | 241 | /// Other handy functions that are implemented in the ancestor classes (see 242 | /// classes 'FIFOProcessor' and 'FIFOSamplePipe') 243 | /// 244 | /// - receiveSamples() : Use this function to receive 'ready' processed samples from SoundTouch. 245 | /// - numSamples() : Get number of 'ready' samples that can be received with 246 | /// function 'receiveSamples()' 247 | /// - isEmpty() : Returns nonzero if there aren't any 'ready' samples. 248 | /// - clear() : Clears all samples from ready/processing buffers. 249 | }; 250 | 251 | } 252 | #endif 253 | -------------------------------------------------------------------------------- /FBAudioLib/SoundTouch.framework/Headers/soundtouch_config.h: -------------------------------------------------------------------------------- 1 | /* include/soundtouch_config.h. Generated from soundtouch_config.h.in by configure. */ 2 | /* include/soundtouch_config.h.in. Generated from configure.ac by autoheader. */ 3 | 4 | /* Never allow x86 optimizations in iOS simulator build */ 5 | #define ALLOW_X86_OPTIMIZATIONS 0 6 | 7 | /* Use Integer as Sample type */ 8 | #define INTEGER_SAMPLES 1 9 | 10 | /* Use Float as Sample type */ 11 | //#define FLOAT_SAMPLES 1 12 | 13 | /* Define to 1 if you have the header file. */ 14 | #define HAVE_DLFCN_H 1 15 | 16 | /* Define to 1 if you have the header file. */ 17 | #define HAVE_INTTYPES_H 1 18 | 19 | /* Define to 1 if you have the `m' library (-lm). */ 20 | #define HAVE_LIBM 1 21 | 22 | /* Define to 1 if your system has a GNU libc compatible `malloc' function, and 23 | to 0 otherwise. */ 24 | #define HAVE_MALLOC 1 25 | 26 | /* Define to 1 if you have the header file. */ 27 | #define HAVE_MEMORY_H 1 28 | 29 | /* Define to 1 if you have the header file. */ 30 | #define HAVE_STDINT_H 1 31 | 32 | /* Define to 1 if you have the header file. */ 33 | #define HAVE_STDLIB_H 1 34 | 35 | /* Define to 1 if you have the header file. */ 36 | #define HAVE_STRINGS_H 1 37 | 38 | /* Define to 1 if you have the header file. */ 39 | #define HAVE_STRING_H 1 40 | 41 | /* Define to 1 if you have the header file. */ 42 | #define HAVE_SYS_STAT_H 1 43 | 44 | /* Define to 1 if you have the header file. */ 45 | #define HAVE_SYS_TYPES_H 1 46 | 47 | /* Define to 1 if you have the header file. */ 48 | #define HAVE_UNISTD_H 1 49 | 50 | /* Use Integer as Sample type */ 51 | /* #undef INTEGER_SAMPLES */ 52 | 53 | /* Define to the sub-directory in which libtool stores uninstalled libraries. 54 | */ 55 | #define LT_OBJDIR ".libs/" 56 | 57 | /* Name of package */ 58 | #define PACKAGE "soundtouch" 59 | 60 | /* Define to the address where bug reports for this package should be sent. */ 61 | #define PACKAGE_BUGREPORT "http://www.surina.net/soundtouch" 62 | 63 | /* Define to the full name of this package. */ 64 | #define PACKAGE_NAME "SoundTouch" 65 | 66 | /* Define to the full name and version of this package. */ 67 | #define PACKAGE_STRING "SoundTouch 1.4.0" 68 | 69 | /* Define to the one symbol short name of this package. */ 70 | #define PACKAGE_TARNAME "soundtouch" 71 | 72 | /* Define to the version of this package. */ 73 | #define PACKAGE_VERSION "1.4.0" 74 | 75 | /* Define as the return type of signal handlers (`int' or `void'). */ 76 | #define RETSIGTYPE void 77 | 78 | /* Define to 1 if you have the ANSI C header files. */ 79 | #define STDC_HEADERS 1 80 | 81 | /* Version number of package */ 82 | #define VERSION "1.4.0" 83 | 84 | /* Define to empty if `const' does not conform to ANSI C. */ 85 | /* #undef const */ 86 | 87 | /* Define to `__inline__' or `__inline' if that's what the C compiler 88 | calls it, or to nothing if 'inline' is not supported under any name. */ 89 | #ifndef __cplusplus 90 | /* #undef inline */ 91 | #endif 92 | 93 | /* Define to rpl_malloc if the replacement function should be used. */ 94 | /* #undef malloc */ 95 | -------------------------------------------------------------------------------- /FBAudioLib/SoundTouch.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mwhagedorn/FBAudio/a7e937fe6db1d59151132499c9ef10d52d88506f/FBAudioLib/SoundTouch.framework/Info.plist -------------------------------------------------------------------------------- /FBAudioLib/SoundTouch.framework/SoundTouch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mwhagedorn/FBAudio/a7e937fe6db1d59151132499c9ef10d52d88506f/FBAudioLib/SoundTouch.framework/SoundTouch -------------------------------------------------------------------------------- /FBAudioLib/SoundTouch.framework/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mwhagedorn/FBAudio/a7e937fe6db1d59151132499c9ef10d52d88506f/FBAudioLib/SoundTouch.framework/en.lproj/InfoPlist.strings -------------------------------------------------------------------------------- /FBAudioLibTester/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mwhagedorn/FBAudio/a7e937fe6db1d59151132499c9ef10d52d88506f/FBAudioLibTester/Default-568h@2x.png -------------------------------------------------------------------------------- /FBAudioLibTester/FBAudioLibTester.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 4C10964713D8DD1500BED9B6 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C10964613D8DD1500BED9B6 /* AudioToolbox.framework */; }; 11 | 4C10964B13D903BB00BED9B6 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C10964A13D903BB00BED9B6 /* CoreMedia.framework */; }; 12 | 4C10964D13D903C600BED9B6 /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C10964C13D903C600BED9B6 /* MediaPlayer.framework */; }; 13 | 4C24257213D7F59D0090C07A /* FBAudioQueuePlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C24257113D7F59D0090C07A /* FBAudioQueuePlayer.m */; }; 14 | 4C24257313D7F59D0090C07A /* FBAudioQueuePlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C24257113D7F59D0090C07A /* FBAudioQueuePlayer.m */; }; 15 | 4C24257913D801E80090C07A /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C24257813D801E80090C07A /* AVFoundation.framework */; }; 16 | 4C355CD213DBE3F600715991 /* FBSoundTouchAVAssetPlayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4C355CD113DBE3F600715991 /* FBSoundTouchAVAssetPlayer.mm */; }; 17 | 4C355CD313DBE3F600715991 /* FBSoundTouchAVAssetPlayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4C355CD113DBE3F600715991 /* FBSoundTouchAVAssetPlayer.mm */; }; 18 | 4C686D4C13DB8D5100C565AF /* FBAVAssetPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C686D4B13DB8D5100C565AF /* FBAVAssetPlayer.m */; }; 19 | 4C686D4D13DB8D5100C565AF /* FBAVAssetPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C686D4B13DB8D5100C565AF /* FBAVAssetPlayer.m */; }; 20 | 4CB3BDDF13D7B55C0072063E /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4CB3BDDE13D7B55C0072063E /* UIKit.framework */; }; 21 | 4CB3BDE113D7B55C0072063E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4CB3BDE013D7B55C0072063E /* Foundation.framework */; }; 22 | 4CB3BDE313D7B55C0072063E /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4CB3BDE213D7B55C0072063E /* CoreGraphics.framework */; }; 23 | 4CB3BDE913D7B55C0072063E /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 4CB3BDE713D7B55C0072063E /* InfoPlist.strings */; }; 24 | 4CB3BDEB13D7B55C0072063E /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CB3BDEA13D7B55C0072063E /* main.m */; }; 25 | 4CB3BDEF13D7B55C0072063E /* FBAudioLibTesterAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CB3BDEE13D7B55C0072063E /* FBAudioLibTesterAppDelegate.m */; }; 26 | 4CB3BDF213D7B55C0072063E /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4CB3BDF013D7B55C0072063E /* MainWindow.xib */; }; 27 | 4CB3BDF513D7B55C0072063E /* FBAudioLibTesterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CB3BDF413D7B55C0072063E /* FBAudioLibTesterViewController.m */; }; 28 | 4CB3BDF813D7B55C0072063E /* FBAudioLibTesterViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4CB3BDF613D7B55C0072063E /* FBAudioLibTesterViewController.xib */; }; 29 | 4CB3BE0013D7B55C0072063E /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4CB3BDFF13D7B55C0072063E /* SenTestingKit.framework */; }; 30 | 4CB3BE0113D7B55C0072063E /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4CB3BDDE13D7B55C0072063E /* UIKit.framework */; }; 31 | 4CB3BE0213D7B55C0072063E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4CB3BDE013D7B55C0072063E /* Foundation.framework */; }; 32 | 4CB3BE0313D7B55C0072063E /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4CB3BDE213D7B55C0072063E /* CoreGraphics.framework */; }; 33 | 4CB3BE0B13D7B55C0072063E /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 4CB3BE0913D7B55C0072063E /* InfoPlist.strings */; }; 34 | 4CB3BE0D13D7B55C0072063E /* FBAudioLibTesterTests.h in Resources */ = {isa = PBXBuildFile; fileRef = 4CB3BE0C13D7B55C0072063E /* FBAudioLibTesterTests.h */; }; 35 | 4CB3BE0F13D7B55C0072063E /* FBAudioLibTesterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CB3BE0E13D7B55C0072063E /* FBAudioLibTesterTests.m */; }; 36 | AF1B0E921647D7F900B24DA9 /* libSoundTouch.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AF593D1D1645D2040075D2C3 /* libSoundTouch.a */; }; 37 | AFD35F481647DE0300EC17D2 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = AFD35F471647DE0200EC17D2 /* Default-568h@2x.png */; }; 38 | /* End PBXBuildFile section */ 39 | 40 | /* Begin PBXContainerItemProxy section */ 41 | 4CB3BE0413D7B55C0072063E /* PBXContainerItemProxy */ = { 42 | isa = PBXContainerItemProxy; 43 | containerPortal = 4CB3BDD113D7B55C0072063E /* Project object */; 44 | proxyType = 1; 45 | remoteGlobalIDString = 4CB3BDD913D7B55C0072063E; 46 | remoteInfo = FBAudioLibTester; 47 | }; 48 | AF593D1C1645D2040075D2C3 /* PBXContainerItemProxy */ = { 49 | isa = PBXContainerItemProxy; 50 | containerPortal = AF593D141645D2040075D2C3 /* SoundTouch.xcodeproj */; 51 | proxyType = 2; 52 | remoteGlobalIDString = AF593CC71645CD870075D2C3; 53 | remoteInfo = SoundTouch; 54 | }; 55 | AF593D1E1645D2040075D2C3 /* PBXContainerItemProxy */ = { 56 | isa = PBXContainerItemProxy; 57 | containerPortal = AF593D141645D2040075D2C3 /* SoundTouch.xcodeproj */; 58 | proxyType = 2; 59 | remoteGlobalIDString = AF593CD81645CD880075D2C3; 60 | remoteInfo = SoundTouchTests; 61 | }; 62 | AF593D201645D2150075D2C3 /* PBXContainerItemProxy */ = { 63 | isa = PBXContainerItemProxy; 64 | containerPortal = AF593D141645D2040075D2C3 /* SoundTouch.xcodeproj */; 65 | proxyType = 1; 66 | remoteGlobalIDString = AF593CC61645CD870075D2C3; 67 | remoteInfo = SoundTouch; 68 | }; 69 | /* End PBXContainerItemProxy section */ 70 | 71 | /* Begin PBXFileReference section */ 72 | 4C10964613D8DD1500BED9B6 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; 73 | 4C10964913D8F9F100BED9B6 /* FBDebugSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FBDebugSupport.h; path = ../../FBAudioLib/FBDebugSupport.h; sourceTree = ""; }; 74 | 4C10964A13D903BB00BED9B6 /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; 75 | 4C10964C13D903C600BED9B6 /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = System/Library/Frameworks/MediaPlayer.framework; sourceTree = SDKROOT; }; 76 | 4C24257013D7F59D0090C07A /* FBAudioQueuePlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FBAudioQueuePlayer.h; path = ../../FBAudioLib/FBAudioQueuePlayer.h; sourceTree = ""; }; 77 | 4C24257113D7F59D0090C07A /* FBAudioQueuePlayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FBAudioQueuePlayer.m; path = ../../FBAudioLib/FBAudioQueuePlayer.m; sourceTree = ""; }; 78 | 4C24257813D801E80090C07A /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; 79 | 4C24257A13D80B750090C07A /* FBAudioLib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FBAudioLib.h; path = ../../FBAudioLib/FBAudioLib.h; sourceTree = ""; }; 80 | 4C355CD013DBE3F600715991 /* FBSoundTouchAVAssetPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FBSoundTouchAVAssetPlayer.h; path = ../../FBAudioLib/FBSoundTouchAVAssetPlayer.h; sourceTree = ""; }; 81 | 4C355CD113DBE3F600715991 /* FBSoundTouchAVAssetPlayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = FBSoundTouchAVAssetPlayer.mm; path = ../../FBAudioLib/FBSoundTouchAVAssetPlayer.mm; sourceTree = ""; }; 82 | 4C686D4A13DB8D5100C565AF /* FBAVAssetPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FBAVAssetPlayer.h; path = ../../FBAudioLib/FBAVAssetPlayer.h; sourceTree = ""; }; 83 | 4C686D4B13DB8D5100C565AF /* FBAVAssetPlayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FBAVAssetPlayer.m; path = ../../FBAudioLib/FBAVAssetPlayer.m; sourceTree = ""; }; 84 | 4CB3BDDA13D7B55C0072063E /* FBAudioLibTester.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FBAudioLibTester.app; sourceTree = BUILT_PRODUCTS_DIR; }; 85 | 4CB3BDDE13D7B55C0072063E /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 86 | 4CB3BDE013D7B55C0072063E /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 87 | 4CB3BDE213D7B55C0072063E /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 88 | 4CB3BDE613D7B55C0072063E /* FBAudioLibTester-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "FBAudioLibTester-Info.plist"; sourceTree = ""; }; 89 | 4CB3BDE813D7B55C0072063E /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 90 | 4CB3BDEA13D7B55C0072063E /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 91 | 4CB3BDEC13D7B55C0072063E /* FBAudioLibTester-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "FBAudioLibTester-Prefix.pch"; sourceTree = ""; }; 92 | 4CB3BDED13D7B55C0072063E /* FBAudioLibTesterAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FBAudioLibTesterAppDelegate.h; sourceTree = ""; }; 93 | 4CB3BDEE13D7B55C0072063E /* FBAudioLibTesterAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FBAudioLibTesterAppDelegate.m; sourceTree = ""; }; 94 | 4CB3BDF113D7B55C0072063E /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainWindow.xib; sourceTree = ""; }; 95 | 4CB3BDF313D7B55C0072063E /* FBAudioLibTesterViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FBAudioLibTesterViewController.h; sourceTree = ""; }; 96 | 4CB3BDF413D7B55C0072063E /* FBAudioLibTesterViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FBAudioLibTesterViewController.m; sourceTree = ""; }; 97 | 4CB3BDF713D7B55C0072063E /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/FBAudioLibTesterViewController.xib; sourceTree = ""; }; 98 | 4CB3BDFE13D7B55C0072063E /* FBAudioLibTesterTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FBAudioLibTesterTests.octest; sourceTree = BUILT_PRODUCTS_DIR; }; 99 | 4CB3BDFF13D7B55C0072063E /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; }; 100 | 4CB3BE0813D7B55C0072063E /* FBAudioLibTesterTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "FBAudioLibTesterTests-Info.plist"; sourceTree = ""; }; 101 | 4CB3BE0A13D7B55C0072063E /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 102 | 4CB3BE0C13D7B55C0072063E /* FBAudioLibTesterTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FBAudioLibTesterTests.h; sourceTree = ""; }; 103 | 4CB3BE0E13D7B55C0072063E /* FBAudioLibTesterTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FBAudioLibTesterTests.m; sourceTree = ""; }; 104 | AF593D141645D2040075D2C3 /* SoundTouch.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SoundTouch.xcodeproj; path = ../../SoundTouch/SoundTouch.xcodeproj; sourceTree = ""; }; 105 | AFD35F471647DE0200EC17D2 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; 106 | /* End PBXFileReference section */ 107 | 108 | /* Begin PBXFrameworksBuildPhase section */ 109 | 4CB3BDD713D7B55C0072063E /* Frameworks */ = { 110 | isa = PBXFrameworksBuildPhase; 111 | buildActionMask = 2147483647; 112 | files = ( 113 | AF1B0E921647D7F900B24DA9 /* libSoundTouch.a in Frameworks */, 114 | 4C10964D13D903C600BED9B6 /* MediaPlayer.framework in Frameworks */, 115 | 4C10964B13D903BB00BED9B6 /* CoreMedia.framework in Frameworks */, 116 | 4C10964713D8DD1500BED9B6 /* AudioToolbox.framework in Frameworks */, 117 | 4C24257913D801E80090C07A /* AVFoundation.framework in Frameworks */, 118 | 4CB3BDDF13D7B55C0072063E /* UIKit.framework in Frameworks */, 119 | 4CB3BDE113D7B55C0072063E /* Foundation.framework in Frameworks */, 120 | 4CB3BDE313D7B55C0072063E /* CoreGraphics.framework in Frameworks */, 121 | ); 122 | runOnlyForDeploymentPostprocessing = 0; 123 | }; 124 | 4CB3BDFA13D7B55C0072063E /* Frameworks */ = { 125 | isa = PBXFrameworksBuildPhase; 126 | buildActionMask = 2147483647; 127 | files = ( 128 | 4CB3BE0013D7B55C0072063E /* SenTestingKit.framework in Frameworks */, 129 | 4CB3BE0113D7B55C0072063E /* UIKit.framework in Frameworks */, 130 | 4CB3BE0213D7B55C0072063E /* Foundation.framework in Frameworks */, 131 | 4CB3BE0313D7B55C0072063E /* CoreGraphics.framework in Frameworks */, 132 | ); 133 | runOnlyForDeploymentPostprocessing = 0; 134 | }; 135 | /* End PBXFrameworksBuildPhase section */ 136 | 137 | /* Begin PBXGroup section */ 138 | 4C24256D13D7F3600090C07A /* FBAudioLib */ = { 139 | isa = PBXGroup; 140 | children = ( 141 | 4C24257013D7F59D0090C07A /* FBAudioQueuePlayer.h */, 142 | 4C24257113D7F59D0090C07A /* FBAudioQueuePlayer.m */, 143 | 4C24257A13D80B750090C07A /* FBAudioLib.h */, 144 | 4C10964913D8F9F100BED9B6 /* FBDebugSupport.h */, 145 | 4C686D4A13DB8D5100C565AF /* FBAVAssetPlayer.h */, 146 | 4C686D4B13DB8D5100C565AF /* FBAVAssetPlayer.m */, 147 | 4C355CD013DBE3F600715991 /* FBSoundTouchAVAssetPlayer.h */, 148 | 4C355CD113DBE3F600715991 /* FBSoundTouchAVAssetPlayer.mm */, 149 | ); 150 | name = FBAudioLib; 151 | sourceTree = ""; 152 | }; 153 | 4CB3BDCF13D7B55C0072063E = { 154 | isa = PBXGroup; 155 | children = ( 156 | AFD35F471647DE0200EC17D2 /* Default-568h@2x.png */, 157 | 4C10964C13D903C600BED9B6 /* MediaPlayer.framework */, 158 | 4C10964A13D903BB00BED9B6 /* CoreMedia.framework */, 159 | 4C10964613D8DD1500BED9B6 /* AudioToolbox.framework */, 160 | 4CB3BDE413D7B55C0072063E /* FBAudioLibTester */, 161 | 4CB3BE0613D7B55C0072063E /* FBAudioLibTesterTests */, 162 | 4CB3BDDD13D7B55C0072063E /* Frameworks */, 163 | 4CB3BDDB13D7B55C0072063E /* Products */, 164 | AF593D141645D2040075D2C3 /* SoundTouch.xcodeproj */, 165 | ); 166 | sourceTree = ""; 167 | }; 168 | 4CB3BDDB13D7B55C0072063E /* Products */ = { 169 | isa = PBXGroup; 170 | children = ( 171 | 4CB3BDDA13D7B55C0072063E /* FBAudioLibTester.app */, 172 | 4CB3BDFE13D7B55C0072063E /* FBAudioLibTesterTests.octest */, 173 | ); 174 | name = Products; 175 | sourceTree = ""; 176 | }; 177 | 4CB3BDDD13D7B55C0072063E /* Frameworks */ = { 178 | isa = PBXGroup; 179 | children = ( 180 | 4C24257813D801E80090C07A /* AVFoundation.framework */, 181 | 4CB3BDDE13D7B55C0072063E /* UIKit.framework */, 182 | 4CB3BDE013D7B55C0072063E /* Foundation.framework */, 183 | 4CB3BDE213D7B55C0072063E /* CoreGraphics.framework */, 184 | 4CB3BDFF13D7B55C0072063E /* SenTestingKit.framework */, 185 | ); 186 | name = Frameworks; 187 | sourceTree = ""; 188 | }; 189 | 4CB3BDE413D7B55C0072063E /* FBAudioLibTester */ = { 190 | isa = PBXGroup; 191 | children = ( 192 | 4C24256D13D7F3600090C07A /* FBAudioLib */, 193 | 4CB3BDED13D7B55C0072063E /* FBAudioLibTesterAppDelegate.h */, 194 | 4CB3BDEE13D7B55C0072063E /* FBAudioLibTesterAppDelegate.m */, 195 | 4CB3BDF013D7B55C0072063E /* MainWindow.xib */, 196 | 4CB3BDF313D7B55C0072063E /* FBAudioLibTesterViewController.h */, 197 | 4CB3BDF413D7B55C0072063E /* FBAudioLibTesterViewController.m */, 198 | 4CB3BDF613D7B55C0072063E /* FBAudioLibTesterViewController.xib */, 199 | 4CB3BDE513D7B55C0072063E /* Supporting Files */, 200 | ); 201 | path = FBAudioLibTester; 202 | sourceTree = ""; 203 | }; 204 | 4CB3BDE513D7B55C0072063E /* Supporting Files */ = { 205 | isa = PBXGroup; 206 | children = ( 207 | 4CB3BDE613D7B55C0072063E /* FBAudioLibTester-Info.plist */, 208 | 4CB3BDE713D7B55C0072063E /* InfoPlist.strings */, 209 | 4CB3BDEA13D7B55C0072063E /* main.m */, 210 | 4CB3BDEC13D7B55C0072063E /* FBAudioLibTester-Prefix.pch */, 211 | ); 212 | name = "Supporting Files"; 213 | sourceTree = ""; 214 | }; 215 | 4CB3BE0613D7B55C0072063E /* FBAudioLibTesterTests */ = { 216 | isa = PBXGroup; 217 | children = ( 218 | 4CB3BE0C13D7B55C0072063E /* FBAudioLibTesterTests.h */, 219 | 4CB3BE0E13D7B55C0072063E /* FBAudioLibTesterTests.m */, 220 | 4CB3BE0713D7B55C0072063E /* Supporting Files */, 221 | ); 222 | path = FBAudioLibTesterTests; 223 | sourceTree = ""; 224 | }; 225 | 4CB3BE0713D7B55C0072063E /* Supporting Files */ = { 226 | isa = PBXGroup; 227 | children = ( 228 | 4CB3BE0813D7B55C0072063E /* FBAudioLibTesterTests-Info.plist */, 229 | 4CB3BE0913D7B55C0072063E /* InfoPlist.strings */, 230 | ); 231 | name = "Supporting Files"; 232 | sourceTree = ""; 233 | }; 234 | AF593D151645D2040075D2C3 /* Products */ = { 235 | isa = PBXGroup; 236 | children = ( 237 | AF593D1D1645D2040075D2C3 /* libSoundTouch.a */, 238 | AF593D1F1645D2040075D2C3 /* SoundTouchTests.octest */, 239 | ); 240 | name = Products; 241 | sourceTree = ""; 242 | }; 243 | /* End PBXGroup section */ 244 | 245 | /* Begin PBXNativeTarget section */ 246 | 4CB3BDD913D7B55C0072063E /* FBAudioLibTester */ = { 247 | isa = PBXNativeTarget; 248 | buildConfigurationList = 4CB3BE1213D7B55C0072063E /* Build configuration list for PBXNativeTarget "FBAudioLibTester" */; 249 | buildPhases = ( 250 | 4CB3BDD613D7B55C0072063E /* Sources */, 251 | 4CB3BDD713D7B55C0072063E /* Frameworks */, 252 | 4CB3BDD813D7B55C0072063E /* Resources */, 253 | ); 254 | buildRules = ( 255 | ); 256 | dependencies = ( 257 | AF593D211645D2150075D2C3 /* PBXTargetDependency */, 258 | ); 259 | name = FBAudioLibTester; 260 | productName = FBAudioLibTester; 261 | productReference = 4CB3BDDA13D7B55C0072063E /* FBAudioLibTester.app */; 262 | productType = "com.apple.product-type.application"; 263 | }; 264 | 4CB3BDFD13D7B55C0072063E /* FBAudioLibTesterTests */ = { 265 | isa = PBXNativeTarget; 266 | buildConfigurationList = 4CB3BE1513D7B55C0072063E /* Build configuration list for PBXNativeTarget "FBAudioLibTesterTests" */; 267 | buildPhases = ( 268 | 4CB3BDF913D7B55C0072063E /* Sources */, 269 | 4CB3BDFA13D7B55C0072063E /* Frameworks */, 270 | 4CB3BDFB13D7B55C0072063E /* Resources */, 271 | 4CB3BDFC13D7B55C0072063E /* ShellScript */, 272 | ); 273 | buildRules = ( 274 | ); 275 | dependencies = ( 276 | 4CB3BE0513D7B55C0072063E /* PBXTargetDependency */, 277 | ); 278 | name = FBAudioLibTesterTests; 279 | productName = FBAudioLibTesterTests; 280 | productReference = 4CB3BDFE13D7B55C0072063E /* FBAudioLibTesterTests.octest */; 281 | productType = "com.apple.product-type.bundle"; 282 | }; 283 | /* End PBXNativeTarget section */ 284 | 285 | /* Begin PBXProject section */ 286 | 4CB3BDD113D7B55C0072063E /* Project object */ = { 287 | isa = PBXProject; 288 | attributes = { 289 | ORGANIZATIONNAME = "Five Bats Incorporated"; 290 | }; 291 | buildConfigurationList = 4CB3BDD413D7B55C0072063E /* Build configuration list for PBXProject "FBAudioLibTester" */; 292 | compatibilityVersion = "Xcode 3.2"; 293 | developmentRegion = English; 294 | hasScannedForEncodings = 0; 295 | knownRegions = ( 296 | en, 297 | ); 298 | mainGroup = 4CB3BDCF13D7B55C0072063E; 299 | productRefGroup = 4CB3BDDB13D7B55C0072063E /* Products */; 300 | projectDirPath = ""; 301 | projectReferences = ( 302 | { 303 | ProductGroup = AF593D151645D2040075D2C3 /* Products */; 304 | ProjectRef = AF593D141645D2040075D2C3 /* SoundTouch.xcodeproj */; 305 | }, 306 | ); 307 | projectRoot = ""; 308 | targets = ( 309 | 4CB3BDD913D7B55C0072063E /* FBAudioLibTester */, 310 | 4CB3BDFD13D7B55C0072063E /* FBAudioLibTesterTests */, 311 | ); 312 | }; 313 | /* End PBXProject section */ 314 | 315 | /* Begin PBXReferenceProxy section */ 316 | AF593D1D1645D2040075D2C3 /* libSoundTouch.a */ = { 317 | isa = PBXReferenceProxy; 318 | fileType = archive.ar; 319 | path = libSoundTouch.a; 320 | remoteRef = AF593D1C1645D2040075D2C3 /* PBXContainerItemProxy */; 321 | sourceTree = BUILT_PRODUCTS_DIR; 322 | }; 323 | AF593D1F1645D2040075D2C3 /* SoundTouchTests.octest */ = { 324 | isa = PBXReferenceProxy; 325 | fileType = wrapper.cfbundle; 326 | path = SoundTouchTests.octest; 327 | remoteRef = AF593D1E1645D2040075D2C3 /* PBXContainerItemProxy */; 328 | sourceTree = BUILT_PRODUCTS_DIR; 329 | }; 330 | /* End PBXReferenceProxy section */ 331 | 332 | /* Begin PBXResourcesBuildPhase section */ 333 | 4CB3BDD813D7B55C0072063E /* Resources */ = { 334 | isa = PBXResourcesBuildPhase; 335 | buildActionMask = 2147483647; 336 | files = ( 337 | 4CB3BDE913D7B55C0072063E /* InfoPlist.strings in Resources */, 338 | 4CB3BDF213D7B55C0072063E /* MainWindow.xib in Resources */, 339 | 4CB3BDF813D7B55C0072063E /* FBAudioLibTesterViewController.xib in Resources */, 340 | AFD35F481647DE0300EC17D2 /* Default-568h@2x.png in Resources */, 341 | ); 342 | runOnlyForDeploymentPostprocessing = 0; 343 | }; 344 | 4CB3BDFB13D7B55C0072063E /* Resources */ = { 345 | isa = PBXResourcesBuildPhase; 346 | buildActionMask = 2147483647; 347 | files = ( 348 | 4CB3BE0B13D7B55C0072063E /* InfoPlist.strings in Resources */, 349 | 4CB3BE0D13D7B55C0072063E /* FBAudioLibTesterTests.h in Resources */, 350 | ); 351 | runOnlyForDeploymentPostprocessing = 0; 352 | }; 353 | /* End PBXResourcesBuildPhase section */ 354 | 355 | /* Begin PBXShellScriptBuildPhase section */ 356 | 4CB3BDFC13D7B55C0072063E /* ShellScript */ = { 357 | isa = PBXShellScriptBuildPhase; 358 | buildActionMask = 2147483647; 359 | files = ( 360 | ); 361 | inputPaths = ( 362 | ); 363 | outputPaths = ( 364 | ); 365 | runOnlyForDeploymentPostprocessing = 0; 366 | shellPath = /bin/sh; 367 | shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n"; 368 | }; 369 | /* End PBXShellScriptBuildPhase section */ 370 | 371 | /* Begin PBXSourcesBuildPhase section */ 372 | 4CB3BDD613D7B55C0072063E /* Sources */ = { 373 | isa = PBXSourcesBuildPhase; 374 | buildActionMask = 2147483647; 375 | files = ( 376 | 4CB3BDEB13D7B55C0072063E /* main.m in Sources */, 377 | 4CB3BDEF13D7B55C0072063E /* FBAudioLibTesterAppDelegate.m in Sources */, 378 | 4CB3BDF513D7B55C0072063E /* FBAudioLibTesterViewController.m in Sources */, 379 | 4C24257213D7F59D0090C07A /* FBAudioQueuePlayer.m in Sources */, 380 | 4C686D4C13DB8D5100C565AF /* FBAVAssetPlayer.m in Sources */, 381 | 4C355CD213DBE3F600715991 /* FBSoundTouchAVAssetPlayer.mm in Sources */, 382 | ); 383 | runOnlyForDeploymentPostprocessing = 0; 384 | }; 385 | 4CB3BDF913D7B55C0072063E /* Sources */ = { 386 | isa = PBXSourcesBuildPhase; 387 | buildActionMask = 2147483647; 388 | files = ( 389 | 4CB3BE0F13D7B55C0072063E /* FBAudioLibTesterTests.m in Sources */, 390 | 4C24257313D7F59D0090C07A /* FBAudioQueuePlayer.m in Sources */, 391 | 4C686D4D13DB8D5100C565AF /* FBAVAssetPlayer.m in Sources */, 392 | 4C355CD313DBE3F600715991 /* FBSoundTouchAVAssetPlayer.mm in Sources */, 393 | ); 394 | runOnlyForDeploymentPostprocessing = 0; 395 | }; 396 | /* End PBXSourcesBuildPhase section */ 397 | 398 | /* Begin PBXTargetDependency section */ 399 | 4CB3BE0513D7B55C0072063E /* PBXTargetDependency */ = { 400 | isa = PBXTargetDependency; 401 | target = 4CB3BDD913D7B55C0072063E /* FBAudioLibTester */; 402 | targetProxy = 4CB3BE0413D7B55C0072063E /* PBXContainerItemProxy */; 403 | }; 404 | AF593D211645D2150075D2C3 /* PBXTargetDependency */ = { 405 | isa = PBXTargetDependency; 406 | name = SoundTouch; 407 | targetProxy = AF593D201645D2150075D2C3 /* PBXContainerItemProxy */; 408 | }; 409 | /* End PBXTargetDependency section */ 410 | 411 | /* Begin PBXVariantGroup section */ 412 | 4CB3BDE713D7B55C0072063E /* InfoPlist.strings */ = { 413 | isa = PBXVariantGroup; 414 | children = ( 415 | 4CB3BDE813D7B55C0072063E /* en */, 416 | ); 417 | name = InfoPlist.strings; 418 | sourceTree = ""; 419 | }; 420 | 4CB3BDF013D7B55C0072063E /* MainWindow.xib */ = { 421 | isa = PBXVariantGroup; 422 | children = ( 423 | 4CB3BDF113D7B55C0072063E /* en */, 424 | ); 425 | name = MainWindow.xib; 426 | sourceTree = ""; 427 | }; 428 | 4CB3BDF613D7B55C0072063E /* FBAudioLibTesterViewController.xib */ = { 429 | isa = PBXVariantGroup; 430 | children = ( 431 | 4CB3BDF713D7B55C0072063E /* en */, 432 | ); 433 | name = FBAudioLibTesterViewController.xib; 434 | sourceTree = ""; 435 | }; 436 | 4CB3BE0913D7B55C0072063E /* InfoPlist.strings */ = { 437 | isa = PBXVariantGroup; 438 | children = ( 439 | 4CB3BE0A13D7B55C0072063E /* en */, 440 | ); 441 | name = InfoPlist.strings; 442 | sourceTree = ""; 443 | }; 444 | /* End PBXVariantGroup section */ 445 | 446 | /* Begin XCBuildConfiguration section */ 447 | 4CB3BE1013D7B55C0072063E /* Debug */ = { 448 | isa = XCBuildConfiguration; 449 | buildSettings = { 450 | ALWAYS_SEARCH_USER_PATHS = NO; 451 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 452 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 453 | COPY_PHASE_STRIP = NO; 454 | GCC_C_LANGUAGE_STANDARD = gnu99; 455 | GCC_DYNAMIC_NO_PIC = NO; 456 | GCC_OPTIMIZATION_LEVEL = 0; 457 | GCC_PREPROCESSOR_DEFINITIONS = ( 458 | "DEBUG=1", 459 | "$(inherited)", 460 | ); 461 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 462 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 463 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 464 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 465 | GCC_WARN_UNUSED_VARIABLE = YES; 466 | IPHONEOS_DEPLOYMENT_TARGET = 4.1; 467 | SDKROOT = iphoneos; 468 | }; 469 | name = Debug; 470 | }; 471 | 4CB3BE1113D7B55C0072063E /* Release */ = { 472 | isa = XCBuildConfiguration; 473 | buildSettings = { 474 | ALWAYS_SEARCH_USER_PATHS = NO; 475 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 476 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 477 | COPY_PHASE_STRIP = YES; 478 | GCC_C_LANGUAGE_STANDARD = gnu99; 479 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 480 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 481 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 482 | GCC_WARN_UNUSED_VARIABLE = YES; 483 | IPHONEOS_DEPLOYMENT_TARGET = 4.1; 484 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 485 | SDKROOT = iphoneos; 486 | VALIDATE_PRODUCT = YES; 487 | }; 488 | name = Release; 489 | }; 490 | 4CB3BE1313D7B55C0072063E /* Debug */ = { 491 | isa = XCBuildConfiguration; 492 | buildSettings = { 493 | ARCHS = armv7; 494 | FRAMEWORK_SEARCH_PATHS = ( 495 | "$(inherited)", 496 | "\"$(SRCROOT)/../../Aural\"", 497 | "\"$(SRCROOT)/../FBAudioLib\"", 498 | ); 499 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 500 | GCC_PREFIX_HEADER = "FBAudioLibTester/FBAudioLibTester-Prefix.pch"; 501 | HEADER_SEARCH_PATHS = FBAudioLib; 502 | INFOPLIST_FILE = "FBAudioLibTester/FBAudioLibTester-Info.plist"; 503 | IPHONEOS_DEPLOYMENT_TARGET = 6.0; 504 | LIBRARY_SEARCH_PATHS = "$(inherited)"; 505 | PRODUCT_NAME = "$(TARGET_NAME)"; 506 | VALID_ARCHS = armv7; 507 | WRAPPER_EXTENSION = app; 508 | }; 509 | name = Debug; 510 | }; 511 | 4CB3BE1413D7B55C0072063E /* Release */ = { 512 | isa = XCBuildConfiguration; 513 | buildSettings = { 514 | ARCHS = armv7; 515 | FRAMEWORK_SEARCH_PATHS = ( 516 | "$(inherited)", 517 | "\"$(SRCROOT)/../../Aural\"", 518 | "\"$(SRCROOT)/../FBAudioLib\"", 519 | ); 520 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 521 | GCC_PREFIX_HEADER = "FBAudioLibTester/FBAudioLibTester-Prefix.pch"; 522 | HEADER_SEARCH_PATHS = FBAudioLib; 523 | INFOPLIST_FILE = "FBAudioLibTester/FBAudioLibTester-Info.plist"; 524 | IPHONEOS_DEPLOYMENT_TARGET = 6.0; 525 | LIBRARY_SEARCH_PATHS = "$(inherited)"; 526 | PRODUCT_NAME = "$(TARGET_NAME)"; 527 | VALID_ARCHS = armv7; 528 | WRAPPER_EXTENSION = app; 529 | }; 530 | name = Release; 531 | }; 532 | 4CB3BE1613D7B55C0072063E /* Debug */ = { 533 | isa = XCBuildConfiguration; 534 | buildSettings = { 535 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/FBAudioLibTester.app/FBAudioLibTester"; 536 | FRAMEWORK_SEARCH_PATHS = ( 537 | "$(SDKROOT)/Developer/Library/Frameworks", 538 | "$(DEVELOPER_LIBRARY_DIR)/Frameworks", 539 | ); 540 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 541 | GCC_PREFIX_HEADER = "FBAudioLibTester/FBAudioLibTester-Prefix.pch"; 542 | INFOPLIST_FILE = "FBAudioLibTesterTests/FBAudioLibTesterTests-Info.plist"; 543 | PRODUCT_NAME = "$(TARGET_NAME)"; 544 | TEST_HOST = "$(BUNDLE_LOADER)"; 545 | WRAPPER_EXTENSION = octest; 546 | }; 547 | name = Debug; 548 | }; 549 | 4CB3BE1713D7B55C0072063E /* Release */ = { 550 | isa = XCBuildConfiguration; 551 | buildSettings = { 552 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/FBAudioLibTester.app/FBAudioLibTester"; 553 | FRAMEWORK_SEARCH_PATHS = ( 554 | "$(SDKROOT)/Developer/Library/Frameworks", 555 | "$(DEVELOPER_LIBRARY_DIR)/Frameworks", 556 | ); 557 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 558 | GCC_PREFIX_HEADER = "FBAudioLibTester/FBAudioLibTester-Prefix.pch"; 559 | INFOPLIST_FILE = "FBAudioLibTesterTests/FBAudioLibTesterTests-Info.plist"; 560 | PRODUCT_NAME = "$(TARGET_NAME)"; 561 | TEST_HOST = "$(BUNDLE_LOADER)"; 562 | WRAPPER_EXTENSION = octest; 563 | }; 564 | name = Release; 565 | }; 566 | /* End XCBuildConfiguration section */ 567 | 568 | /* Begin XCConfigurationList section */ 569 | 4CB3BDD413D7B55C0072063E /* Build configuration list for PBXProject "FBAudioLibTester" */ = { 570 | isa = XCConfigurationList; 571 | buildConfigurations = ( 572 | 4CB3BE1013D7B55C0072063E /* Debug */, 573 | 4CB3BE1113D7B55C0072063E /* Release */, 574 | ); 575 | defaultConfigurationIsVisible = 0; 576 | defaultConfigurationName = Release; 577 | }; 578 | 4CB3BE1213D7B55C0072063E /* Build configuration list for PBXNativeTarget "FBAudioLibTester" */ = { 579 | isa = XCConfigurationList; 580 | buildConfigurations = ( 581 | 4CB3BE1313D7B55C0072063E /* Debug */, 582 | 4CB3BE1413D7B55C0072063E /* Release */, 583 | ); 584 | defaultConfigurationIsVisible = 0; 585 | defaultConfigurationName = Release; 586 | }; 587 | 4CB3BE1513D7B55C0072063E /* Build configuration list for PBXNativeTarget "FBAudioLibTesterTests" */ = { 588 | isa = XCConfigurationList; 589 | buildConfigurations = ( 590 | 4CB3BE1613D7B55C0072063E /* Debug */, 591 | 4CB3BE1713D7B55C0072063E /* Release */, 592 | ); 593 | defaultConfigurationIsVisible = 0; 594 | defaultConfigurationName = Release; 595 | }; 596 | /* End XCConfigurationList section */ 597 | }; 598 | rootObject = 4CB3BDD113D7B55C0072063E /* Project object */; 599 | } 600 | -------------------------------------------------------------------------------- /FBAudioLibTester/FBAudioLibTester.xcodeproj/xcuserdata/mc.xcuserdatad/xcschemes/FBAudioLibTester.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 14 | 20 | 21 | 22 | 28 | 34 | 35 | 36 | 37 | 38 | 43 | 44 | 46 | 52 | 53 | 54 | 55 | 56 | 62 | 63 | 69 | 70 | 71 | 72 | 73 | 74 | 79 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /FBAudioLibTester/FBAudioLibTester.xcodeproj/xcuserdata/mc.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | FBAudioLibTester.xcscheme 8 | 9 | orderHint 10 | 1 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 4CB3BDD913D7B55C0072063E 16 | 17 | primary 18 | 19 | 20 | 4CB3BDFD13D7B55C0072063E 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /FBAudioLibTester/FBAudioLibTester.xcodeproj/xcuserdata/mhagedorn.xcuserdatad/xcschemes/FBAudioLibTester.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 61 | 62 | 68 | 69 | 70 | 71 | 72 | 73 | 79 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /FBAudioLibTester/FBAudioLibTester.xcodeproj/xcuserdata/mhagedorn.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | FBAudioLibTester.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 4CB3BDD913D7B55C0072063E 16 | 17 | primary 18 | 19 | 20 | 4CB3BDFD13D7B55C0072063E 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /FBAudioLibTester/FBAudioLibTester/FBAudioLibTester-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.fivebats.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | NSMainNibFile 30 | MainWindow 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /FBAudioLibTester/FBAudioLibTester/FBAudioLibTester-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'FBAudioLibTester' target in the 'FBAudioLibTester' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iPhone SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /FBAudioLibTester/FBAudioLibTester/FBAudioLibTesterAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 Mike Coleman 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // 15 | // Note: You are NOT required to make the license available from within your 16 | // iOS application. Including it in your project is sufficient. 17 | // 18 | // Attribution is not required, but appreciated :) 19 | // 20 | 21 | #import 22 | 23 | @class FBAudioLibTesterViewController; 24 | 25 | @interface FBAudioLibTesterAppDelegate : NSObject 26 | 27 | @property (nonatomic, retain) IBOutlet UIWindow *window; 28 | 29 | @property (nonatomic, retain) IBOutlet FBAudioLibTesterViewController *viewController; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /FBAudioLibTester/FBAudioLibTester/FBAudioLibTesterAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 Mike Coleman 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // 15 | // Note: You are NOT required to make the license available from within your 16 | // iOS application. Including it in your project is sufficient. 17 | // 18 | // Attribution is not required, but appreciated :) 19 | // 20 | 21 | #import "FBAudioLibTesterAppDelegate.h" 22 | 23 | #import "FBAudioLibTesterViewController.h" 24 | 25 | @implementation FBAudioLibTesterAppDelegate 26 | 27 | @synthesize window = _window; 28 | @synthesize viewController = _viewController; 29 | 30 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 31 | { 32 | // Override point for customization after application launch. 33 | 34 | self.window.rootViewController = self.viewController; 35 | [self.window makeKeyAndVisible]; 36 | return YES; 37 | } 38 | 39 | - (void)applicationWillResignActive:(UIApplication *)application 40 | { 41 | /* 42 | Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 43 | Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 44 | */ 45 | } 46 | 47 | - (void)applicationDidEnterBackground:(UIApplication *)application 48 | { 49 | /* 50 | Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 51 | If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 52 | */ 53 | } 54 | 55 | - (void)applicationWillEnterForeground:(UIApplication *)application 56 | { 57 | /* 58 | Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 59 | */ 60 | } 61 | 62 | - (void)applicationDidBecomeActive:(UIApplication *)application 63 | { 64 | /* 65 | Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 66 | */ 67 | } 68 | 69 | - (void)applicationWillTerminate:(UIApplication *)application 70 | { 71 | /* 72 | Called when the application is about to terminate. 73 | Save data if appropriate. 74 | See also applicationDidEnterBackground:. 75 | */ 76 | } 77 | 78 | - (void)dealloc 79 | { 80 | [_window release]; 81 | [_viewController release]; 82 | [super dealloc]; 83 | } 84 | 85 | @end 86 | -------------------------------------------------------------------------------- /FBAudioLibTester/FBAudioLibTester/FBAudioLibTesterViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 Mike Coleman 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // 15 | // Note: You are NOT required to make the license available from within your 16 | // iOS application. Including it in your project is sufficient. 17 | // 18 | // Attribution is not required, but appreciated :) 19 | // 20 | 21 | #import 22 | #import "FBAudioLib.h" 23 | 24 | @interface FBAudioLibTesterViewController : UIViewController 25 | { 26 | MPMediaItem *song; 27 | UILabel *songLabel; 28 | UILabel *artistLabel; 29 | UIImageView *coverArtView; 30 | UISlider *songRateSlider; 31 | UILabel *speedLabel; 32 | UIButton *stopPlayingButton; 33 | } 34 | @property (nonatomic, retain) MPMediaItem *song; 35 | @property (nonatomic, assign) IBOutlet UILabel *songLabel; 36 | @property (nonatomic, assign) IBOutlet UILabel *artistLabel; 37 | @property (nonatomic, assign) IBOutlet UIImageView *coverArtView; 38 | @property (nonatomic, assign) IBOutlet UISlider *songRateSlider; 39 | @property (nonatomic, retain) IBOutlet UILabel *speedLabel; 40 | @property (nonatomic, retain) IBOutlet UIButton *stopPlayingButton; 41 | 42 | - (IBAction)chooseSongButtonPressed:(id)sender; 43 | - (IBAction)speedSliderValueChanged:(id)sender; 44 | - (IBAction)stopPlaybackButtonPressed:(id)sender; 45 | @end 46 | -------------------------------------------------------------------------------- /FBAudioLibTester/FBAudioLibTester/FBAudioLibTesterViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 Mike Coleman 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // 15 | // Note: You are NOT required to make the license available from within your 16 | // iOS application. Including it in your project is sufficient. 17 | // 18 | // Attribution is not required, but appreciated :) 19 | // 20 | #import 21 | 22 | #if TARGET_IPHONE_SIMULATOR 23 | #error This code cannot be tested on the simulator 24 | #endif 25 | 26 | #import "FBAudioLibTesterViewController.h" 27 | #import "FBAudioLib.h" 28 | //#define FB_DEBUG 29 | #import "FBDebugSupport.h" 30 | 31 | @interface FBAudioLibTesterViewController() 32 | @property(nonatomic, retain) FBSoundTouchAVAssetPlayer *audioPlayer; 33 | @end 34 | 35 | @implementation FBAudioLibTesterViewController 36 | @synthesize audioPlayer; 37 | @synthesize song; 38 | @synthesize songLabel; 39 | @synthesize artistLabel; 40 | @synthesize coverArtView; 41 | @synthesize songRateSlider; 42 | @synthesize speedLabel; 43 | @synthesize stopPlayingButton; 44 | 45 | - (void)didReceiveMemoryWarning 46 | { 47 | LOGFUNC_ENTRY; 48 | // Releases the view if it doesn't have a superview. 49 | [super didReceiveMemoryWarning]; 50 | 51 | // Release any cached data, images, etc that aren't in use. 52 | } 53 | 54 | #pragma mark - View lifecycle 55 | 56 | 57 | // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. 58 | - (void)viewDidLoad 59 | { 60 | LOGFUNC_ENTRY; 61 | self.audioPlayer = [[[FBSoundTouchAVAssetPlayer alloc] init] autorelease]; 62 | audioPlayer.delegate = self; 63 | stopPlayingButton.enabled = NO; 64 | self.songLabel.text = @""; 65 | self.artistLabel.text = @""; 66 | self.coverArtView.hidden = YES; 67 | [super viewDidLoad]; 68 | } 69 | 70 | 71 | -(void) viewDidAppear:(BOOL)animated 72 | { 73 | LOGFUNC_ENTRY; 74 | [super viewDidAppear:animated]; 75 | } 76 | 77 | - (void)viewDidUnload 78 | { 79 | LOGFUNC_ENTRY; 80 | self.songLabel = nil; 81 | self.artistLabel = nil; 82 | self.coverArtView = nil; 83 | self.songRateSlider = nil; 84 | self.speedLabel = nil; 85 | 86 | [self setStopPlayingButton:nil]; 87 | [super viewDidUnload]; 88 | } 89 | 90 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 91 | { 92 | LOGFUNC_ENTRY; 93 | // Return YES for supported orientations 94 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 95 | } 96 | 97 | - (void)dealloc 98 | { 99 | LOGFUNC_ENTRY; 100 | [song release], song = nil; 101 | [songLabel release], songLabel = nil; 102 | [artistLabel release], artistLabel = nil; 103 | [coverArtView release], coverArtView = nil; 104 | [songRateSlider release], songRateSlider = nil; 105 | [speedLabel release], speedLabel = nil; 106 | 107 | [stopPlayingButton release]; 108 | [super dealloc]; 109 | } 110 | 111 | #pragma mark actions 112 | 113 | -(void) playSong 114 | { 115 | LOGFUNC_ENTRY; 116 | [audioPlayer playFromAssetURL:[song valueForProperty:MPMediaItemPropertyAssetURL]]; 117 | } 118 | 119 | - (IBAction)chooseSongButtonPressed:(id)sender 120 | { 121 | LOGFUNC_ENTRY; 122 | [audioPlayer stop]; 123 | songRateSlider.value = 0.0f; 124 | [self speedSliderValueChanged:songRateSlider]; 125 | MPMediaPickerController *pickerController = [[MPMediaPickerController alloc] 126 | initWithMediaTypes: MPMediaTypeMusic]; 127 | pickerController.prompt = @"Choose song"; 128 | pickerController.allowsPickingMultipleItems = NO; 129 | pickerController.delegate = self; 130 | [self presentModalViewController:pickerController animated:YES]; 131 | [pickerController release]; 132 | } 133 | 134 | - (IBAction)speedSliderValueChanged:(id)sender 135 | { 136 | LOGFUNC_ENTRY; 137 | speedLabel.text = [NSString stringWithFormat:@"%2.1f x", (songRateSlider.value)/100.0 + 1.0]; 138 | audioPlayer.tempo = songRateSlider.value; 139 | } 140 | 141 | - (IBAction)stopPlaybackButtonPressed:(id)sender 142 | { 143 | LOGFUNC_ENTRY; 144 | [audioPlayer stop]; 145 | stopPlayingButton.enabled = NO; 146 | } 147 | 148 | 149 | #pragma mark MPMediaPickerControllerDelegate 150 | 151 | - (void)mediaPicker: (MPMediaPickerController *)mediaPicker didPickMediaItems:(MPMediaItemCollection *)mediaItemCollection 152 | { 153 | LOGFUNC_ENTRY; 154 | [self dismissModalViewControllerAnimated:YES]; 155 | if ( [mediaItemCollection count] < 1 ) 156 | { 157 | return; 158 | } 159 | self.song = [[mediaItemCollection items] objectAtIndex:0]; 160 | songLabel.hidden = NO; 161 | artistLabel.hidden = NO; 162 | coverArtView.hidden = NO; 163 | songLabel.text = [song valueForProperty:MPMediaItemPropertyTitle]; 164 | artistLabel.text = [song valueForProperty:MPMediaItemPropertyArtist]; 165 | coverArtView.image = [[song valueForProperty:MPMediaItemPropertyArtwork] 166 | imageWithSize: coverArtView.bounds.size]; 167 | coverArtView.hidden = NO; 168 | stopPlayingButton.enabled = YES; 169 | [self playSong]; 170 | } 171 | 172 | - (void)mediaPickerDidCancel:(MPMediaPickerController *)mediaPicker 173 | { 174 | LOGFUNC_ENTRY; 175 | [self dismissModalViewControllerAnimated:YES]; 176 | } 177 | 178 | #pragma mark FBAVAssetPlayerDelegate 179 | 180 | -(void) audioAssetPlayerDidStartPlayback:(FBAVAssetPlayer*)player 181 | { 182 | LOGFUNC_ENTRY; 183 | } 184 | 185 | -(void) audioAssetPlayerDidStopPlayback:(FBAVAssetPlayer*)player 186 | { 187 | LOGFUNC_ENTRY; 188 | dispatch_async( dispatch_get_main_queue(), ^{ 189 | self.songLabel.text = @""; 190 | self.artistLabel.text = @""; 191 | self.coverArtView.hidden = YES; 192 | }); 193 | } 194 | 195 | @end 196 | -------------------------------------------------------------------------------- /FBAudioLibTester/FBAudioLibTester/en.lproj/FBAudioLibTesterViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1056 5 | 11A511 6 | 1617 7 | 1138 8 | 566.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 534 12 | 13 | 14 | YES 15 | IBUISlider 16 | IBUIButton 17 | IBUIImageView 18 | IBUIView 19 | IBUILabel 20 | IBProxyObject 21 | 22 | 23 | YES 24 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 25 | 26 | 27 | YES 28 | 29 | YES 30 | 31 | 32 | 33 | 34 | YES 35 | 36 | IBFilesOwner 37 | IBCocoaTouchFramework 38 | 39 | 40 | IBFirstResponder 41 | IBCocoaTouchFramework 42 | 43 | 44 | 45 | 274 46 | 47 | YES 48 | 49 | 50 | 292 51 | {{18, 344}, {284, 23}} 52 | 53 | 54 | 55 | _NS:605 56 | NO 57 | IBCocoaTouchFramework 58 | 0 59 | 0 60 | -50 61 | 50 62 | 63 | 64 | 65 | 292 66 | {{20, 315}, {133, 21}} 67 | 68 | 69 | 70 | _NS:311 71 | NO 72 | YES 73 | 7 74 | NO 75 | IBCocoaTouchFramework 76 | Playback Speed: 77 | 78 | Helvetica 79 | 17 80 | 16 81 | 82 | 83 | 1 84 | MCAwIDAAA 85 | 86 | 87 | 1 88 | 10 89 | 90 | 91 | 92 | 292 93 | {{14, 252}, {286, 37}} 94 | 95 | 96 | 97 | _NS:222 98 | NO 99 | IBCocoaTouchFramework 100 | 0 101 | 0 102 | 103 | Helvetica-Bold 104 | 15 105 | 16 106 | 107 | 1 108 | Choose Song 109 | 110 | 3 111 | MQA 112 | 113 | 114 | 1 115 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 116 | 117 | 118 | 3 119 | MC41AA 120 | 121 | 122 | 123 | 124 | 292 125 | {{20, 20}, {138, 138}} 126 | 127 | 128 | 129 | _NS:541 130 | NO 131 | IBCocoaTouchFramework 132 | 133 | 134 | 135 | 292 136 | {{20, 184}, {49, 21}} 137 | 138 | 139 | 140 | _NS:311 141 | NO 142 | YES 143 | 7 144 | NO 145 | IBCocoaTouchFramework 146 | Artist: 147 | 148 | Helvetica-Bold 149 | 17 150 | 16 151 | 152 | 153 | 154 | 1 155 | 10 156 | 157 | 158 | 159 | 292 160 | {{20, 213}, {49, 21}} 161 | 162 | 163 | 164 | _NS:311 165 | NO 166 | YES 167 | 7 168 | NO 169 | IBCocoaTouchFramework 170 | Song: 171 | 172 | 173 | 174 | 1 175 | 10 176 | 177 | 178 | 179 | 292 180 | {{77, 184}, {223, 21}} 181 | 182 | 183 | 184 | _NS:311 185 | NO 186 | YES 187 | 7 188 | NO 189 | IBCocoaTouchFramework 190 | Label 191 | 192 | 193 | 1 194 | 10 195 | 196 | 197 | 198 | 292 199 | {{77, 213}, {223, 21}} 200 | 201 | 202 | 203 | _NS:311 204 | NO 205 | YES 206 | 7 207 | NO 208 | IBCocoaTouchFramework 209 | Label 210 | 211 | 212 | 213 | 1 214 | 10 215 | 216 | 217 | 218 | 292 219 | {{166, 315}, {95, 21}} 220 | 221 | 222 | 223 | _NS:311 224 | NO 225 | YES 226 | 7 227 | NO 228 | IBCocoaTouchFramework 229 | 1.0 x 230 | 231 | 232 | 233 | 1 234 | 10 235 | 236 | 237 | 238 | 292 239 | {{14, 396}, {286, 37}} 240 | 241 | 242 | _NS:222 243 | NO 244 | IBCocoaTouchFramework 245 | 0 246 | 0 247 | 248 | 1 249 | Stop Playback 250 | 251 | 252 | 1 253 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 254 | 255 | 256 | 257 | 258 | {{0, 20}, {320, 460}} 259 | 260 | 261 | 262 | 263 | 2 264 | MC44OTQxMTc3MTMgMC44NzQ1MDk4NzEgMC43OTYwNzg1MDMxAA 265 | 266 | NO 267 | 268 | IBCocoaTouchFramework 269 | 270 | 271 | 272 | 273 | YES 274 | 275 | 276 | view 277 | 278 | 279 | 280 | 7 281 | 282 | 283 | 284 | chooseSongButtonPressed: 285 | 286 | 287 | 7 288 | 289 | 19 290 | 291 | 292 | 293 | songRateSlider 294 | 295 | 296 | 297 | 20 298 | 299 | 300 | 301 | speedSliderValueChanged: 302 | 303 | 304 | 13 305 | 306 | 21 307 | 308 | 309 | 310 | coverArtView 311 | 312 | 313 | 314 | 22 315 | 316 | 317 | 318 | artistLabel 319 | 320 | 321 | 322 | 23 323 | 324 | 325 | 326 | songLabel 327 | 328 | 329 | 330 | 24 331 | 332 | 333 | 334 | speedLabel 335 | 336 | 337 | 338 | 27 339 | 340 | 341 | 342 | stopPlayingButton 343 | 344 | 345 | 346 | 29 347 | 348 | 349 | 350 | stopPlaybackButtonPressed: 351 | 352 | 353 | 7 354 | 355 | 30 356 | 357 | 358 | 359 | 360 | YES 361 | 362 | 0 363 | 364 | 365 | 366 | 367 | 368 | -1 369 | 370 | 371 | File's Owner 372 | 373 | 374 | -2 375 | 376 | 377 | 378 | 379 | 6 380 | 381 | 382 | YES 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 8 398 | 399 | 400 | 401 | 402 | 9 403 | 404 | 405 | 406 | 407 | 10 408 | 409 | 410 | 411 | 412 | 11 413 | 414 | 415 | 416 | 417 | 12 418 | 419 | 420 | 421 | 422 | 13 423 | 424 | 425 | 426 | 427 | 14 428 | 429 | 430 | 431 | 432 | 15 433 | 434 | 435 | 436 | 437 | 25 438 | 439 | 440 | 441 | 442 | 28 443 | 444 | 445 | 446 | 447 | 448 | 449 | YES 450 | 451 | YES 452 | -1.CustomClassName 453 | -1.IBPluginDependency 454 | -2.CustomClassName 455 | -2.IBPluginDependency 456 | 10.IBPluginDependency 457 | 11.IBPluginDependency 458 | 12.IBPluginDependency 459 | 13.IBPluginDependency 460 | 14.IBPluginDependency 461 | 15.IBPluginDependency 462 | 25.IBPluginDependency 463 | 28.IBPluginDependency 464 | 6.IBPluginDependency 465 | 8.IBPluginDependency 466 | 9.IBPluginDependency 467 | 468 | 469 | YES 470 | FBAudioLibTesterViewController 471 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 472 | UIResponder 473 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 474 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 475 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 476 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 477 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 478 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 479 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 480 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 481 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 482 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 483 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 484 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 485 | 486 | 487 | 488 | YES 489 | 490 | 491 | 492 | 493 | 494 | YES 495 | 496 | 497 | 498 | 499 | 30 500 | 501 | 502 | 503 | YES 504 | 505 | FBAudioLibTesterViewController 506 | UIViewController 507 | 508 | YES 509 | 510 | YES 511 | chooseSongButtonPressed: 512 | speedSliderValueChanged: 513 | stopPlaybackButtonPressed: 514 | 515 | 516 | YES 517 | id 518 | id 519 | id 520 | 521 | 522 | 523 | YES 524 | 525 | YES 526 | chooseSongButtonPressed: 527 | speedSliderValueChanged: 528 | stopPlaybackButtonPressed: 529 | 530 | 531 | YES 532 | 533 | chooseSongButtonPressed: 534 | id 535 | 536 | 537 | speedSliderValueChanged: 538 | id 539 | 540 | 541 | stopPlaybackButtonPressed: 542 | id 543 | 544 | 545 | 546 | 547 | YES 548 | 549 | YES 550 | artistLabel 551 | coverArtView 552 | sizeLabel 553 | songLabel 554 | songRateSlider 555 | speedLabel 556 | stopPlayingButton 557 | 558 | 559 | YES 560 | UILabel 561 | UIImageView 562 | UILabel 563 | UILabel 564 | UISlider 565 | UILabel 566 | UIButton 567 | 568 | 569 | 570 | YES 571 | 572 | YES 573 | artistLabel 574 | coverArtView 575 | sizeLabel 576 | songLabel 577 | songRateSlider 578 | speedLabel 579 | stopPlayingButton 580 | 581 | 582 | YES 583 | 584 | artistLabel 585 | UILabel 586 | 587 | 588 | coverArtView 589 | UIImageView 590 | 591 | 592 | sizeLabel 593 | UILabel 594 | 595 | 596 | songLabel 597 | UILabel 598 | 599 | 600 | songRateSlider 601 | UISlider 602 | 603 | 604 | speedLabel 605 | UILabel 606 | 607 | 608 | stopPlayingButton 609 | UIButton 610 | 611 | 612 | 613 | 614 | IBProjectSource 615 | ./Classes/FBAudioLibTesterViewController.h 616 | 617 | 618 | 619 | 620 | 0 621 | IBCocoaTouchFramework 622 | 623 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 624 | 625 | 626 | YES 627 | 3 628 | 534 629 | 630 | 631 | -------------------------------------------------------------------------------- /FBAudioLibTester/FBAudioLibTester/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /FBAudioLibTester/FBAudioLibTester/en.lproj/MainWindow.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1024 5 | 10D571 6 | 786 7 | 1038.29 8 | 460.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 112 12 | 13 | 14 | YES 15 | 16 | 17 | 18 | YES 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | YES 23 | 24 | YES 25 | 26 | 27 | YES 28 | 29 | 30 | 31 | YES 32 | 33 | IBFilesOwner 34 | IBCocoaTouchFramework 35 | 36 | 37 | IBFirstResponder 38 | IBCocoaTouchFramework 39 | 40 | 41 | IBCocoaTouchFramework 42 | 43 | 44 | FBAudioLibTesterViewController 45 | 46 | 47 | 1 48 | 49 | IBCocoaTouchFramework 50 | NO 51 | 52 | 53 | 54 | 292 55 | {320, 480} 56 | 57 | 1 58 | MSAxIDEAA 59 | 60 | NO 61 | NO 62 | 63 | IBCocoaTouchFramework 64 | YES 65 | 66 | 67 | 68 | 69 | YES 70 | 71 | 72 | delegate 73 | 74 | 75 | 76 | 4 77 | 78 | 79 | 80 | viewController 81 | 82 | 83 | 84 | 11 85 | 86 | 87 | 88 | window 89 | 90 | 91 | 92 | 14 93 | 94 | 95 | 96 | 97 | YES 98 | 99 | 0 100 | 101 | 102 | 103 | 104 | 105 | -1 106 | 107 | 108 | File's Owner 109 | 110 | 111 | 3 112 | 113 | 114 | FBAudioLibTester App Delegate 115 | 116 | 117 | -2 118 | 119 | 120 | 121 | 122 | 10 123 | 124 | 125 | 126 | 127 | 12 128 | 129 | 130 | 131 | 132 | 133 | 134 | YES 135 | 136 | YES 137 | -1.CustomClassName 138 | -2.CustomClassName 139 | 10.CustomClassName 140 | 10.IBEditorWindowLastContentRect 141 | 10.IBPluginDependency 142 | 12.IBEditorWindowLastContentRect 143 | 12.IBPluginDependency 144 | 3.CustomClassName 145 | 3.IBPluginDependency 146 | 147 | 148 | YES 149 | UIApplication 150 | UIResponder 151 | FBAudioLibTesterViewController 152 | {{234, 376}, {320, 480}} 153 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 154 | {{525, 346}, {320, 480}} 155 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 156 | FBAudioLibTesterAppDelegate 157 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 158 | 159 | 160 | 161 | YES 162 | 163 | 164 | YES 165 | 166 | 167 | 168 | 169 | YES 170 | 171 | 172 | YES 173 | 174 | 175 | 176 | 15 177 | 178 | 179 | 180 | YES 181 | 182 | UIWindow 183 | UIView 184 | 185 | IBUserSource 186 | 187 | 188 | 189 | 190 | FBAudioLibTesterAppDelegate 191 | NSObject 192 | 193 | YES 194 | 195 | YES 196 | viewController 197 | window 198 | 199 | 200 | YES 201 | FBAudioLibTesterViewController 202 | UIWindow 203 | 204 | 205 | 206 | YES 207 | 208 | YES 209 | viewController 210 | window 211 | 212 | 213 | YES 214 | 215 | viewController 216 | FBAudioLibTesterViewController 217 | 218 | 219 | window 220 | UIWindow 221 | 222 | 223 | 224 | 225 | IBProjectSource 226 | FBAudioLibTesterAppDelegate.h 227 | 228 | 229 | 230 | FBAudioLibTesterAppDelegate 231 | NSObject 232 | 233 | IBUserSource 234 | 235 | 236 | 237 | 238 | FBAudioLibTesterViewController 239 | UIViewController 240 | 241 | IBProjectSource 242 | FBAudioLibTesterViewController.h 243 | 244 | 245 | 246 | 247 | YES 248 | 249 | NSObject 250 | 251 | IBFrameworkSource 252 | Foundation.framework/Headers/NSError.h 253 | 254 | 255 | 256 | NSObject 257 | 258 | IBFrameworkSource 259 | Foundation.framework/Headers/NSFileManager.h 260 | 261 | 262 | 263 | NSObject 264 | 265 | IBFrameworkSource 266 | Foundation.framework/Headers/NSKeyValueCoding.h 267 | 268 | 269 | 270 | NSObject 271 | 272 | IBFrameworkSource 273 | Foundation.framework/Headers/NSKeyValueObserving.h 274 | 275 | 276 | 277 | NSObject 278 | 279 | IBFrameworkSource 280 | Foundation.framework/Headers/NSKeyedArchiver.h 281 | 282 | 283 | 284 | NSObject 285 | 286 | IBFrameworkSource 287 | Foundation.framework/Headers/NSObject.h 288 | 289 | 290 | 291 | NSObject 292 | 293 | IBFrameworkSource 294 | Foundation.framework/Headers/NSRunLoop.h 295 | 296 | 297 | 298 | NSObject 299 | 300 | IBFrameworkSource 301 | Foundation.framework/Headers/NSThread.h 302 | 303 | 304 | 305 | NSObject 306 | 307 | IBFrameworkSource 308 | Foundation.framework/Headers/NSURL.h 309 | 310 | 311 | 312 | NSObject 313 | 314 | IBFrameworkSource 315 | Foundation.framework/Headers/NSURLConnection.h 316 | 317 | 318 | 319 | NSObject 320 | 321 | IBFrameworkSource 322 | UIKit.framework/Headers/UIAccessibility.h 323 | 324 | 325 | 326 | NSObject 327 | 328 | IBFrameworkSource 329 | UIKit.framework/Headers/UINibLoading.h 330 | 331 | 332 | 333 | NSObject 334 | 335 | IBFrameworkSource 336 | UIKit.framework/Headers/UIResponder.h 337 | 338 | 339 | 340 | UIApplication 341 | UIResponder 342 | 343 | IBFrameworkSource 344 | UIKit.framework/Headers/UIApplication.h 345 | 346 | 347 | 348 | UIResponder 349 | NSObject 350 | 351 | 352 | 353 | UISearchBar 354 | UIView 355 | 356 | IBFrameworkSource 357 | UIKit.framework/Headers/UISearchBar.h 358 | 359 | 360 | 361 | UISearchDisplayController 362 | NSObject 363 | 364 | IBFrameworkSource 365 | UIKit.framework/Headers/UISearchDisplayController.h 366 | 367 | 368 | 369 | UIView 370 | 371 | IBFrameworkSource 372 | UIKit.framework/Headers/UITextField.h 373 | 374 | 375 | 376 | UIView 377 | UIResponder 378 | 379 | IBFrameworkSource 380 | UIKit.framework/Headers/UIView.h 381 | 382 | 383 | 384 | UIViewController 385 | 386 | IBFrameworkSource 387 | UIKit.framework/Headers/UINavigationController.h 388 | 389 | 390 | 391 | UIViewController 392 | 393 | IBFrameworkSource 394 | UIKit.framework/Headers/UIPopoverController.h 395 | 396 | 397 | 398 | UIViewController 399 | 400 | IBFrameworkSource 401 | UIKit.framework/Headers/UISplitViewController.h 402 | 403 | 404 | 405 | UIViewController 406 | 407 | IBFrameworkSource 408 | UIKit.framework/Headers/UITabBarController.h 409 | 410 | 411 | 412 | UIViewController 413 | UIResponder 414 | 415 | IBFrameworkSource 416 | UIKit.framework/Headers/UIViewController.h 417 | 418 | 419 | 420 | UIWindow 421 | UIView 422 | 423 | IBFrameworkSource 424 | UIKit.framework/Headers/UIWindow.h 425 | 426 | 427 | 428 | 429 | 0 430 | IBCocoaTouchFramework 431 | 432 | com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS 433 | 434 | 435 | 436 | com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 437 | 438 | 439 | YES 440 | FBAudioLibTester.xcodeproj 441 | 3 442 | 112 443 | 444 | 445 | -------------------------------------------------------------------------------- /FBAudioLibTester/FBAudioLibTester/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 Mike Coleman 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // 15 | // Note: You are NOT required to make the license available from within your 16 | // iOS application. Including it in your project is sufficient. 17 | // 18 | // Attribution is not required, but appreciated :) 19 | // 20 | 21 | #import 22 | 23 | int main(int argc, char *argv[]) 24 | { 25 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 26 | int retVal = UIApplicationMain(argc, argv, nil, nil); 27 | [pool release]; 28 | return retVal; 29 | } 30 | -------------------------------------------------------------------------------- /FBAudioLibTester/FBAudioLibTesterTests/FBAudioLibTesterTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.fivebats.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /FBAudioLibTester/FBAudioLibTesterTests/FBAudioLibTesterTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 Mike Coleman 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // 15 | // Note: You are NOT required to make the license available from within your 16 | // iOS application. Including it in your project is sufficient. 17 | // 18 | // Attribution is not required, but appreciated :) 19 | // 20 | 21 | #import 22 | 23 | @interface FBAudioLibTesterTests : SenTestCase 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /FBAudioLibTester/FBAudioLibTesterTests/FBAudioLibTesterTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 Mike Coleman 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // 15 | // Note: You are NOT required to make the license available from within your 16 | // iOS application. Including it in your project is sufficient. 17 | // 18 | // Attribution is not required, but appreciated :) 19 | // 20 | 21 | #import "FBAudioLibTesterTests.h" 22 | 23 | @implementation FBAudioLibTesterTests 24 | 25 | - (void)setUp 26 | { 27 | [super setUp]; 28 | 29 | // Set-up code here. 30 | } 31 | 32 | - (void)tearDown 33 | { 34 | // Tear-down code here. 35 | 36 | [super tearDown]; 37 | } 38 | 39 | - (void)testExample 40 | { 41 | STFail(@"Unit tests are not implemented yet in FBAudioLibTesterTests"); 42 | } 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /FBAudioLibTester/FBAudioLibTesterTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FBAudio Library 2 | 3 | This was created as part of the "Rock and Run" project from [iOSDevCamp11](http://www.iosdevcamp.org/). 4 | 5 | We needed code to play songs from the user's iTunes library while making changes to the song tempo to match the runner's pace. 6 | 7 | iOSDevCamp takes place over a weekend, so the point is to create an interesting application and demonstrate it very quickly. In that spirit this code is very alpha and not tested very well. Feel free to improve it! 8 | 9 | ## What is Here 10 | 11 | ### Players 12 | 13 | There are a few different players. From lowest to highest level they are: 14 | 15 | * **FBAudioQueuePlayer**. 16 | This plays audio using Audio Queue services. A user-provided callback function is called repeatedly to add audio to the playback queue. 17 | 18 | * **FBAVAssetPlayer**. 19 | This uses the FBAudioQueuePlayer, feeding it audio from a user-specified AVAsset. 20 | 21 | * **FBSoundTouchAVAssetPlayer**. 22 | A subclass of the FBAVAssetPlayer that uses the [SoundTouch](http://www.surina.net/soundtouch/) audio processing library to adjust the tempo of the playing audio 23 | 24 | ### Example iOS project 25 | 26 | **FBAudioLibTester** is a program that shows how to use FBSoundTouchAVAssetPlayer. It prompts the user to select a song from the iTunes library on their device and plays it. A tempo slider permits changes to the playing audio tempo. 27 | 28 | **Please note that the test app cannot be run in the simulator because the simulator runtime does not have some of the required libraries.** 29 | 30 | ## How to Use 31 | 32 | Copy the contents of the FBAudioLib folder into your project. 33 | 34 | Then see the code from FBAudioLibTester. Basically just instantiate a FBSoundTouchAVAssetPlayer and give it a URL pointing to the AVAsset to play. You may adjust the tempo by writing to the tempo property of the player. 35 | 36 | ## WARNING 37 | 38 | The AVAsset players use Apple's AVAssetReader. Apple is very explicit about warning that AVAssetReader is not intended for realtime use. It *seems* to work OK for this application, but there are some drawbacks. I'm pretty sure that using this will prevent the audio player from working in the background, and it doesn't seem to be capable of using the hardware decoder. 39 | 40 | An alternative method would be to first copy the song to a sandboxed file and then to play it using a realtime player. Perhaps FBAudio will someday include code that does this. 41 | 42 | ## Credits 43 | 44 | I wrote this while reading Chris Adamson's [*VTM_AViPodReader*](http://www.subfurther.com/blog/2010/12/13/from-ipod-library-to-pcm-samples-in-far-fewer-steps-than-were-previously-necessary/) application. Much of this code is influenced by Chris' work. 45 | 46 | The **SoundTouch** static library is built via the project 47 | [SoundTouch](https://github.com/mwhagedorn/SoundTouch) repo 48 | 49 | ## License 50 | 51 | With the exception of the SoundTouch framework, this code is copyright 2011 Mike Coleman, and is released under the Apache 2.0 license. 52 | 53 | The SoundTouch framework is covered by the [LGPL v2.1](http://www.surina.net/soundtouch/license.html). Regarding usage of the static library for an iOS application the SoundTouch author states on the [FAQ:](http://www.surina.net/soundtouch/faq.html) 54 | > "I don't mind at all if your application uses static linkage instead of dynamic, as far as you otherwise follow license terms, i.e. include a copyright notice of SoundTouch usage in the application." 55 | --------------------------------------------------------------------------------