aedocw / epub2tts

Turn an epub or text file into an audiobook
Apache License 2.0
433 stars 43 forks source link

OpenAI integration is broken #146

Closed aedocw closed 6 months ago

aedocw commented 6 months ago

Speaker names should be forced to lower case. AND the whisper transcript comparison should be skipped when using OpenAI.

aedocw commented 6 months ago

AND AND it fails, probably to do with flac/wav file conversion: Traceback (most recent call last): File "/Users/doc/repos/epub2tts/epub2tts.py", line 675, in main() File "/Users/doc/repos/epub2tts/epub2tts.py", line 664, in main mybook.read_book( File "/Users/doc/repos/epub2tts/epub2tts.py", line 456, in read_book temp = AudioSegment.from_wav(tempwav) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/doc/repos/epub2tts/.venv/lib/python3.11/site-packages/pydub/audio_segment.py", line 808, in from_wav return cls.from_file(file, 'wav', parameters=parameters) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/doc/repos/epub2tts/.venv/lib/python3.11/site-packages/pydub/audio_segment.py", line 773, in from_file raise CouldntDecodeError( pydub.exceptions.CouldntDecodeError: Decoding failed. ffmpeg returned error code: 1

aedocw commented 6 months ago

AH it's because OpenAI streams it back as an mp3 file!