I am using SDL_Mixer to implement music in my project and one of the
requirements is the ability to pause a main tune, play another tune for
a while and then resume the original tune at the position it was left
off. Since there is no equivalent version of MIX_SetMusicPosition
(MIX_GetMusicPosition ?) I tried implementing my own version by keeping
track of playing time (taking into account pauses in music caused by
MIX_PauseMusic and MIX_ResumeMusic.
For some reason, the the time interval measured doesn’t always seem to
correspond to the position when set by MIX_SetMusicPosition and I was
unable to establish a pattern. The music is in OGG format so the
positioning should be occurring properly, that is, relative to the start
of the tune.
Has anyone experienced problems in this regard and perhaps knows of a
solution?
Regards,
Colin
P.S. I’d really like to see a MIX_GetMusicPosition function in SDL_Mixer!
“Music position” can be difficult to define. For example, what’s the position
of a MOD music file that has a 7-second lead-in, then a loop that lasts for 33
seconds, and is currently 12 seconds into the fifth playthrough of the loop?________________________________
From: occhiluppo@gmail.com (Oli)
To: “sdl at lists.libsdl.org”
Sent: Thu, June 2, 2011 5:21:19 AM
Subject: Re: [SDL] SDL_MIXER: how to get music position?
Hi Colin
Forgive me for bothering you.
I have found your question posted in the SDL_Mixer forum
17On Fri, Jun 3, 2011 at 3:46 PM, Mason Wheeler wrote:
“Music position” can be difficult to define. For example, what’s the
position of a MOD music file that has a 7-second lead-in, then a loop that
lasts for 33 seconds, and is currently 12 seconds into the fifth playthrough
of the loop?
From: Oli To: “sdl at lists.libsdl.org” Sent: Thu, June 2, 2011 5:21:19 AM Subject: Re: [SDL] SDL_MIXER: how to get music position?
Hi Colin
Forgive me for bothering you.
I have found your question posted in the SDL_Mixer forum
The number of milliseconds ellapsed since the beginning of playback?> ----- Original Message -----
From: Mason Wheeler [mailto:masonwheeler@yahoo.com]
Sent: Friday, June 3, 2011 04:46 PM
To: 'SDL Development List’
Subject: Re: [SDL] SDL_MIXER: how to get music position?
“Music position” can be difficult to define. For example, what’s the position of a MOD music file that has a 7-second lead-in, then a loop that lasts for 33 seconds, and is currently 12 seconds into the fifth playthrough of the loop?
From: occhiluppo@gmail.com (Oli)
To: “sdl at lists.libsdl.org”
Sent: Thu, June 2, 2011 5:21:19 AM
Subject: Re: [SDL] SDL_MIXER: how to get music position?
Hi Colin
Forgive me for bothering you.
I have found your question posted in the SDL_Mixer forum
I was just joking, Mason raises a good point. ;DOn Fri, Jun 3, 2011 at 3:50 PM, Patrick Baggett <@Patrick_Baggett>wrote:
17
On Fri, Jun 3, 2011 at 3:46 PM, Mason Wheeler wrote:
“Music position” can be difficult to define. For example, what’s the
position of a MOD music file that has a 7-second lead-in, then a loop that
lasts for 33 seconds, and is currently 12 seconds into the fifth playthrough
of the loop?
From: Oli To: “sdl at lists.libsdl.org” Sent: Thu, June 2, 2011 5:21:19 AM Subject: Re: [SDL] SDL_MIXER: how to get music position?
Hi Colin
Forgive me for bothering you.
I have found your question posted in the SDL_Mixer forum