#376: Resampling should be stateful
------------------------+---------------------------------------------------
Reporter: mrpingouin | Owner: admin
Type: Bugs | Status: new
Priority: 1 | Milestone: 1.0
Component: Liquidsoap | Version:
Keywords: | Mac: 1
Linux: 1 | Netbsd: 1
Other: 1 | Freebsd: 1
------------------------+---------------------------------------------------
A close look at our resampled audio probably shows some glitches, because
we create a new resampling object for each chunk:
{{{
Index: src/audio_converters/libsamplerate_converter.ml
===================================================================
--- src/audio_converters/libsamplerate_converter.ml (revision 7444)
+++ src/audio_converters/libsamplerate_converter.ml (working copy)
@@ -56,6 +56,9 @@
let samplerate_converter () =
let quality = quality_of_string quality_conf#get in
let converter = Samplerate.create quality 1 in
+ (* TODO seems to me that this code neglects the fact that
libsamplerate's
+ * resampler has a state, missing the whole point of using a good
resampler *)
let convert ratio b ofs len =
Samplerate.process_alloc converter ratio b ofs len
in
}}}
There is also a similar problem in Rutils (see comment at the end of the
file).
I'd suggest to change not only liquidsoap modules but also the ocaml-
resample API: libsamplerate has a type called state which became "type t"
in OCaml... that probably participated in the confusion.
By the way, libsamplerate and ocaml-samplerate have a simpler stateless
API (http://www.mega-nerd.com/SRC/api.html), which we might as well use if
we don't want to deal with states.
--
Ticket URL: <http://savonet.rastageeks.org/ticket/376>
Savonet <http://savonet.rastageeks.org/>
Let's program our stream !
------------------------------------------------------------------------------
This SF.net email is sponsored by
Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev
_______________________________________________
Savonet-trac mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-trac