I'm getting lost in this thread , so maybe what I say was already said,
but :
How about prepending some "dummy" data to the input ( zero value samples
),
note its length and then encode it together with the normal input.
When decoding , just discard the noted length of samples ( + plus the
ones added by the decoder delay ) from the decoded data and start
playing
at the "right" spot ?
Because you are not cutting mp3 data , but normal samples , there should
be no added distortions. I think ... :-)
And also note the total length of original input , to be able to
stop playing at the correct position too ?
Some pseudo code :
cat zero.raw music.raw | lame - > music.mp3
# length of zero.raw is for example 1000 samples
for decoding :
- YAMP3DECODER music.mp3 > decoded.raw
- remove the first 1000+x+y samples from decoded.raw
1000 - out dummy data
x - extra data added by encoder ( delay and stuff )
y - extra data added by decoder ( -- ""-- )
- remove samples from the end of decoded.raw , until
length_of(decoded.raw) == length_of(music.raw)
This would require changes in the encoder , decoder , and an extra bit
of info
in the mp3 file about the length if added data.
David Balazic
David Balazic
--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )