paraslash Paraslash Audio Streaming
About   News   Download   Documentation   Development

para_filter

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
EXAMPLES
FILTERS
COPYRIGHT
NAME

para_filter - decode or process audio data from STDIN to STDOUT

SYNOPSIS

para_filter [--help] [--detailed-help] [--version] [--loglevel=<severity>] [--filter=<filter_spec>]

DESCRIPTION

This program transforms the audio stream read from STDIN by chaining one or more filters. A common mode of operation is to decode an mp3 file with the mp3dec filter, but many other filters exist which transform the audio stream in different ways.

OPTIONS

Common options
The following options are implemented generically and are available for many of the commands.
-h
, --help

print help and exit

--detailed-help

print help, including all details, and exit

-V, --version

print version and exit

-l, --loglevel=<severity>

control amount of logging

values: debug, info, notice, warning, error, crit, emerg

Log only messages with severity greater or equal than the given value. Possible values:

debug: Produces really noisy output. info: Still noisy, but won’t fill up the disk quickly. notice: Indicates normal, but significant event. warning: Unexpected events that can be handled. error: Unhandled error condition. crit: System might be unreliable. emerg: Last message before exit.

Options for para_filter
-f
, --filter=<filter_spec>

add one filter to the filter chain

A filter specifier begins with the name of a supported filter, optionally followed by zero or more options for the named filter. Filter name and options must be separated by whitespace. If the there is at least one option, the filter specifier needs to be quoted like this:

--filter ’compress --inertia 5 --damp 2’

This option may be specified multiple times to ’pipe’ the stream through all given filters (in a single thread without copying the data). The same filter may appear more than once, and order matters.

EXAMPLES

Decode a wma file to wav format:  

para_filter -f wmadec -f wav < file.wma > file.wav

Amplify a raw audio file by a factor of 1.5:  

para_filter -f amp --amp 32 < foo.raw > bar.raw

FILTERS

aacdec - decode an aac stream
Usage: aacdec

amp - amplify (scale) a raw audio stream
Usage: amp [--amp=<number>]
-a
, --amp=<number>

amplification value

default: 32

The amplification value determines the scaling factor by which the amplitude of the audio stream is multiplied. The formula for the scaling factor is

factor = 1 + amp / 64.

For example, an amplification value of zero results in a scaling factor of one while an amplification value of 64 means to double the volume.

compress - dynamically adjust the volume of an audio stream
Usage: compress [--blocksize=<bits>] [--aggressiveness=<bits>] [--inertia=<bits>] [--target-level=<level>] [--damp=<bits>]
-b
, --blocksize=<bits>

adjust volume after each block of size 2**bits (1-31)

default: 15

Larger blocksize means fewer volume adjustments per time unit.

-a, --aggressiveness=<bits>

controls the maximum amount to amplify by (0-10)

default: 4

This controls the maximal gain factor. Zero means to not amplify at all while the value 10 corresponds to maximal gain factor which results in a 4-fold increase in volume.

-i, --inertia=<bits>

how much inertia ramping has (1-14)

default: 6

Larger values cause smaller volume adjustments.

-t, --target-level=<level>

target signal level (0-32767)

default: 16384

If the peak of the previous block is less than the target level, volume is increased slightly for the next block. Otherwise it is decreased. The default value is chosen to minimize clipping. There is usually no reason to change it.

-d, --damp=<bits>

if non-zero, scale down after normalizing (0-16)

default: 0

This scales down the volume of the audio stream by factor 2**bits. This is mostly useful if another audio application (e.g., a video game) is running in parallel and the relative volume of the audio stream is too high.

fecdec - decode a (lossy) input stream using forward error correction
Usage: fecdec

flacdec - decode a flac stream
Usage: flacdec

mp3dec - decode an mp3 stream
Usage: mp3dec [--ignore-crc]
-i
, --ignore-crc

ignore CRC information in the audio stream

