Hello I'm trying to get CMdaAudioPlayerUtility::SetRepeats() play repeatedly a wav or mp3 sample but there is a delay between the repeats, something like half a second... This is a short sample music, I need it to loop perfectly !
I also tried the callback method MapcPlayComplete from MMdaAudioPlayerCallback (when the play is done, I restart the sound) but I also have a gap between the end of the sound and the start of the new one...
Did anybody manage to loop correctly a sound ? Will I have to try CMdaAudioOutputStream or will the problem be the same ?
Thanks in advance.
Re: looping sounds with CMdaAudioPlayerUtility
2011-04-09, 21:26#2
I am getting the same problem as you are getting. The problem with CMdaAudioPlayerUtility is that it loads the file every time it loops the music track that you want to play. That is why you have this noticeable long delay. The bigger the music file is the longer the delay is. I have got music to loop properly by using the SoundMixer example that Nokia created in the sample code section. However the looping works only for sounds that is 30 seconds in duration. Any music files longer than 30 seconds will get cut off down to about 10 seconds or less and they repeat based on these cut down versions.
Re: looping sounds with CMdaAudioPlayerUtility
2011-04-09, 22:34#3
It is not sure that Yubaba will answer after ~6 years, but the stream-based solution should be fine. SoundMixer example may have some internal limitations in order to keep it simple, generally CMdaAudioOutputStream plays whatever you feed into it. Any necessary repeats are handled in your code, via simply transferring the complete audio data again and again. So there are no mystical limits and caps about lengths on the API side.