setup/destination: frequency

This commit is contained in:
Vincent Riquer 2013-06-19 02:35:10 +02:00
parent 81b7f8b247
commit b4d7c9d9f0

View File

@ -354,11 +354,37 @@ setupDestination() {
comeagain
destinationchannels["$destination"]=$value
cat <<-EODesc
Sampling rate (Hertz, integer):
Files will be resampled as needed to the specified sampling-rate.
Shoutcast/Icecast streams require a constant sampling-rate.
Telephony systems often require a sampling-rate of 8000Hz.
EODesc
if [[ ${destinationformat["$destination"]} == opus ]]
then
cat <<-EODesc
Please note that Opus supports only the following sample-rates:
8000, 12000, 16000, 24000, and 48000 Hz. So don't set
resampling on an Opus destination to any other value or files
will be resampled twice.
EODesc
fi
comeagain() {
:
read \
-e \
${destinationfrequency["$destination"]+-i${destinationfrequency["$destination"]}}\
-p'Sampling-rate: ' \
value
if ! [[ $value =~ $expr ]]
then
echo "Invalid frequency value: $value" >&2
comeagain
fi
unset expr
}
comeagain
destinationfrequency["$destination"]=$value
cat <<-EODesc
EODesc
comeagain() {