Skip to content

Commit

Permalink
fix: remove conversion of mp3 into wav
Browse files Browse the repository at this point in the history
  • Loading branch information
msadeqsirjani committed Jun 11, 2023
1 parent bc279e7 commit 5beb035
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions voice_engine/text_to_speech.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from gtts import gTTS
from uuid import uuid4
from config import MEDIA_DIR
from voice_engine.mp3_to_other_type import convert as wav_convertor
# from voice_engine.mp3_to_other_type import convert as wav_convertor


def convert(text: str, language: str = 'en') -> str:
Expand All @@ -12,8 +12,9 @@ def convert(text: str, language: str = 'en') -> str:
exact_file_name = f"{str(uuid4())}.mp3"
exact_file_path = os.path.join(MEDIA_DIR, exact_file_name)
tts.save(savefile=exact_file_path)
file_path = wav_convertor(audio_path=exact_file_path)
# file_path = wav_convertor(audio_path=exact_file_path)
# file_path = exact_file_path

os.remove(exact_file_path)
# os.remove(exact_file_path)

return exact_file_name.replace(".mp3", ".wav"), file_path
return exact_file_name, exact_file_path

0 comments on commit 5beb035

Please sign in to comment.