Robust audio playback using NSSound...
Robust audio playback using NSSound...
- Subject: Robust audio playback using NSSound...
- From: patrick machielse <email@hidden>
- Date: Fri, 12 Aug 2005 17:00:15 +0200
I'm developing a component which should (try to) play back arbitrary
sound files. The file formats should be the regular Quicktime
suspects: aiff, wav, mp3, au, etc. I'm using the NSSound class, which
advertises its sound file support through the method -[NSSound
soundUnfilteredFileTypes].
At first I created NSSound objects using:
- (id)initWithContentsOfFile:(NSString *)path byReference:(BOOL)byRef
Sound objects created this way play all promised file formats, and
even go beyond the 'documentation' by also supporting .mid and .mov
file playback. However, file support goes over the top when NSSound
objects happily start playing .txt, .htm., and .pdf files...
I then resorted to creating NSSound object with:
- (id)initWithData:(NSData *)data
These sound objects will correctly refuse to 'play' text files. New
problem: some mp3 files that played earlier will no longer play, and
I am not able to play _any_ .m4a files (no DRM) which also play fine
when I use initWithContentsOfFile.
I hope someone has tackled these problems and knows a workaround. The
documentation sure doesn't help; it's about 4 years out of date :-(
patrick
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden