From c1eeb775819a9f3805f4df580d0c6bd1398fed4e Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Wed, 20 Apr 2011 01:28:10 +0200 Subject: [PATCH] audiod: Document new regular expression syntax. This changes the man page and the manual. The usage of regular expressions for receiver, filter and writers are explained and some examples are provided. --- ggo/audiod.m4 | 35 ++++++++++++++++++++++++----------- web/manual.m4 | 23 +++++++++++++++++------ 2 files changed, 41 insertions(+), 17 deletions(-) diff --git a/ggo/audiod.m4 b/ggo/audiod.m4 index 1b500854..628188d5 100644 --- a/ggo/audiod.m4 +++ b/ggo/audiod.m4 @@ -120,16 +120,26 @@ default="http" optional multiple details=" - This option may be given multiple times, once for each - supported audio format. The \"receiver_spec\" consists of - an audio format and the receiver name, separated by a colon, - and any options for that receiver, seperated by whitespace. - If any receiver options are present, the whole receiver - argument must be quoted. + This option may be given multiple times, for each audio format + separately. If multiple definitions for an audio format are + given, the first one is selected. + + The \"receiver_spec\" consists of an audio format specifier + and one or more receiver arguments, separated by a colon. - Example: + The audio format specifier is a regular expression which + specifies the set of audio formats for which this option + should apply. + + If any receiver options are present, the whole receiver + argument must be quoted: -r 'mp3:http -i my.host.org -p 8009' + + Since a single dot '.' matches the name of any audio format, + specifying '.' instead of 'mp3' above activates the http + receiver for all audio formats. + " option "no_default_filters" D @@ -164,14 +174,17 @@ multiple dependon="no_default_filters" details=" This option may be given multiple times. The \"filter_spec\" - consists of an audio format, the name of the filter, and any - options for that filter. Note that order matters. + consists of an audio format specifier (see above), the name + of the filter, and any options for that filter. Note that + order matters. Examples: --filter 'mp3:mp3dec' - --filter 'mp3:compress --inertia 5 --damp 2' + --filter 'mp3|aac:compress --inertia 5 --damp 2' + + --filter '.:fecdec' " @@ -186,7 +199,7 @@ details=" audio format. Default value is \"alsa\" for all supported audio formats. Example: - --writer 'aac:osx' + --writer 'aac|wma:oss' " diff --git a/web/manual.m4 b/web/manual.m4 index 46a2cd62..2af59f53 100644 --- a/web/manual.m4 +++ b/web/manual.m4 @@ -415,9 +415,9 @@ as bar@client_host We will also have to tell para_audiod that it should receive the -audio stream from server_host: +audio stream from server_host via http: - para_audiod -l info -r 'mp3:http -i server_host' + para_audiod -l info -r '.:http -i server_host' You should now be able to listen to the audio stream once para_server starts streaming. To activate streaming, execute @@ -1431,8 +1431,7 @@ from being interpreted by para_recv. -> Create a minimal config for para_audiod for HTTP streams: c=$HOME/.paraslash/audiod.conf.min; s=server.foo.com - formats="mp3 ogg aac wma" # remove what you do not have - for f in $formats; do echo receiver \"$f:http -i $s\"; done > $c + echo receiver \".:http -i $s\" > $c para_audiod --config $c ------- @@ -1470,11 +1469,23 @@ the driving application (para_audiod or para_filter). Example: para_filter -f 'mp3dec --ignore-crc' -f 'compress --damp 1' For para_audiod, each audio format has its own set of filters. The -name of the audio format for which the filter should be applied is -used as the prefix for the filter option. Example: +name of the audio format for which the filter should be applied can +be used as the prefix for the filter option. Example: para_audiod -f 'mp3:prebuffer --duration 300' +The "mp3" prefix above is actually interpreted as a POSIX extended +regular expression. Therefore + + para_audiod -f '.:prebuffer --duration 300' + +activates the prebuffer filter for all supported audio formats (because +"." matches all audio formats) while + + para_audiod -f 'wma|ogg:prebuffer --duration 300' + +activates it only for wma and ogg streams. + Decoders ~~~~~~~~ -- 2.39.5