1
$\begingroup$

How to export Speak["valentine"] to wav or mp3 file?

$\endgroup$
2
  • 2
    $\begingroup$ You might want SpeechSynthesize instead. Export["valentine.wav", SpeechSynthesize["valentine"]] works fine. $\endgroup$
    – Carl Lange
    Commented Dec 7, 2020 at 21:19
  • $\begingroup$ Thank You! Have a nice day!! $\endgroup$
    – Milk
    Commented Dec 7, 2020 at 21:25

1 Answer 1

1
$\begingroup$

Speak does not generate an output object (it returns Null). It only has the side effect of producing the synthesized sounds, so it is not straightforward to export the generated audio directly.

On the other hand, SpeechSynthesize returns an Audio object, which here appears to behave essentially as a wrapper for a .WAV file automatically generated somewhere on your computer.

As Carl Lange mentioned in his comment, this object can be exported directly using Export:

Export["valentine.wav", SpeechSynthesize["valentine"]
$\endgroup$

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.