[mythtv] [PATCH] time stretch with libsoundtouch

Mark Spieth mark at dclabs.com.au
Sun Oct 31 23:44:46 UTC 2004


thanks for your input jeremiah.
I should have argued the case a bit more with Ed.
libsamplerate only does samplerate conversion with appropriate antialiasing
filters.
while libsoundtouch also has this functionality, it has further
functionality. the author calls it tempo adjustment.
it uses an algorithm called WSOLA (there are good descriptions/papers of
this online). use audio time stretching as search terms.
this algorithm is very unlike samplerate conversion. all that Ed said was to
convert up and then convert back again. this wont do anything except filter
the audio with said antialiasing filters.
In a nutshell what WSOLA does is to take a frame of audio and an overlap
window and find the best correlation match within this overlap window and
essentially removes or creates new samples to repeat samples at the best
periodic match, depending on whether samples are to be "thinned" or
"padded".
note the sample rate does not change. the pitch of the audio does not
change. the audio just plays quicker or slower due to the intelligent
removal or addition of samples.
windvd has this feature but only for mpegs and I have found it very nice to
have. thus I have implemented it.
I have turned off any sample rate conversion as this is/will be done by
libsamplerate.
I have not circumvented libsamplerate in any way (at least I dont think I
have).
the feedback is appreciated but I believe I have good reasons for tackling
it the way I have.
cheers
mark

> On 31 Oct 2004, at 7:19 AM, Mark Spieth wrote:
>
> > this is the first release of audio timestretching using libsoundtouch.
>
> You're not likely to win any friends with this, Mark, for two reasons:
>
> 1) Your proposal for using libsoundtouch was already rejected.  You
> were told how the already-in-CVS libsamplerate could do the job, and
> you ignored that.  If you have a compelling argument for why
> libsamplerate fundamentally won't work, or you can't see how to get it
> to do what you need, ask questions instead of submitting code built on
> a rejected premise.  (See the recent discussion of TagLib vs. libid3tag
> to see how dependencies usually fare in Myth, and how to listen to
> direction from the lead developers.)
>
> 2) It's not nice to release a major audio patch when a major audio
> patch is already under testing and consideration for CVS.  Your patches
> won't apply for anyone that cares about developing Myth audio, since
> they are already working with the other patch and not CVS.  It's much
> more polite to wait until things are quieter: folks have more time to
> look at your patch, and it wouldn't be immediately obsolete.
>
> You'll find a more receptive audience for your patches in the future if
> you keep these points in mind.
>
> But, it takes both etiquette and code to add features to Myth, and I
> can help with the latter.  The replacement files in the attached
> archive add your SetStretchFactor() method to AudioOutputBase, using
> libsamplerate instead of SoundTouch.  This is based on Ed's patch under
> consideration, so you'll have to apply that patch or wait for the CVS
> update.
>
> It may not sound quite as good as the SoundTouch version, as
> libsamplerate doesn't do the pitch adjustment that SoundTouch would,
> but from my experience you've got zero chance at getting a SoundTouch
> dependency added for such a niche feature.  Myth development is very
> much a team effort, and the art of compromise will help you greatly.
>
> This should give you a starting point for another try at this
> functionality.  I'd recommend that you wait until the volume control
> patches are settled and checked in, integrate your previous work with
> CVS and libsamplerate, and then post again.  At that point, you'll have
> a much better chance of having your patch examined and its merits
> discussed.
>
> - Jeremiah
>
>


----------------------------------------------------------------------------
----


_______________________________________________
mythtv-dev mailing list
mythtv-dev at mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev



More information about the mythtv-dev mailing list