Spaces:
Runtime error
Runtime error
Suparnpreet
commited on
Commit
•
8db6f99
1
Parent(s):
dd89fa4
Update audioex.py
Browse files- audioex.py +3 -0
audioex.py
CHANGED
@@ -3,6 +3,7 @@ import os
|
|
3 |
import shutil
|
4 |
|
5 |
def ex():
|
|
|
6 |
video_directory = os.getcwd()
|
7 |
video_files = [f for f in os.listdir(video_directory) if f.endswith(".mp4")]
|
8 |
for mp4_file in video_files:
|
@@ -10,8 +11,10 @@ def ex():
|
|
10 |
mp4_file_path = os.path.join(video_directory, mp4_file)
|
11 |
print(mp4_file_path)
|
12 |
os.rename(mp4_file_path, "video.mp4")
|
|
|
13 |
subprocess.run("sudo apt install ffmpeg", shell=True)
|
14 |
command2mp3 = "ffmpeg -i video.mp4 speech.mp3"
|
15 |
command2wav = "ffmpeg -i speech.mp3 speech.wav"
|
16 |
subprocess.run(command2mp3, shell=True)
|
17 |
subprocess.run(command2wav, shell=True)
|
|
|
|
3 |
import shutil
|
4 |
|
5 |
def ex():
|
6 |
+
print("Started ex")
|
7 |
video_directory = os.getcwd()
|
8 |
video_files = [f for f in os.listdir(video_directory) if f.endswith(".mp4")]
|
9 |
for mp4_file in video_files:
|
|
|
11 |
mp4_file_path = os.path.join(video_directory, mp4_file)
|
12 |
print(mp4_file_path)
|
13 |
os.rename(mp4_file_path, "video.mp4")
|
14 |
+
print("Command started")
|
15 |
subprocess.run("sudo apt install ffmpeg", shell=True)
|
16 |
command2mp3 = "ffmpeg -i video.mp4 speech.mp3"
|
17 |
command2wav = "ffmpeg -i speech.mp3 speech.wav"
|
18 |
subprocess.run(command2mp3, shell=True)
|
19 |
subprocess.run(command2wav, shell=True)
|
20 |
+
print("Command ended")
|