View previous topic :: View next topic |
Author |
Message |
FR3141 n00b
Joined: 13 Jan 2018 Posts: 39
|
Posted: Tue Jul 24, 2018 6:05 pm Post subject: Piping Flac to Aplay |
|
|
I can recall that once I was able to pipe the output of flac to aplay:
flac -d -c file.flac | aplay
But now when I do the same I get harsh noise with the following message:
Playing raw data 'stdin' : Unsigned 8 bit, Rate 8000 Hz, Mono
Evidently, aplay is no longer able to determine the audio parameters from the piped data and it asumes that the audio stream is 8-bit, 8K mono. I say "no longer" because I tried this command on an older machine with an older alsa and it worked as intended.
What happened? Is this a problem with alsa or is this a new "feature?" |
|
Back to top |
|
|
sebaro Veteran
Joined: 03 Jul 2006 Posts: 1141 Location: Romania
|
Posted: Wed Jul 25, 2018 6:03 am Post subject: |
|
|
Try with -f FORMAT:
Code: | flac -d -c 'file.flac' | aplay -f cd |
|
|
Back to top |
|
|
FR3141 n00b
Joined: 13 Jan 2018 Posts: 39
|
Posted: Wed Jul 25, 2018 9:16 am Post subject: |
|
|
sebaro wrote: | Try with -f FORMAT:
Code: | flac -d -c 'file.flac' | aplay -f cd |
|
That will work if the audio file happens to be in CD format but not all audio files are in CD format.
Alsa should be able to read the format information from the piped data but it does not do that anymore.
The whole point of piping flac output is to make it easy to play the audio file. If the audio parameters have to be determined beforehand and then given to aplay the command is a lot less easy.
As I stated in the first post, piping audio data to aplay used to work but in the latest alsa versions it no longer works. |
|
Back to top |
|
|
sebaro Veteran
Joined: 03 Jul 2006 Posts: 1141 Location: Romania
|
|
Back to top |
|
|
FR3141 n00b
Joined: 13 Jan 2018 Posts: 39
|
Posted: Sat Jul 28, 2018 2:27 pm Post subject: |
|
|
Quote: | If you must use aplay then you can try the 1.1.2 ebuild version or build it from older sources |
I posted the issue to the Alsa mailig list. It was a bug in Alsa. A patch has been posted to the Alsa list:
https://sourceforge.net/p/alsa/mailman/alsa-user/
This patch may be included in the next Alsa release, but the Gentoo developers may want to be aware of it.
Aplay is a great utility. I am glad to be able to use it again. |
|
Back to top |
|
|
|