Skip to content

Instantly share code, notes, and snippets.

View cspenn's full-sized avatar

Christopher S. Penn cspenn

View GitHub Profile
@cspenn
cspenn / make_audiobook.py
Last active June 16, 2022 21:50 — forked from madebyollin/make_audiobook.py
Converts an epub or text file to audiobook via Google Cloud TTS
#!/usr/bin/env python3
"""
Updated 2022-06-16 with removal of enums and types in TTS API, fix of synthesize_speech function
To use:
1. install/set-up the google cloud api and dependencies listed on https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/texttospeech/cloud-client
2. install pandoc and pypandoc, also tqdm
3. create and download a service_account.json ("Service account key") from https://console.cloud.google.com/apis/credentials
4. run GOOGLE_APPLICATION_CREDENTIALS=service_account.json python make_audiobook.py book_name.epub
"""