Help message

master
Mark Hills 2012-07-27 12:46:03 +01:00
parent b5ce1fcc9d
commit 44f8e51c10
3 changed files with 16 additions and 12 deletions

View File

@ -1,6 +1,6 @@
#ifndef NOTICE_H
#define NOTICE_H
#define COPYRIGHT "(C) Copyright 2012 Mark Hills <mark@xwax.org>"
#define COPYRIGHT "trx (C) Copyright 2012 Mark Hills <mark@xwax.org>"
#endif

12
rx.c
View File

@ -105,12 +105,13 @@ static int run_rx(RtpSession *session,
static void usage(FILE *fd)
{
fprintf(fd, "Usage: rx [<parameters>]\n");
fprintf(fd, "Usage: rx [<parameters>]\n"
"Real-time audio receiver over IP\n");
fprintf(fd, "\nAudio device (ALSA) parameters:\n");
fprintf(fd, " -d <dev> Device name (default '%s')\n",
DEFAULT_DEVICE);
fprintf(fd, " -m <ms> Buffer time (milliseconds, default %d)\n",
fprintf(fd, " -m <ms> Buffer time (default %d milliseconds)\n",
DEFAULT_BUFFER);
fprintf(fd, "\nNetwork parameters:\n");
@ -118,11 +119,11 @@ static void usage(FILE *fd)
DEFAULT_ADDR);
fprintf(fd, " -p <port> UDP port number (default %d)\n",
DEFAULT_PORT);
fprintf(fd, " -j <ms> Jitter buffer (milliseconds, default %d)\n",
fprintf(fd, " -j <ms> Jitter buffer (default %d milliseconds)\n",
DEFAULT_JITTER);
fprintf(fd, "\nEncoding parameters (must match sender):\n");
fprintf(fd, " -r <rate> Sample rate (default %d)\n",
fprintf(fd, " -r <rate> Sample rate (default %dHz)\n",
DEFAULT_RATE);
fprintf(fd, " -c <n> Number of channels (default %d)\n",
DEFAULT_CHANNELS);
@ -148,7 +149,7 @@ int main(int argc, char *argv[])
channels = DEFAULT_CHANNELS,
port = DEFAULT_PORT;
fputs("rx " COPYRIGHT "\n", stderr);
fputs(COPYRIGHT "\n", stderr);
for (;;) {
int c;
@ -156,7 +157,6 @@ int main(int argc, char *argv[])
c = getopt(argc, argv, "c:d:h:j:m:p:v:");
if (c == -1)
break;
switch (c) {
case 'c':
channels = atoi(optarg);

14
tx.c
View File

@ -92,12 +92,13 @@ static int run_tx(snd_pcm_t *snd,
static void usage(FILE *fd)
{
fprintf(fd, "Usage: tx [<parameters>]\n");
fprintf(fd, "Usage: tx [<parameters>]\n"
"Real-time audio transmitter over IP\n");
fprintf(fd, "\nAudio device (ALSA) parameters:\n");
fprintf(fd, " -d <dev> Device name (default '%s')\n",
DEFAULT_DEVICE);
fprintf(fd, " -m <ms> Buffer time (milliseconds, default %d)\n",
fprintf(fd, " -m <ms> Buffer time (default %d milliseconds)\n",
DEFAULT_BUFFER);
fprintf(fd, "\nNetwork parameters:\n");
@ -107,11 +108,11 @@ static void usage(FILE *fd)
DEFAULT_PORT);
fprintf(fd, "\nEncoding parameters:\n");
fprintf(fd, " -r <rate> Sample rate (default %d)\n",
fprintf(fd, " -r <rate> Sample rate (default %dHz)\n",
DEFAULT_RATE);
fprintf(fd, " -c <n> Number of channels (default %d)\n",
DEFAULT_CHANNELS);
fprintf(fd, " -f <bytes> Frame size (default %d)\n",
fprintf(fd, " -f <n> Frame size (default %d samples, see below)\n",
DEFAULT_FRAME);
fprintf(fd, " -b <kbps> Bitrate (approx., default %d)\n",
DEFAULT_BITRATE);
@ -119,6 +120,9 @@ static void usage(FILE *fd)
fprintf(fd, "\nDisplay parameters:\n");
fprintf(fd, " -v <n> Verbosity level (default %d)\n",
DEFAULT_VERBOSE);
fprintf(fd, "\nAllowed frame sizes (-f) are defined by the Opus codec. For example,\n"
"at 48000Hz the permitted values are 120, 240, 480 or 960.\n");
}
int main(int argc, char *argv[])
@ -139,7 +143,7 @@ int main(int argc, char *argv[])
kbps = DEFAULT_BITRATE,
port = DEFAULT_PORT;
fputs("tx " COPYRIGHT "\n", stderr);
fputs(COPYRIGHT "\n", stderr);
for (;;) {
int c;