Spaces:
Sleeping
Sleeping
Delete utils.py
#1
by
Shweta7171
- opened
utils.py
DELETED
@@ -1,25 +0,0 @@
|
|
1 |
-
import os
|
2 |
-
from openai import OpenAI
|
3 |
-
|
4 |
-
def audio_to_text(audio_data):
|
5 |
-
client = OpenAI()
|
6 |
-
|
7 |
-
transcription = client.audio.transcriptions.create(
|
8 |
-
model="whisper-1",
|
9 |
-
file=audio_data,
|
10 |
-
response_format="text"
|
11 |
-
)
|
12 |
-
return transcription
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
def text_to_speech(text):
|
17 |
-
client = OpenAI()
|
18 |
-
|
19 |
-
response = client.audio.speech.create(
|
20 |
-
model="tts-1",
|
21 |
-
voice="shimmer",
|
22 |
-
input=text
|
23 |
-
)
|
24 |
-
|
25 |
-
return response
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|