Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -51,17 +51,18 @@ def transcribe_2(audio_bytes):
|
|
51 |
#audio = speech_v1.RecognitionAudio(content=audio_bytes)
|
52 |
#request = speech_v1.RecognizeSpeechRequest(config=config, audio=audio)
|
53 |
print(f"{type(audio_bytes)} {audio_bytes}")
|
54 |
-
|
55 |
-
|
56 |
-
print(type(
|
57 |
-
y
|
58 |
-
y
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
|
|
65 |
#the path of your audio file
|
66 |
with io.open(file_name, "rb") as audio_file:
|
67 |
content = audio_file.read()
|
|
|
51 |
#audio = speech_v1.RecognitionAudio(content=audio_bytes)
|
52 |
#request = speech_v1.RecognizeSpeechRequest(config=config, audio=audio)
|
53 |
print(f"{type(audio_bytes)} {audio_bytes}")
|
54 |
+
file_name = audio_bytes
|
55 |
+
#sr, y = audio_bytes
|
56 |
+
#print(f"{type(sr)} {sr}")
|
57 |
+
#print(type(y))
|
58 |
+
#y = y.astype(np.float32)
|
59 |
+
#y /= np.max(np.abs(y))
|
60 |
+
|
61 |
+
#import scipy.io.wavfile as wav
|
62 |
+
#RATE = sr
|
63 |
+
#numpydata = y
|
64 |
+
#file_name = 'out.wav'
|
65 |
+
#wav.write(file_name, RATE, numpydata)
|
66 |
#the path of your audio file
|
67 |
with io.open(file_name, "rb") as audio_file:
|
68 |
content = audio_file.read()
|