shithub: opus-tools

Download patch

ref: adadcf9953a8d24376c61c59122619b328196de6
parent: 6b9b69a205a882e2a6d2c197772061e2205bfc16
author: Mark Harris <[email protected]>
date: Tue Jan 2 19:51:25 EST 2018

opusdec: Update help and man page

--- a/man/opusdec.1
+++ b/man/opusdec.1
@@ -4,7 +4,7 @@
 .TH opusdec 1 2012-08-31 "Xiph.Org Foundation" "opus-tools"
 
 .SH NAME
-opusdec \- decode audio from Opus format to WAV (or simple audio output)
+opusdec \- decode audio in Opus format to Wave or raw PCM
 
 .SH SYNOPSIS
 .B opusdec
@@ -37,8 +37,16 @@
 .SH DESCRIPTION
 
 .B opusdec
-decodes Opus files into PCM Wave (uncompressed) files.
+decodes Opus URLs or files to uncompressed Wave or raw PCM.
 
+In URLs, the
+.B file
+,
+.B http
+, and
+.B https
+schemes are supported unless HTTP support was disabled at build time.
+
 If the input file is specified as
 .B "-"
 , then
@@ -54,30 +62,30 @@
 
 .SH "OPTIONS"
 .IP "-h, --help"
-Print help message
+Show help message
 .IP "-V, --version"
-Display version information
+Show version information
 .IP "--quiet"
 Suppresses program output
-.IP "--rate"
+.IP "--rate n"
 .br
 Force decoding at sampling rate n Hz
 .IP "--force-stereo"
 .br
 Force decoding to stereo
-.IP "--gain"
+.IP "--gain n"
 .br
 Adjust the output volume n dB, negative values make the signal quieter
 .IP "--no-dither"
 Do not dither 16-bit output
 .IP "--float"
-32-bit floating-point files instead of 16-bit files
+Output 32-bit floating-point samples instead of 16-bit integer samples
 .IP "--force-wav"
-Force including a wav header on output (e.g. for non-wav extensions and stdout)
-.IP "--packet-loss"
+Force including a Wave header on output (e.g. for non-wav extensions and stdout)
+.IP "--packet-loss n"
 Simulate n % random Opus packet loss
-.IP "--save-range"
-Saves check values for every frame to a file
+.IP "--save-range file"
+Save check values for every frame to a file
 
 .SH EXAMPLES
 Decode a file
@@ -90,12 +98,8 @@
 
 Play a file
 .B input.opus
-and force output at 48000 regardless of
-the original sampling rate
-.br
-.I (48kHz output may be faster, due to avoiding resampling and some sound hardware produces higher quality output when run at 48kHz)
 .RS
-opusdec --rate 48000 input.opus
+opusdec input.opus
 .RE
 
 Re-encode a high bitrate Opus file to a lower rate
@@ -105,11 +109,11 @@
 
 Play an http stream
 .B http://icecast.somwhere.org:8000/stream.opus
-with the help of curl on a system with pulseaudio
+on a system with pulseaudio
 .br
 .I (press ctrl-c to quit)
 .RS
-curl http://icecast.somwhere.org:8000/stream.opus | padsp opusdec -
+padsp opusdec http://icecast.somwhere.org:8000/stream.opus
 .RE
 
 .SH AUTHORS
--- a/src/opusdec.c
+++ b/src/opusdec.c
@@ -441,32 +441,43 @@
 
 void usage(void)
 {
-   printf("Usage: opusdec [options] input_file.opus [output_file]\n");
+#if defined HAVE_LIBSNDIO || defined HAVE_SYS_SOUNDCARD_H || \
+    defined HAVE_MACHINE_SOUNDCARD_H || defined HAVE_SOUNDCARD_H || \
+    defined HAVE_SYS_AUDIOIO_H || defined WIN32 || defined _WIN32
+   printf("Usage: opusdec [options] input [output]\n");
+#else
+   printf("Usage: opusdec [options] input output\n");
+#endif
    printf("\n");
-   printf("Decodes a Opus file and produce a WAV file or raw file\n");
+   printf("Decode audio in Opus format to Wave or raw PCM\n");
    printf("\n");
-   printf("input_file can be:\n");
-   printf("  filename.opus        regular Opus file\n");
+   printf("input can be:\n");
+   printf("  file:filename.opus   Opus URL\n");
+   printf("  filename.opus        Opus file\n");
    printf("  -                    stdin\n");
    printf("\n");
-   printf("output_file can be:\n");
-   printf("  filename.wav         Wav file\n");
+   printf("output can be:\n");
+   printf("  filename.wav         Wave file\n");
    printf("  filename.*           Raw PCM file (any extension other than .wav)\n");
    printf("  -                    stdout (raw; unless --force-wav)\n");
-   printf("  (nothing)            Will be played to soundcard\n");
+#if defined HAVE_LIBSNDIO || defined HAVE_SYS_SOUNDCARD_H || \
+    defined HAVE_MACHINE_SOUNDCARD_H || defined HAVE_SOUNDCARD_H || \
+    defined HAVE_SYS_AUDIOIO_H || defined WIN32 || defined _WIN32
+   printf("  (default)            Play audio\n");
+#endif
    printf("\n");
    printf("Options:\n");
+   printf(" -h, --help            Show this help\n");
+   printf(" -V, --version         Show version information\n");
+   printf(" --quiet               Suppress program output\n");
    printf(" --rate n              Force decoding at sampling rate n Hz\n");
    printf(" --force-stereo        Force decoding to stereo\n");
-   printf(" --gain n              Manually adjust gain by n.nn dB (0 default)\n");
+   printf(" --gain n              Adjust output volume n dB (negative is quieter)\n");
    printf(" --no-dither           Do not dither 16-bit output\n");
-   printf(" --float               32-bit floating-point output\n");
-   printf(" --force-wav           Force wav header on output\n");
+   printf(" --float               Output 32-bit floating-point samples\n");
+   printf(" --force-wav           Force Wave header on output\n");
    printf(" --packet-loss n       Simulate n %% random packet loss\n");
-   printf(" --save-range file     Saves check values for every frame to a file\n");
-   printf(" -h, --help            This help\n");
-   printf(" -V, --version         Version information\n");
-   printf(" --quiet               Quiet mode\n");
+   printf(" --save-range file     Save check values for every frame to a file\n");
    printf("\n");
 }