Discussion Forums  >  Uncategorized

Replies: 3    Views: 265

andydahl
Aspiring developer
Profile
Posts: 209
Reg: Jul 20, 2011
Villa Grove
4,540
09/23/11 10:58 AM (14 years ago)

Sound Effects not working on menu items (iOS)

Can't seem to get the sound effects to work on my latest app. Dragging .mp3s into xCode. The play in preview (within xCode), but won't play in the simulator. Any ideas? Are there any best practices for using audio?
 
ianJamesPiano
Code is Art
Profile
Posts: 2661
Reg: Feb 13, 2011
Palm Springs, C...
37,010
like
09/23/11 02:28 PM (14 years ago)
To use your own sounds... look at the App Delegate.m file and see where all the sound effects are initialized. I think the method is initSoundEffets() This runs when the app first loads so all the sound-effect files are prepared and ready to play before anything else loads. It does take a moment to load this way but makes for better performance. Nothing lamer than a delayed sound effect. So...add your own sound files to BT_audio folder, then add them to this list so they initialize when the app launches. Cool.
 
andydahl
Aspiring developer
Profile
Posts: 209
Reg: Jul 20, 2011
Villa Grove
4,540
like
09/23/11 02:52 PM (14 years ago)
Thanks (again) for you help! Got it!
 
ianJamesPiano
Code is Art
Profile
Posts: 2661
Reg: Feb 13, 2011
Palm Springs, C...
37,010
like
09/23/11 02:53 PM (14 years ago)
Sweet!
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.