Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use new name of openai-whisper module, ditch simpleaudio for pyaudio #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions bertosito_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
import requests
import asyncio
import edge_tts
import simpleaudio as sa
import os
import json
from colorama import init, Fore
from pydub import AudioSegment
from pydub.playback import play
from scipy.io.wavfile import write
import sys

Expand Down Expand Up @@ -159,9 +159,7 @@ def speak_response(response_text, voice='es-MX-JorgeNeural'):
sound.export(filename_wav, format="wav")

if os.path.exists(filename_wav) and os.path.getsize(filename_wav) > 0:
wave_obj = sa.WaveObject.from_wave_file(filename_wav)
play_obj = wave_obj.play()
play_obj.wait_done()
play(sound)
os.remove(filename_mp3)
os.remove(filename_wav)
else:
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
sounddevice
whisper
openai-whisper
requests
asyncio
edge_tts
simpleaudio
pyaudio
colorama
pydub
scipy