Delete untitled33.py
Browse files- untitled33.py +0 -30
untitled33.py
DELETED
|
@@ -1,30 +0,0 @@
|
|
| 1 |
-
# -*- coding: utf-8 -*-
|
| 2 |
-
"""Untitled33.ipynb
|
| 3 |
-
|
| 4 |
-
Automatically generated by Colaboratory.
|
| 5 |
-
|
| 6 |
-
Original file is located at
|
| 7 |
-
https://colab.research.google.com/drive/1Jzvg837BnV4DEdkgG76ijpdYldq4Wu49
|
| 8 |
-
"""
|
| 9 |
-
|
| 10 |
-
pip install gTTS
|
| 11 |
-
|
| 12 |
-
from IPython.display import Audio
|
| 13 |
-
|
| 14 |
-
# Replace 'your_audio_file.mp3' with the name of your audio file
|
| 15 |
-
audio_path = '/content/welcome.mp3'
|
| 16 |
-
|
| 17 |
-
# Play the audio
|
| 18 |
-
Audio(audio_path)
|
| 19 |
-
|
| 20 |
-
from gtts import gTTS
|
| 21 |
-
from IPython.display import Audio
|
| 22 |
-
from io import BytesIO
|
| 23 |
-
|
| 24 |
-
# Get user input
|
| 25 |
-
text = input("Enter the text you want to convert to speech: ")
|
| 26 |
-
|
| 27 |
-
# Create a gTTS object and get audio as bytes
|
| 28 |
-
tts = gTTS(text)
|
| 29 |
-
audio_bytes = BytesIO()
|
| 30 |
-
tts.write_to_fp(audio_bytes)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|