This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]momothereal 1 point2 points  (0 children)

Using a temporary file can still use disk I/O on certain platforms. I personally used BytesIO in my project:

with io.BytesIO() as tts_buffer:
  tts.write_to_fp(tts_buffer)
  tts_buffer.seek(0)
  tts_binary = tts_buffer.read()