|
|
| Welcome to the Mac Forums forums. Please read the FAQ if you have questions. Register to participate. |
|
|||||||
| TouchArcade.com - iPhone Game Reviews and News |
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#1 |
|
macrumors newbie
Join Date: Apr 2005
|
background music
what obj-c classes/libraries do I have to import and use to load/start/repeat../stop/unload background music in cocoa?
It's for a game. I'm just about to start searching developer.apple.com.. but sometimes that produces cryptic results. I appreciate any response. Thanks! |
|
|
|
|
|
#2 |
|
Thread Starter
macrumors newbie
Join Date: Apr 2005
|
hmm
okay, so this isn't the greatest programming forum. oh well, I figured it out.
|
|
|
|
|
|
#3 |
|
macrumors 68000
|
I'm guessing you used QTKit if you're on Tiger, but if not, at least give us the solution for the archives.
__________________
I bring order to chaos. You are in chaos Windows, you are the contradiction, a bug wishing to be an OS. Visit Softyards Software NEW DEFINITION OF GEEK Like politics, free speech, computers, entertainment, and more? Join us at Wordforge.net |
|
|
|
|
|
#4 |
|
Thread Starter
macrumors newbie
Join Date: Apr 2005
|
NSSound
Actually, it's much simpler than that. I don't need a GUI or any advanced control for my sound output, so I just consider each background music "song" as an NSSound. It has responder methods for detecting when the sound stops (in my case, for repetition purposes). However, for the time being I'm still not clear on volume control (ie, separate from system volume, to allow different controls for audio / music.
And no, I'm not on tiger yet .http://developer.apple.com/documenta...s/NSSound.html |
|
|
|
|
|
#5 |
|
macrumors 68040
|
It may sound like a roundabout way of doing it, but you could use NSMovieView to play sounds. (Create a URL pointing to the sound file, use that to init an NSMovie, then use setMovie: to set that movie in the view.) The movie view can be offscreen or hidden.
You can then use setVolume without chaninging the system volume.
__________________
Greenpeace Apple Mac <- Macintosh <- McIntosh apples <- John McIntosh <- McIntosh surname <- "Mac an toshach" <- "Son of the Chief" |
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|