diff --git a/lib/setup/setupDestination b/lib/setup/setupDestination index 0697a77..e618841 100644 --- a/lib/setup/setupDestination +++ b/lib/setup/setupDestination @@ -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() {