[Clam-devel] [PATCH] time seeking, work in progress

Roman Goj roman.goj at gmail.com
Tue Aug 14 11:50:26 PDT 2007


Hullo!

After getting time output from the AudioFileReaders, I've been working
on implementing seeking within a file... but this turned out to be much,
much harder... lots of digging through code, false leeds, and generally
fun :-)

Good news is, the prototype is here (not committed, working, but not
fully tested yet), without further ado:

What works:
* MonoAudioFileReader has an in control port for setting starting time
position
* AudioCodecs_Stream now has two methods for seeking within file,
** one - SetFramesStart( unsigned framesStart ) for usage from within
the audio file readers
** the other - SeekToTime( unsigned framesStart ) is virtual and it
needs to be implemented for mpeg, ogg and pcm...
* ...and is implemented for ogg :-) (ogg's simplicity rules! Hernan, how
can I join in promoting play ogg? ;-) )
* for mpeg and pcm... a warning is implemented, saying "not
implemented",heh...

What doesn't work:
(don't get me started on what *doesn't* work ;-) )
* ...obviously mpeg and pcm don't work (pcm should be easy though,
mpeg... I'm not sure)
* no safeguard against setting time above the end of file! (for ogg, not
much of a problem, if the control shows a value outside the file, the
file reader just plays from the beggining of the file... not very nice
though)
* no changes made for MultiChannelAudioFileReader (mono was easier for
testing...)
* no player-like control - what you can set now is just the beggining
time, the time at which playing will start when you press 'play'... this
I consider not a bug... but rather "a feature"... :-) after all for
scientific usage this should be better, no? Anyway implementing a new
dynamic control espacially for this (like a dynamic xmms-like slider)
should be very easy...
* if you first set the slider to some value, play, then set the slider
to 0... it won't change to 0... this is for ensuring that at least the
first play will work regardless the changes I made... can be easily
changed now though...
* my names for the functions are ugly! probably require some rethinking...
* my memory, as I can't seem to remember anything else that doesn't
work... ;-)

cheers!
roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: timeSeekingForMonoAudioFileReader.patch
Type: text/x-diff
Size: 7333 bytes
Desc: not available
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20070814/cf8251a2/attachment-0004.patch>


More information about the clam-devel mailing list