Skip to content

Commit 5190a9e

Browse files
committed
🎨 Update
1 parent 2e22e30 commit 5190a9e

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

speech-extraction/main.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import speech_recognition as sr
2+
import moviepy.editor as mp
3+
4+
clip = mp.VideoFileClip(r"video_recording.mov")
5+
6+
clip.audio.write_audiofile(r"converted.wav")
7+
8+
r = sr.Recognizer()
9+
10+
audio = sr.AudioFile("converted.wav")
11+
12+
13+
with audio as source:
14+
audio_file = r.record(source)
15+
result = r.recognize_google(audio_file)
16+
17+
with open("recognized.txt", mode="w") as file:
18+
file.write("Recognized Speech:")
19+
file.write("\n")
20+
file.write(result)
21+
print("ready!")

speech-extraction/recognized.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)