1

AudioServicesPlaySystemSound() is playing my sounds using ringer volume.

I want them to play according to system volume instead.

How to?

Lasse V. Karlsen
  • 380,855
  • 102
  • 628
  • 825

1 Answers1

1

You should use the AVFoundation Framework to play your sounds. Look into the AVAudioPlayer class.

Moshe
  • 57,511
  • 78
  • 272
  • 425
  • That consumes a lot of memory. No way. –  Dec 01 '10 at 20:30
  • @GSchv - Really? Apple recommended it at the WWDC10. Oh well, I tried. – Moshe Dec 01 '10 at 20:33
  • @Moshe - I play several sounds simultaneously. My game is very very popular. I'd need to create like 5 AVAudioPlayer objects, which would make my game lag. Any suggestions? –  Dec 01 '10 at 20:34
  • Create the sound player objects ahead of time (in your delegate perhaps) and pass them to the view when necessary? – Moshe Dec 01 '10 at 20:39
  • I was thinking Audio Queues. Do you know anything about Audio Queues? –  Dec 01 '10 at 20:41
  • @GSchv - Nope, sorry. I imagine the concept is similar though. If you find out about them, let me know. (starred) – Moshe Dec 01 '10 at 20:44
  • Use OpenAL. There's a nice example / useable sound engine here: http://www.71squared.com/2010/01/latest-sound-manager-class/ – Daniel G. Wilson Dec 02 '10 at 02:28