2012/1/21 Frédéric <[email protected]>:
> Hi,

Hi Fred!

> I'm trying to use SOX inside my script.
> I've tried this without success:
>
> ------------
> def soundshape () =
>     add_decoder (name = "my_sox", "sox - - delay 0.005 0.001")
> end
>
> s = soundshape (s)
> ------------
>
> Regarding to sox documentation, ' sox - - ' is supposed to collect
> signal from stdin and out to stdout which would correspond tothe way
> add_decoder works...
>
> Any idea on what's going wrong?

What do you want to do with SOX exactly?

add_decoder is used to register file decoders. So I guess, you want to
play WAV files with a delay of 0.005?

In any case, you also need to tell liquidsoap when the decoder should
be used and how many audio tracks should liquidsoap expects. This is
this argument of the add_decoder function:
  * test : (string)->int (default: None)
    Function used to determine if the file should be decoded by the
decoder. Returned values are: 0: no decodable audio, -1: decodable
audio but number of audio channels unknown, x: fixed number of
decodable audio channels.

Here, you want to decode WAV files so you'd have to have a function
which detects WAV files and return the number of channels. I guess sox
may be able to do it. In the very least case, it should be quite easy
to write such a program.

One example of such decoder is the external flac decoder:
  
http://code.sourcefabric.org/browse/liquidsoap/liquidsoap/scripts/externals.liq?hb=true#to60

Let me write a bit more about other external decoding options.

You also have add_oblivious_decoder. This also registers a file
decoder but, in this case, the decoding programs receives the file URI
instead of reading from its standard input. This is often easier to
write but the downside is that in this case, liquidsoap may have wrong
expectations for the file duration, which may lead to weird
transitions if you use crossfades and/or switch/fallback transitions.

One example of such decoder is the external mpc decoder:
  
http://code.sourcefabric.org/browse/liquidsoap/liquidsoap/scripts/externals.liq?hb=true#to8

Finally, you also have input.external. With this operator, you can
register a live source, much like input.http and input.harbor, which
gets its data from a running process.

An example of such source is input.mplayer:
  
http://code.sourcefabric.org/browse/liquidsoap/liquidsoap/scripts/externals.liq?hb=true#to259

Romain

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to