Re: Multiple ExtAudioFileRefs pointing to the same file
Re: Multiple ExtAudioFileRefs pointing to the same file
- Subject: Re: Multiple ExtAudioFileRefs pointing to the same file
- From: Christopher Liscio <email@hidden>
- Date: Tue, 10 Mar 2009 22:02:25 -0400
Doug,
On Mar 10, 2009, at 5:44 PM, Christopher Liscio wrote:
On Mar 10, 2009, at 5:33 PM, Doug Wyatt wrote:
How were the two ExtAudioFiles created? Are they both "wrapping"
the same AudioFile which you opened first? Or were they opened
independently?
Both were opened using ExtAudioFileOpenURL.
I created a very simple example of this. It's stupid, but it gets the
point across...
http://dl.getdropbox.com/u/29159/AFTest.zip
Drag an M4A audio file onto this test app's dock icon, and watch the
console. The main thread loads the file once, and displays its frame
count. Then, every second, an NSTimer fires and an NSThread is kicked
off to create a new ExtAudioFileRef and query its frame count.
You'll notice output like the following:
2009-03-10 21:43:33.272 AFTest[9418:10b] open file /Users/chris/
Desktop/04 Bottoms Up!.m4a
2009-03-10 21:43:33.325 AFTest[9418:10b] got frame count 8232828
2009-03-10 21:43:34.330 AFTest[9418:480f] got frame count 131756933
2009-03-10 21:43:35.329 AFTest[9418:4813] got frame count 8232828
2009-03-10 21:43:36.330 AFTest[9418:4817] got frame count 131756934
2009-03-10 21:43:37.329 AFTest[9418:481b] got frame count 131756935
...
Of course, the CoreAudio calls are wrapped in some Objective-C, but
there are really only two routines in SMUGExtendedAudioFile to check
out here:
- (id)initForPlaybackWithFilename:(NSString*)filename
- (SInt64)frameCount
Is there any significance to my using ExtAudioFileOpenURL versus
wrapping an AudioFileID?
Thanks,
Chris Liscio
http://SuperMegaUltraGroovy.com
Acoustic measurement software for Mac OS X -- http://www.FuzzMeasure.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden