Re: NSSound initWithData?
Re: NSSound initWithData?
- Subject: Re: NSSound initWithData?
- From: Jason Wright <email@hidden>
- Date: Fri, 31 Oct 2003 01:42:00 -0500
The code snippet below is my attempt to use NSSound initWithData to
play 5 seconds of silence. I craft what I believe is a valid WAV
file, but no sound is played (and 'play' returns NO). Am I missing
something here? I'm relatively new to programming under MacOS, but no
stranger to programming generally.
Bah, appears I've answered my own question... WAV isn't supported by
initWithData, so I'll be consing up an AIFF instead, which looks
surprisingly familiar except for issues like byte order and rearranging
fields. It's quite annoying that the manual pages for this class
describe it as supporting SND, WAV, and AIFF but fail to mention that
only AIFF is really supported by one of the methods.
...
- (id)initWithData:(NSData *)data;
/* Whether the data comes in from disk, or via this method, NSSound
* expects it to have a proper magic number, sound header, and data.
* Only uncompressed AIFF data is currently supported. */
...
--Jason L. Wright
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.