This causes frames with CRC errors to be decoded and played anyway. This option is not recommended, but since some encoders have been known to generate bad CRC information, this option is a work-around to play streams from such encoders.

oggdec - decode an ogg/vorbis stream
Usage: oggdec

opusdec - decode an ogg/opus stream
Usage: opusdec

prebuffer - delay processing of an audio stream
Usage: prebuffer [--duration=<milliseconds>] [--size=<bytes>]
-d
, --duration=<milliseconds>

length of the prebuffer period

default: 200

Wait this many milliseconds before letting data go through. The time interval starts when the first data byte is seen in the input queue.

-s, --size=<bytes>

amount of data to prebuffer

default: 0

Wait until this many data bytes are available in the input queue. The default value of zero means to not prebuffer by size. If both --duration and --size are given and non-zero, the prebuffer filter waits until both conditions are met.

resample - transform raw audio to a different sample rate
Usage: resample [--converter=<type>] [--dest-sample-rate=<rate>] [--channels=<num>] [--sample-rate=<rate>] [--sample-format=<format>]
-C
, --converter=<type>

set conversion algorithm

values: best, medium, fastest, zero_order_hold, linear

best: This is a bandlimited interpolator derived from the mathematical sinc function and this is the highest quality sinc based converter, providing a worst case Signal-to-Noise Ratio (SNR) of 97 decibels (dB) at a bandwidth of 97%.

medium: This is another bandlimited interpolator much like the previous one. It has an SNR of 97dB and a bandwidth of 90%. The speed of the conversion is much faster than the previous one.

fastest: This is the fastest bandlimited interpolator and has an SNR of 97dB and a bandwidth of 80%.

zero_order_hold: A Zero Order Hold converter (interpolated value is equal to the last value). The quality is poor but the conversion speed is blindlingly fast.

linear: A linear converter. Again the quality is poor, but the conversion speed is blindingly fast.

-d, --dest-sample-rate=<rate>

sample rate to convert to

default: 44100

-c, --channels=<num>

specify number of channels

default: 2

It is only necessary to specify this option for raw audio. If it is not given, the channel count is queried from the parent buffer tree nodes (e.g. the decoder) or the wav header. Only if this query fails, the default value applies.

-s, --sample-rate=<rate>

do not guess the input sample rate

default: 44100

It is only necessary to specify this for raw audio. See the discussion of the --channels option.

-f, --sample-format=<format>

specify sample format

values: S8, U8, S16_LE, S16_BE, U16_LE, U16_BE

It is only necessary to specify this for raw audio. See the discussion of the --channels option.

spxdec - decode an ogg/speex stream
Usage: spxdec

sync - synchronize playback between multiple clients
Usage: sync [--buddy=<url>] [--port=<portnumber>] [--timeout=<milliseconds>]
-b
, --buddy=<url>

client to synchronize with

This option may be given multiple times, one per buddy. Each value may be given as a host, port pair in either IPv4 or IPv6 form, with port being optional. If no port was specified the listening port (as specified with --port, see below) is used to send the synchronization packet to this buddy.

-p, --port=<portnumber>

UDP port for incoming synchronization packets

default: 29900

The sync filter expects incoming synchronization packets on this UDP port.

-t, --timeout=<milliseconds>

how long to wait for other clients

default: 2000

Once the sync filter receives its first chunk of input, a synchronization period of the given number of milliseconds begins. Playback is deferred until a synchronization packet has been received from each defined buddy, or until the end of the period. Buddies which did not send a synchronization packet in time are temporarily disabled and are not waited for during subsequent synchronization periods. They are re-enabled automatically when another synchronization packet arrives.

wav - insert a Microsoft wave header into a raw audio stream
Usage: wav

wmadec - decode a wma stream
Usage: wmadec

COPYRIGHT

Written by Andre Noll
Copyright (C) 2024 Andre Noll
License: GNU GPL version 2
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Report bugs to Andre Noll