2013/6/10 Bill Burton <[email protected]>:
> Hello,

Hi,

> I have a workflow where I take an MP3 voice recording and transcode it to
> two files, one a 32 Kbps MP3 suitable for posting on a web site and the
> other, an Ogg Vorbis file I use for broadcasting.
>
> In the process of transcoding the original file, I want to 1) preserve ID3
> tags, 2) Process for ReplayGain (by track) adding those tags.
>
> Based on an example in the LS Cookbook, I wrote the following:
>
> #!/usr/bin/liquidsoap
> # Transcode an audio track into two other formats.
>
> set("log.stdout", true)
> set("log.file", false)
> set("log.level", 3)
>
> # input file
> input = "test.mp3"
> # output files
> output_mp3 = "file.mp3"
> output_ogg = "file-q1.ogg"
>
> # A source that plays the the file once
> source = once(single(input))
>
> # Use a clock with disabled synchronization
> clock.assign_new(sync=false, [source])
>
> output.file(%mp3.cbr(samplerate=22050, mono=true, bitrate=32),
>             fallible=true, reopen_on_metadata=false, output_mp3,
>             source)
>
> output.file(%vorbis(quality=1, samplerate=44100, channels=1),
>             fallible=true, reopen_on_metadata=false, output_ogg,
>             on_stop=shutdown, source)
>
>
> It appears to copy the tags to the .ogg file successfully but not to the
> .mp3 file.  Is there anything I can do to get the metadata copied from the
> original mp3 file to the transcoded one?

Yes, you need to add id3v2=true to the %mp3 encoder parameters:

  output.file(%mp3.cbr(samplerate=22050, mono=true, bitrate=32, id3v2=true), ...

> Also, is there a way to perform ReplayGain tagging on these files?

Yes! Documentation is there:
  http://liquidsoap.fm/doc-svn/replay_gain.html

If you're lucky, all you have to do is add this at the beginning of your script:
  enable_replaygain_metadata()

And then wrap your source inside an amplify operator:
  s = amplify(1.,override="replay_gain",s)

> In addition, instead of hard coding the input file, I need to grab it from
> the command line but so far, haven't been able to figure out how to use
> system.argv.

You have argv(default="foo", 1) which returns argument number 1 with
default "foo" if not provided and you also have getopt which is a bit
more complex: getopt("-o") returns “1” if “-o” was passed without any
parameter, “0” otherwise. getopt(default="X","-o") returns “Y” if “-o
Y” was passed, “X” otherwise. The result is removed from the list of
arguments, affecting subsequent calls to argv() and getopt().

> Right now, I'm testing the script on Windows liquidsoap 1.1.1 but could move
> it to Ubuntu 12.04.

I'd recommend moving it to ubuntu for the replaygain part. Support for
replay gain needs external binaries and this is not guaranteed to work
smoothly under window..

Romain

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to