minimodem: --samplerate sets the audio sample rate

This commit is contained in:
Kamal Mostafa 2012-08-11 10:24:28 -07:00
parent 22317f54fc
commit 8d90e839d7
2 changed files with 11 additions and 2 deletions

View File

@ -2,7 +2,7 @@
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH MINIMODEM 1 "August 8, 2011"
.TH MINIMODEM 1 "August 11, 2011"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
@ -71,6 +71,9 @@ encode or decode an audio file (extension sets audio format)
.B \-q, \-\-quiet
Do not report CARRIER / NOCARRIER or signal analysis metrics.
.TP
.B \-R, \-\-samplerate {rate}
Set the audio sample rate (default rate is 48000 Hz).
.TP
.B \-A, \-\-alsa
Use ALSA as the audio output system instead of the default
PulseAudio (depending on build configuration options).

View File

@ -254,6 +254,7 @@ usage()
" -S, --space {space_freq}\n"
" -T, --txstopbits {m.n}\n"
" -q, --quiet\n"
" -R, --samplerate {rate}\n"
" -V, --version\n"
" -A, --alsa\n"
" {baudmode}\n"
@ -329,9 +330,10 @@ main( int argc, char*argv[] )
{ "txstopbits", 1, 0, 'T' },
{ "quiet", 0, 0, 'q' },
{ "alsa", 0, 0, 'A' },
{ "samplerate", 1, 0, 'R' },
{ 0 }
};
c = getopt_long(argc, argv, "Vtrc:a85f:b:M:S:T:qA",
c = getopt_long(argc, argv, "Vtrc:a85f:b:M:S:T:qAR:",
long_options, &option_index);
if ( c == -1 )
break;
@ -383,6 +385,10 @@ main( int argc, char*argv[] )
case 'q':
quiet_mode = 1;
break;
case 'R':
sample_rate = atoi(optarg);
assert( sample_rate > 0 );
break;
case 'A':
#if USE_ALSA
simpleaudio_open_system_audio = simpleaudio_open_stream_alsa;