SUHHHH commited on
Commit
91fe522
โ€ข
1 Parent(s): 5d64735

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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