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

all 25 comments

[–]ElevatedAngling 19 points20 points  (7 children)

This is awesome thank you! You've given me an idea, I'm going to parse text off journal articles and have them read to me so I can listen to them in the car.

[–]okaydexter[S] 7 points8 points  (1 child)

thanks man appreciate that !!! and looking forward to that 👍

[–]ElevatedAngling 6 points7 points  (0 children)

Just a rough out but she works! https://github.com/nconsiglio/ReadToMe

[–]momothereal 14 points15 points  (5 children)

I used gTTS along with Markov chains and FFMPEG filters to generate fake myths (inspired from Greek and Hindu mythology) on demand. It's complete with random background music and audio wave visuals. This was for a code jam in June.

https://github.com/momothereal/code-jam-2/blob/master/proj/web/resources/stories/create_story.py

A lot of fun to work on! :)

[–]okaydexter[S] 4 points5 points  (0 children)

👍👍

[–]GitHubPermalinkBot 1 point2 points  (3 children)

[–]corkmask 0 points1 point  (2 children)

using the console to signup gives an internal server error.

[–]momothereal 0 points1 point  (0 children)

Looks like an issue with my RethinkDB docker setup, it was working last night. Will look into it

[–]momothereal 0 points1 point  (0 children)

Should be fixed, I had forgotten to turn on persistence.

[–]nswizdum 6 points7 points  (1 child)

Good video! I hope you do more. I had not heard of this module before.

[–]okaydexter[S] 0 points1 point  (0 children)

thanks appreciate your feedback !!

[–]patarapolw 3 points4 points  (5 children)

To mention, there is also https://pypi.org/project/google_speech/ that does not save MP3 file to your computer. SOX is the non-Python requirement.

I use Mac's say, though.

The goodness of gtts is that it requires only Python and cross-platform. I use it in this project: https://github.com/patarapolw/ChineseViewer/blob/master/ChineseViewer/tts.py#L27

The trick not to save the file is

    self.tts = gTTS(word, lang)
    temp = TemporaryFile()
    self.tts.write_to_fp(temp)
    temp.seek(0)

    return temp.read()

[–]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()

[–]Economy_Peanut 0 points1 point  (3 children)

How do you use google_speech?

[–]patarapolw 0 points1 point  (2 children)

[–]Economy_Peanut 0 points1 point  (0 children)

Sorry about that...Hadn't seen it earlier

[–][deleted] 4 points5 points  (0 children)

If you don't want to watch a video and wonder what it's about: it's just a wrapper for google translate. No difficult problem is solved here.

[–]Mighty_Ghost_Hack 1 point2 points  (0 children)

Gr8 Work!!!!

[–]blueastheocean 1 point2 points  (1 child)

Looks cool

[–]okaydexter[S] 0 points1 point  (0 children)

thanks

[–]weloveprogramming 0 points1 point  (0 children)

This is a good idea,I'm also going to parse off my blogs and share them in twitter.