I saw many tts engines, like festival, espeak, etc.. I wanted to know if any of these could select the output device, like an USB sound device. If it's possible, what the command line to make it happens?

1 Answer 1


I don't have my Pi in reach right now, but you can do it like this: First, find out which playback devices you have. You can do this with aplay:

$ aplay -L
    Discard all samples (playback) or generate zero samples (capture)
    HDA Intel PCH, ALC892 Analog
    Default Audio Device
    HDA Intel PCH, ALC892 Analog
    Front speakers
    HDA Intel PCH, ALC892 Analog
    4.0 Surround output to Front and Rear speakers

This is for my Linux PC, but the Raspberry Pi will show something similar. Then tell you TTS tool to output to stdout, which is easy for espeak. Pipe the output through aplay, with the specified device:

espeak "Hello world" --stdout | aplay -D 'default'

Instead of default, you can use any of the listed device names.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.