nicklockwood / SoundManager

Simple sound and music player class for playing audio on Mac and iPhone
http://www.charcoaldesign.co.uk/source/cocoa#soundmanager
Other
630 stars 126 forks source link

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

Open MartinMoizard opened 11 years ago

MartinMoizard commented 11 years ago

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

nicklockwood commented 11 years ago

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.

MartinMoizard commented 11 years ago

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

nicklockwood commented 11 years ago

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

MartinMoizard commented 11 years ago

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

On Tue, Mar 5, 2013 at 2:06 PM, Nick Lockwood notifications@github.comwrote:

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: martin.moizard@gmail.com

nicklockwood commented 11 years ago

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 notifications@github.com wrote:

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

On Tue, Mar 5, 2013 at 2:06 PM, Nick Lockwood notifications@github.comwrote:

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: martin.moizard@gmail.com — Reply to this email directly or view it on GitHub.