SoundManager icon indicating copy to clipboard operation
SoundManager copied to clipboard

There's a gap when playing a music with the loop option activated

Open MartinMoizard opened this issue 11 years ago • 5 comments

Hi,

I want to play a theme music on my iOS game using the following : [[SoundManager sharedManager] playMusic:kThemeSound looping:YES];

It is working well except that there is a gap (a small silence) when the sound is looping. I tried the sound in iTunes, there is no gap when looping.

Is there a way to fix this ?

Thanks, Martin

MartinMoizard avatar Mar 05 '13 10:03 MartinMoizard

This may be due to the music format. I think mp3 has this problem. Try changing the format using the command line converter mentioned in the README. Unless you've already done that.

nicklockwood avatar Mar 05 '13 11:03 nicklockwood

I've already done that, I tried many format and nothing changes. Are you able to play music in loop without gaps?

MartinMoizard avatar Mar 05 '13 11:03 MartinMoizard

Hmm. I don't have a suitable sample to test with, but according to this StackOverflow, it's not possible to do gapless playback using AVAudioPlayer (which is the underlying mechanism used by SoundManager).

http://stackoverflow.com/questions/9188407/avaudioplayer-audioplayerdidfinishplayingsuccessfully-not-called

nicklockwood avatar Mar 05 '13 13:03 nicklockwood

I don't see anything related to gapless playback on this thread...

On Tue, Mar 5, 2013 at 2:06 PM, Nick Lockwood [email protected]:

Hmm. I don't have a suitable sample to test with, but according to this StackOverflow, it's not possible to do gapless playback using AVAudioPlayer (which is the underlying mechanism used by SoundManager).

http://stackoverflow.com/questions/9188407/avaudioplayer-audioplayerdidfinishplayingsuccessfully-not-called

— Reply to this email directly or view it on GitHubhttps://github.com/nicklockwood/SoundManager/issues/2#issuecomment-14438889 .

Martin Moizard Mail: [email protected]

MartinMoizard avatar Mar 05 '13 14:03 MartinMoizard

Sorry, that's not the link I thought it was. Here's an article explaining the problem. It also contains a link to a library that supports gapless playback (I've not used it, but it sounds like it will solve your problem):

http://gamua.com/blog/2012/05/gapless-mp3-audio-on-ios/

Kind Regards,

Nick

On 5 Mar 2013, at 02:43 PM, Martin Moizard [email protected] wrote:

I don't see anything related to gapless playback on this thread...

On Tue, Mar 5, 2013 at 2:06 PM, Nick Lockwood [email protected]:

Hmm. I don't have a suitable sample to test with, but according to this StackOverflow, it's not possible to do gapless playback using AVAudioPlayer (which is the underlying mechanism used by SoundManager).

http://stackoverflow.com/questions/9188407/avaudioplayer-audioplayerdidfinishplayingsuccessfully-not-called

— Reply to this email directly or view it on GitHubhttps://github.com/nicklockwood/SoundManager/issues/2#issuecomment-14438889 .

Martin Moizard Mail: [email protected] — Reply to this email directly or view it on GitHub.

nicklockwood avatar Mar 05 '13 15:03 nicklockwood