pico2wave
only supports outputting to a file (edit: with extension .wav
). How can I coerce the output into a pipe for aplay
, without cleaning up any named pipes or temporary files or a wrapper script?
Ie, pico2wave -w tmp.wav "test" && aplay tmp.wav && rm tmp.wav
creates a temporary file, and is thus not what I'm looking for as a solution.
Best Answer
A note on the general solution: to many programs which require a filename you can give the path
/dev/stdout
(a link to/proc/self/fd/1
, assuming said files exist) and they will happily send their output tostdout
. One may also use process substitution inbash
withcat
, iefoo -f >(cat) args | bar
(thanks, g-man).Because
pico2wave
checks the file extension, a possible solution is to symlink/dev/stdout
to a path with the appropriate extension, ideally somewhere such as/var/local/
. This does create an extra file, but not per process:ln -s /dev/stdout /var/local/pico2wave.wav
, thenpico2wave -w /var/local/pico2wave.wav "test" | aplay
works.