Print status message saying where audio output is going.
This commit is contained in:
parent
8a2cef5e35
commit
829e39594d
12
main.cc
12
main.cc
|
@ -264,7 +264,7 @@ int main(int argc, char **argv)
|
||||||
enum OutputMode { MODE_RAW, MODE_WAV, MODE_ALSA };
|
enum OutputMode { MODE_RAW, MODE_WAV, MODE_ALSA };
|
||||||
OutputMode outmode = MODE_ALSA;
|
OutputMode outmode = MODE_ALSA;
|
||||||
string filename;
|
string filename;
|
||||||
string devname("default");
|
string alsadev("default");
|
||||||
double bufsecs = -1;
|
double bufsecs = -1;
|
||||||
|
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
|
@ -321,7 +321,7 @@ int main(int argc, char **argv)
|
||||||
case 'P':
|
case 'P':
|
||||||
outmode = MODE_ALSA;
|
outmode = MODE_ALSA;
|
||||||
if (optarg != NULL)
|
if (optarg != NULL)
|
||||||
devname = optarg;
|
alsadev = optarg;
|
||||||
break;
|
break;
|
||||||
case 'b':
|
case 'b':
|
||||||
if (!parse_opt(optarg, bufsecs) || bufsecs < 0) {
|
if (!parse_opt(optarg, bufsecs) || bufsecs < 0) {
|
||||||
|
@ -435,13 +435,19 @@ int main(int argc, char **argv)
|
||||||
unique_ptr<AudioOutput> audio_output;
|
unique_ptr<AudioOutput> audio_output;
|
||||||
switch (outmode) {
|
switch (outmode) {
|
||||||
case MODE_RAW:
|
case MODE_RAW:
|
||||||
|
fprintf(stderr, "Writing raw 16-bit audio samples to '%s'\n",
|
||||||
|
filename.c_str());
|
||||||
audio_output.reset(new RawAudioOutput(filename));
|
audio_output.reset(new RawAudioOutput(filename));
|
||||||
break;
|
break;
|
||||||
case MODE_WAV:
|
case MODE_WAV:
|
||||||
|
fprintf(stderr, "Writing audio samples to '%s'\n",
|
||||||
|
filename.c_str());
|
||||||
audio_output.reset(new WavAudioOutput(filename, pcmrate, stereo));
|
audio_output.reset(new WavAudioOutput(filename, pcmrate, stereo));
|
||||||
break;
|
break;
|
||||||
case MODE_ALSA:
|
case MODE_ALSA:
|
||||||
audio_output.reset(new AlsaAudioOutput(devname, pcmrate, stereo));
|
fprintf(stderr, "Playing audio to ALSA device '%s'\n",
|
||||||
|
alsadev.c_str());
|
||||||
|
audio_output.reset(new AlsaAudioOutput(alsadev, pcmrate, stereo));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue