In my app I'm using AVAudioPlayer objects to hold the mp3 files. I have several occasions where I wish to lower the sound level of the files while they are being played.
I understand some of what I'm supposed to be doing, but I don't understand how I define the duration and how do I command that something will happen only for that duration.
I'm looking for something like this:
AVAudioPlayer * aud1 = [I have a method to get the file];
AVAudioPlayer * aud2 = [I have a method to get the file];
NSTimeInterval * aud1_ti = aud1.duration //I haven't tried this yet - is this the right way to get the mp3 play duration?
[aud1 play];
[aud2 play];
while (aud1_ti)
aud2.volume = 0.5;
aud2.volume = 1.0
To say it in words - I wish that while aud1 is playing, aud2 volume will be reduced in half; and once the file had reached its end the aud2 volume will get back to its full level. I couldn't understand from the documentation how to do that.
Can anyone assist?