This media is not supported in your browser
VIEW IN TELEGRAM
02:02
崔永元
2020年5月6号,随便聊,聊起欠骂的人忍不住脏话🤬往外跑。从做《实话实说》起,24/7,绝不冒一个脏字,就怕在节目中一不留神带出来……。 后来………。 https://t.co/221w28ZoY3
崔永元
2020年5月6号,随便聊,聊起欠骂的人忍不住脏话🤬往外跑。从做《实话实说》起,24/7,绝不冒一个脏字,就怕在节目中一不留神带出来……。 后来………。 https://t.co/221w28ZoY3
Media is too big
VIEW IN TELEGRAM
🎀置顶位招租 接广告推广🎀
榨汁机,这样的女人你能扛多久! https://t.co/FQcdJHgEIq
https://twitter.com/918nice/status/1259294779956883456
榨汁机,这样的女人你能扛多久! https://t.co/FQcdJHgEIq
https://twitter.com/918nice/status/1259294779956883456
This sounds like task for MoviePy. After you install it (installation howto) it could be used following way:
python
import os
from moviepy.editor import *
video = VideoFileClip(os.path.join("path","to","movie.mp4"))
video.audio.write_audiofile(os.path.join("path","to","movie_sound.mp3"))
Just replace "path","to","movie.mp4" and "path","to","movie_sound.mp3" accordingly to your needs.
import speech_recognition as sr
sr.__version__
r = sr.Recognizer()
harvard = sr.AudioFile('harvard.wav') >>> with harvard as source:
... audio = r.record(source)
...audio = r.record(source, offset=4, duration=3)
r.recognize_google(audio,language = 'zh-CN')
from os import path
from pydub import AudioSegment
# files
src = "transcript.mp3"
dst = "test.wav"
# convert wav to mp3
sound = AudioSegment.from_mp3(src)
sound.export(dst, format="wav")
import speech_recognition as sr
from os import path
from pydub import AudioSegment
# convert mp3 file to wav
sound = AudioSegment.from_mp3("transcript.mp3")
sound.export("transcript.wav", format="wav")
# transcribe audio file
AUDIO_FILE = "transcript.wav"
# use the audio file as the audio source
r = sr.Recognizer()
with sr.AudioFile(AUDIO_FILE) as source:
audio = r.record(source) # read the entire audio file
print("Transcription: " + r.recognize_google(audio))