1

This is my requirement. I have set of audio files(mp3, wav mostly). My app's interface will have a list of these sound names and a toggle ON/OFF switch for each of the sound item. On switching a sound ON it should start playing and vice versa. If more than one sound is ON then they should be played simultaneously. I can switch any sound ON/OFF while the sound is playing and it should switch off instantly.

What classes are best suggested for this behavior ? Do I need to mix the sounds etc or just instantiate multiple AVAudioPlayer instances ???

Please guide me in making an efficient app.

Thanks!

mohkhan
  • 11,925
  • 2
  • 24
  • 27
  • AVAudioPlayer is your best bet. You'll have to create multiple instances if you wanna play it simultaneously. – Anil Jan 11 '13 at 06:18

2 Answers2

2

Use different instance of AVAudioPlayer for playing simultaneously.

Now maintain list of AVAudioPlayer instance into NSMutableArray depending on state ON/OFF. if state ON then play audio add AVAudioPlayer instance in array and if state OFF then stop audio remove AVAudioPlayer instance from array.

Paresh Navadiya
  • 38,095
  • 11
  • 81
  • 132
0

You can user openAL to do your task. Here is the link to get it https://github.com/kstenerud/ObjectAL-for-iPhone .

Mihir Das
  • 458
  • 4
  • 13