NSSound and mp3

Member
Posts: 42
Joined: 2002.09
Post: #1
I just had NSSound describe the file types it can handle, and mp3 isn't one of them. Is there a simple way of looping background mp3s? I'm no QuickTime guru, although I am wading through the docs now.

Visit http://www.theDailyGrind.net for your recommended daily intake of embittered satire.
Quote this message in a reply
sh4ggy87
Unregistered
 
Post: #2
Have you tried NSMovie? NSMovie is an ObjC wrapper for QuickTime, so it may be easier for you to deal with. Apple Docs on NSMovie. I'm pretty sure it will read anything that QuickTime can.
Quote this message in a reply
Member
Posts: 42
Joined: 2002.09
Post: #3
I found some interesting SoundPlayer sample code on the Apple site, and was totally baffled until I realised that 99% of it was devoted to loading the movie, which NSMovie handles for free. So I am going to use NSMovie to load it, the get the pointer and startMovie (or whatever the function is called). However, it's 0054hr here, and I have to catch the 0555 train to work tomorrow morning, so I'll have to report on my success later.

Visit http://www.theDailyGrind.net for your recommended daily intake of embittered satire.
Quote this message in a reply
Member
Posts: 469
Joined: 2002.10
Post: #4
included in CocoaBlitz is an NSMovie subclass CBMovie. CBMovies have 90% of the playback methods of NSMovieViews and allow you to load and play any quicktime-loadable soundfile with two lines of code. CBMovies have rate and playback head control, as well as native quicktime looping for continuous playback or backwards playback.

The subclass was created for use with CB for quicktime movies as OpenGL textures, but I've found that they work great for sound playback.

---Kelvin--
15.4" MacBook Pro revA
1.83GHz/2GB/250GB
Quote this message in a reply
Moderator
Posts: 608
Joined: 2002.04
Post: #5
FMOD can play any format known to man (and some not known...)
Quote this message in a reply
Luminary
Posts: 5,125
Joined: 2002.04
Post: #6
If you use FMOD to play MP3s you almost certainly have to pay the MP3 licensing fees. Of course, it can play Ogg/Vorbis just fine, so that may not be a problem..
Quote this message in a reply
Post Reply