Hi,
i have updated our production system with using the %wav parameter with
duration=3600.0 .
When I checked recorded WAV files , I found out that duration is 40 or 80
milliseconds longer than expected:
qwavheaderdump *.wav
2011-08-21-00_00_00.wav (635054156 bytes):
riff: 'RIFF'
riff length: 635040036
riff length field should be 635054148
wave: 'WAVE'
fmt: 'fmt '
fmt length: 16
format: 1
channels: 2
sample rate: 44100
bytes/second: 176400
bytes/sample: 4
bits/sample: 16
data: 'data'
data length: 635040000
data length field should be 635054112
635054156 2011-08-21 01:00 2011-08-21-00_00_00.wav 80 ms
635054156 2011-08-21 02:00 2011-08-21-01_00_00.wav 80 ms
635054156 2011-08-21 03:00 2011-08-21-02_00_00.wav 80 ms
635054156 2011-08-21 04:00 2011-08-21-03_00_00.wav 80 ms
635054156 2011-08-21 05:00 2011-08-21-04_00_00.wav 80 ms
635047100 2011-08-21 06:00 2011-08-21-05_00_00.wav 40 ms
635054156 2011-08-21 07:00 2011-08-21-06_00_00.wav 80 ms
635054156 2011-08-21 08:00 2011-08-21-07_00_00.wav 80 ms
635054156 2011-08-21 09:00 2011-08-21-08_00_00.wav 80 ms
635054156 2011-08-21 10:00 2011-08-21-09_00_00.wav 80 ms
635047100 2011-08-21 11:00 2011-08-21-10_00_00.wav 40 ms
635054156 2011-08-21 12:00 2011-08-21-11_00_00.wav 80 ms
635054156 2011-08-21 13:00 2011-08-21-12_00_00.wav 80 ms
A local test at home using ALSA input shows 40ms missing:
liquidsoap 'output.file( %wav(stereo=true,duration=3600.), "./test_%H:%M.wav",
reopen_when={0m0s}, mksafe(alsa.input()) )'
qwavheaderdump test_14:00.wav
test_14:00.wav (635032988 bytes):
riff: 'RIFF'
riff length: 635040036
riff length field should be 635032980
wave: 'WAVE'
fmt: 'fmt '
fmt length: 16
format: 1
channels: 2
sample rate: 44100
bytes/second: 176400
bytes/sample: 4
bits/sample: 16
data: 'data'
data length: 635040000
data length field should be 635032944
if I use a source like noise() file length was tested to be correct.
At production system we use
- ALSA input source,
- some fallbacks,
- limit() and
- output.file, output.icecast and output.harbor.
Liquidsoap 1.0.0-beta3+svn (default@83addd3ddbae:20110820:100002)
our setup:
#input
radio= mksafe(input.alsa(device="pcm.liq_test"))
#define ALSA fallback
fallback_mix = mksafe(single("fallback.mp3"))
fallback_alsa = smooth_add(
normal=fallback_mix,
special=switch([
( { 0s }, mksafe(single("say:Alsa failed!")) )
])
)
#apply ALSA fallback
radio = fallback(
track_sensitive=false,
[
radio,
fallback_alsa
]
)
#silence detection
radio= fallback(
track_sensitive=false,
[
fail(),
strip_blank( length=180. , radio ) ,
mksafe(single("silence.mp3"))
]
)
#audio processing
radio=limit(radio)
#record to archive
output.file(
%wav(stereo=true, duration=3600.0),
"/mnt/archive/%Y-%m-%d/%Y-%m-%d-%H_%M_%S.wav",
reopen_when={0m0s},
mksafe(radio)
)
#icecast output
output.icecast(
%vorbis.cbr(samplerate=44100, channels=2, bitrate=160),
host="xxx", port=xxx, user="xxx", password="xxx", mount="/xxx"
description="piradio",
restart=true,
radio
)
#audio stream output
output.harbor(
mount="/xxx", protocol="http",
port=xxx, format="audio/ogg",
%vorbis.cbr(samplerate=44100, channels=2, bitrate=160),
radio
)
BR, Peter
Am 06.08.2011 00:34, schrieb Peter Retep:
> Hi,
>
> next 4 hours were encoded exactly, too!
> Excellent!
>
> BR, Peter
>
>
> Am 05.08.2011 17:35, schrieb Peter Retep:
>> Thank you!
>>
>> liquidsoap 'output.file( %wav(stereo=true,duration=3600.),
>> "./test_%H:%M.wav", reopen_when={0m0s}, mksafe(noise()) )'
>>
>> test started, it will take some hours, due to small frequencies do not work
>> safely with reopen_when.
>> I let you know about results at the earliest.
>>
>> BR, Peter
>>
>> Am 05.08.2011 17:13, schrieb Romain Beauxis:
>>> 2011/8/5 Peter Retep<[email protected]>:
>>>> Hi,
>>> Hi!
>>>
>>>> I have just found some time for retesting...
>>>>
>>>> 1)
>>>> When trying to apply the length parameter (is it called duration?), I
>>>> failed.
>>>> Could you please give me a hint how to set this parameter?
>>>>
>>>>
>>>> liquidsoap -h WAV
>>>> *** One entry in audio file formats (duration):
>>>> (no doc)
>>>> *** One entry in file decoding:
>>>> Decode as WAV any file with a correct header.
>>>> *** One entry in stream decoding:
>>>> Decode a WAV stream with an appropriate MIME type.
>>>> *** One entry in stream encoding formats:
>>>> (no doc)
>>>>
>>>> liquidsoap 'output.file( %wav(stereo=true,duration=60s), "./test_%M.wav",
>>>> reopen_when={0s-59s}, mksafe(noise()) )'
>>>> Error in encoding format at line 1, char 40-42:
>>>> complex expressions are forbidden in encoding formats.
>>>>
>>>> liquidsoap 'output.file( %wav(stereo=true,duration=60), "./test_%M.wav",
>>>> reopen_when={0s-59s}, mksafe(noise()) )'
>>>> Error in encoding format at line 1, char 40-41:
>>>> unknown parameter name or invalid parameter value.
>>>>
>>>> liquidsoap 'output.file( %wav(stereo=true,duration="60"), "./test_%M.wav",
>>>> reopen_when={0s-59s}, mksafe(noise()) )'
>>>> Error in encoding format at line 1, char 40-43:
>>>> unknown parameter name or invalid parameter value.
>>>>
>>>> liquidsoap 'output.file( %wav(stereo=true,duration="60s"), "./test_%M.wav",
>>>> reopen_when={0s-59s}, mksafe(noise()) )'
>>>> Error in encoding format at line 1, char 40-44:
>>>> unknown parameter name or invalid parameter value.
>>>>
>>>> liquidsoap 'output.file( %wav(stereo=true), duration=60s, "./test_%M.wav",
>>>> reopen_when={0s-59s}, mksafe(noise()) )'
>>>> At line 1, char 42-44: cannot apply that parameter because the function
>>>> (at line 1, char 12) has no argument labeled "duration"!
>>> It should the only only variant you have not tested:
>>> %wav(stereo=true,duration=60.)
>>> Note the dot at the end.. The param is a floating number, representing
>>> seconds.. In liq a float is differentiated from an int by the presence
>>> of the dot, which must be present even if the value is actually an
>>> integer..
>>>
>>> Romain
>>>
>> ------------------------------------------------------------------------------
>> BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
>> The must-attend event for mobile developers. Connect with experts.
>> Get tools for creating Super Apps. See the latest technologies.
>> Sessions, hands-on labs, demos& much more. Register early& save!
>> http://p.sf.net/sfu/rim-blackberry-1
>> _______________________________________________
>> Savonet-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/savonet-users
>>
>
> ------------------------------------------------------------------------------
> BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
> The must-attend event for mobile developers. Connect with experts.
> Get tools for creating Super Apps. See the latest technologies.
> Sessions, hands-on labs, demos& much more. Register early& save!
> http://p.sf.net/sfu/rim-blackberry-1
> _______________________________________________
> Savonet-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/savonet-users
>
------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system,
user administration capabilities and model configuration. Take
the hassle out of deploying and managing Subversion and the
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users