sajwan
sajwan

Reputation: 333

How to play 2 sounds simultaneously

I have to play 2 sounds in my app...one for background and one for when user clicks any button.....Not i have only one sound for background and too many sounds for that button click.....all sounds are in mp3 format....

I am using AVAudioPlayer to play these sounds...

My questions are

1- Can i play these 2 mp3 sounds at same time Or should i convert that background sound to any other format....

2- I am using AVAudioPlayer to play these sounds.....so can i use 2 instances of AVAudioPlayer in same class......

Please Note that i want that background music continuously playing.....

Please help....

Upvotes: 0

Views: 8417

Answers (2)

Jhaliya - Praveen Sharma
Jhaliya - Praveen Sharma

Reputation: 31730

Have a look to below look, will helpful for you.

2 mp3 sounds at the same time in iphone?

and blog tutorial

http://brainwashinc.wordpress.com/2009/08/14/iphone-playing-2-sounds-at-once/

Upvotes: 3

Vanya
Vanya

Reputation: 5005

1., Yes, you can even more..

2., Yes you can use AVAudioPlayer to play these, each sound source have to be allocated separately.

If you have short sounds that does not need to be stereo, you can use system sound framework to make them play.

Upvotes: 5

Related Questions