Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,8 +2,8 @@ from pytube import YouTube
|
|
2 |
from google.cloud import speech_v1p1beta1 as speech
|
3 |
from pydub import AudioSegment
|
4 |
import io
|
5 |
-
import os
|
6 |
import openai
|
|
|
7 |
import gradio as gr
|
8 |
|
9 |
# ์ ํ๋ธ ๋น๋์ค ID ์ถ์ถ ํจ์
|
@@ -34,7 +34,7 @@ def download_and_convert_audio(youtube_url):
|
|
34 |
# ์ค๋์ค ํ์ผ์ WAV๋ก ๋ณํ (16000Hz ์ํ ๋ ์ดํธ)
|
35 |
audio = AudioSegment.from_file(audio_path)
|
36 |
wav_audio_path = "converted_audio.wav"
|
37 |
-
audio.set_frame_rate(16000).export(wav_audio_path, format="wav")
|
38 |
|
39 |
return wav_audio_path
|
40 |
|
|
|
2 |
from google.cloud import speech_v1p1beta1 as speech
|
3 |
from pydub import AudioSegment
|
4 |
import io
|
|
|
5 |
import openai
|
6 |
+
import os
|
7 |
import gradio as gr
|
8 |
|
9 |
# ์ ํ๋ธ ๋น๋์ค ID ์ถ์ถ ํจ์
|
|
|
34 |
# ์ค๋์ค ํ์ผ์ WAV๋ก ๋ณํ (16000Hz ์ํ ๋ ์ดํธ)
|
35 |
audio = AudioSegment.from_file(audio_path)
|
36 |
wav_audio_path = "converted_audio.wav"
|
37 |
+
audio.set_frame_rate(16000).set_channels(1).export(wav_audio_path, format="wav")
|
38 |
|
39 |
return wav_audio_path
|
40 |
|