removed the main
Browse files- app/tts.py +50 -50
app/tts.py
CHANGED
|
@@ -68,54 +68,54 @@ class tts():
|
|
| 68 |
audio_data = np.concatenate(audio_chunks, axis=0)
|
| 69 |
return audio_data, sample_rate
|
| 70 |
|
| 71 |
-
if __name__ == "__main__":
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
|
|
|
| 68 |
audio_data = np.concatenate(audio_chunks, axis=0)
|
| 69 |
return audio_data, sample_rate
|
| 70 |
|
| 71 |
+
# if __name__ == "__main__":
|
| 72 |
+
# tts_instance = tts()
|
| 73 |
+
# lyrics_lines = [
|
| 74 |
+
# "Ooh",
|
| 75 |
+
# "I, I just woke up from a dream",
|
| 76 |
+
# "Where you and I had to say goodbye",
|
| 77 |
+
# "And I don't know what it all means",
|
| 78 |
+
# "But since I survived, I realized",
|
| 79 |
+
# "Wherever you go, that's where I'll follow",
|
| 80 |
+
# "Nobody's promised tomorrow",
|
| 81 |
+
# "So I'ma love you every night like it's the last night",
|
| 82 |
+
# "Like it's the last night",
|
| 83 |
+
# "If the world was ending, I'd wanna be next to you",
|
| 84 |
+
# "If the party was over and our time on Earth was through",
|
| 85 |
+
# "I'd wanna hold you just for a while and die with a smile",
|
| 86 |
+
# "If the world was ending, I'd wanna be next to you",
|
| 87 |
+
# "Ooh",
|
| 88 |
+
# "Ooh, lost, lost in the words that we scream",
|
| 89 |
+
# "I don't even wanna do this anymore",
|
| 90 |
+
# "'Cause you already know what you mean to me",
|
| 91 |
+
# "And our love's the only war worth fighting for",
|
| 92 |
+
# "Wherever you go, that's where I'll follow",
|
| 93 |
+
# "Nobody's promised tomorrow",
|
| 94 |
+
# "So I'ma love you every night like it's the last night",
|
| 95 |
+
# "Like it's the last night",
|
| 96 |
+
# "If the world was ending, I'd wanna be next to you",
|
| 97 |
+
# "If the party was over and our time on Earth was through",
|
| 98 |
+
# "I'd wanna hold you just for a while and die with a smile",
|
| 99 |
+
# "If the world was ending, I'd wanna be next to you",
|
| 100 |
+
# "Right next to you",
|
| 101 |
+
# "Next to you",
|
| 102 |
+
# "Right next to you",
|
| 103 |
+
# "Oh-oh, oh",
|
| 104 |
+
# "If the world was ending, I'd wanna be next to you",
|
| 105 |
+
# "If the party was over and our time on Earth was through",
|
| 106 |
+
# "I'd wanna hold you just for a while and die with a smile",
|
| 107 |
+
# "If the world was ending, I'd wanna be next to you",
|
| 108 |
+
# "If the world was ending, I'd wanna be next to you",
|
| 109 |
+
# "Ooh",
|
| 110 |
+
# "I'd wanna be next to you"
|
| 111 |
+
# ]
|
| 112 |
|
| 113 |
+
# lyrics_text = "\n".join(lyrics_lines)
|
| 114 |
+
# chunked_text = tts_instance.insert_chunks_into_text(lyrics_text)
|
| 115 |
+
# start = time.time()
|
| 116 |
+
# audio_data, sample_rate = asyncio.run(tts_instance.cpu_stream_to_audio(chunked_text['original_text']))
|
| 117 |
+
# print(f"Transcription complete in {time.time() - start:.2f} seconds")
|
| 118 |
+
# print(f"Returned audio data shape: {audio_data.shape} with sample rate: {sample_rate}")
|
| 119 |
+
# output_filename = "output.wav"
|
| 120 |
+
# sf.write(output_filename, audio_data, sample_rate)
|
| 121 |
+
# print(f"Audio saved as {output_filename}")
|