Hi, Rightnow i am trying to make one mp3 player for Compaq ipaq. For graphics, i am using Embedded Qt. I am using madplayer as mp3 engine.
I have some issues in the slider scrolling support( In GUI, i want to provide one slider to jump to any part of the playing song like winamp ...).
In libmad, when the song is playing, how can i jump to different differnt location and start to play from that location?. I find it, there is no direct easy interface to do this. If you can give some suggestion to me, it will be very help full.
thanks in advance.
with regards, sadeesh.
Sadeesh Kumar wrote:
In libmad, when the song is playing, how can i jump to different differnt location and start to play from that location?. I find it, there is no direct easy interface to do this.
To jump to a new location using the low-level API:
1. Seek to an approximate location in the file and load your buffer with data from the new position.
2. Call mad_stream_buffer() to update the stream pointers for the modified buffer.
3. Call mad_frame_mute() and mad_synth_mute().
At this point you can simply resume decoding. However, to avoid any unpleasant burps in the audio, unless you have seeked to the very beginning of the file, it is best to:
4. Call mad_frame_decode() successfully at least twice. Note that the first few calls will probably yield recoverable decoding errors which you can safely ignore.
5. Call mad_synth_frame() once and discard the resulting PCM.
The MAD plug-in for Winamp does all of this if you're looking for an example.
Cheers, -rob
thanks for your immediate reply. I will try as per your suggestion.
The MAD plug-in for Winamp does all of this if you're looking for an
example.
Sorry to ask this question. I tried to get the source of this Winamp which uses MAD. But i couldn't. If you can tell me the site, it will be very helpful.
thanks & regards, sadeesh
Sadeesh Kumar wrote:
Sorry to ask this question. I tried to get the source of this Winamp which uses MAD. But i couldn't. If you can tell me the site, it will be very helpful.
The code is included in the MAD distribution itself, inside the winamp directory (winamp/in_mad.c).
for real-time purposes: how can i assure that the whole seek + the mad_frame_synth and all that - will take less than 5-10 milisecs ?
i want to use Arm SA1110 206 mhz cpu, with linux 2.4.6 kernel.
-----Original Message----- From: mad-dev-admin@lists.mars.org [mailto:mad-dev-admin@lists.mars.org]On Behalf Of Rob Leslie Sent: Wednesday, August 22, 2001 3:51 AM To: mad-dev@lists.mars.org Subject: Re: [mad-dev] MAD( Regarding the dynamic jumping to songs different location )
Sadeesh Kumar wrote:
Sorry to ask this question. I tried to get the source of this Winamp which uses MAD. But i couldn't. If you can tell me the site, it
will be very
helpful.
The code is included in the MAD distribution itself, inside the winamp directory (winamp/in_mad.c).
-- Rob Leslie rob@mars.org
Gad Hayisraeli wrote:
for real-time purposes: how can i assure that the whole seek + the mad_frame_synth and all that - will take less than 5-10 milisecs ?
That's up to you. :-)
I can't tell you how much time you will need, as much depends on your available CPU, process scheduling, I/O, etc.
Have you taken any measurements of your current performance?
I can't tell you how much time you will need, as much depends on your available CPU, process scheduling, I/O, etc.
i have the whole cpu time only for this mission.
Have you taken any measurements of your current performance?
yes. i've done what you suggested, but the frame mute+synth+the skip takes about 20-50 ms.
On Thu, 23 Aug 2001, Gad Hayisraeli wrote:
I can't tell you how much time you will need, as much depends on your available CPU, process scheduling, I/O, etc.
i have the whole cpu time only for this mission.
Have you taken any measurements of your current performance?
yes. i've done what you suggested, but the frame mute+synth+the skip takes about 20-50 ms.
It's your duty to buffer data before actually skipping to the new position. This will take out the skip time. That's a real time programing, not a decoding issue.
Nicolas
but my problem is that i cannot preapre for the skip, because it happens just when i receive external signal, and right in this timepoint i have to do all the skipping+synth+decoding work. i saw a patch for a real-time linux kernel. will it help ? does someone is going to do a propessional skipping code for the MAD ?
Gad
-----Original Message----- From: mad-dev-admin@lists.mars.org [mailto:mad-dev-admin@lists.mars.org]On Behalf Of Nicolas Pitre Sent: Thursday, August 23, 2001 10:27 PM To: Gad Hayisraeli Cc: Rob Leslie; mad-dev@lists.mars.org Subject: RE: [mad-dev] MAD( Regarding the dynamic jumping to songs differentlocation )
On Thu, 23 Aug 2001, Gad Hayisraeli wrote:
I can't tell you how much time you will need, as much depends on your available CPU, process scheduling, I/O, etc.
i have the whole cpu time only for this mission.
Have you taken any measurements of your current performance?
yes. i've done what you suggested, but the frame mute+synth+the
skip takes
about 20-50 ms.
It's your duty to buffer data before actually skipping to the new position. This will take out the skip time. That's a real time programing, not a decoding issue.
Nicolas
Gad Hayisraeli wrote:
but my problem is that i cannot preapre for the skip, because it happens just when i receive external signal, and right in this timepoint i have to do all the skipping+synth+decoding work.
Can you buffer the entire audio file in memory?
does someone is going to do a propessional skipping code for the MAD ?
I'm not sure at all what you're asking here, but Nicolas is right, what you're really facing is a real-time programming problem, not a decoding problem specific to MAD.
Gad Hayisraeli wrote:
but my problem is that i cannot preapre for the skip, because it happens just when i receive external signal, and right in this
timepoint i have to
do all the skipping+synth+decoding work.
Can you buffer the entire audio file in memory?
Yes. i'll try do do so.
does someone is going to do a propessional skipping code for the MAD ?
I'm not sure at all what you're asking here, but Nicolas is right, what you're really facing is a real-time programming problem, not a decoding problem specific to MAD.
Yes, Youre right. thanks anyway
-- Rob Leslie rob@mars.org