Suparnpreet commited on
Commit
254fd6a
·
verified ·
1 Parent(s): b72b4d0

Update audioex.py

Browse files
Files changed (1) hide show
  1. audioex.py +23 -11
audioex.py CHANGED
@@ -13,18 +13,30 @@ def ex():
13
  print(mp4_file_path)
14
  os.rename(mp4_file_path, "video.mp4")
15
  print("Command started")
16
- try:
17
- result = subprocess.run(["sudo", "apt", "install", "ffmpeg"], capture_output=True, text=True, check=True,shell=True)
18
- print("FFmpeg installed successfully.")
19
- print("Command Output of ffmpeg:\n", result.stdout)
20
- except subprocess.CalledProcessError as e:
21
- print(f"Error installing FFmpeg: {e}")
22
- print(f"Return code: {e.returncode}")
23
- print(f"Output: {e.output}")
 
 
24
  command2mp3 = ["ffmpeg", "-i", "video.mp4", "speech.mp3"]
25
  result1 = subprocess.run(command2mp3, capture_output=True, text=True, check=True, shell=True)
26
- print("Command Output of mp3:\n", result1.stdout)
 
 
 
 
 
 
27
  command2wav = ["ffmpeg", "-i", "speech.mp3", "speech.wav"]
28
  result2 = subprocess.run(command2wav, capture_output=True, text=True, check=True, shell=True)
29
- print("Command Output of wav:\n", result2.stdout)
30
- print("Command ended")
 
 
 
 
 
13
  print(mp4_file_path)
14
  os.rename(mp4_file_path, "video.mp4")
15
  print("Command started")
16
+ try:
17
+ result = subprocess.run(["sudo", "apt", "install", "ffmpeg"], capture_output=True, text=True, check=True, shell=True)
18
+ print("FFmpeg installed successfully.")
19
+ print("Command Output of ffmpeg installation:\n", result.stdout)
20
+ except subprocess.CalledProcessError as e:
21
+ print(f"Error installing FFmpeg: {e}")
22
+ print(f"Return code: {e.returncode}")
23
+ print(f"Output: {e.output}")
24
+
25
+ try:
26
  command2mp3 = ["ffmpeg", "-i", "video.mp4", "speech.mp3"]
27
  result1 = subprocess.run(command2mp3, capture_output=True, text=True, check=True, shell=True)
28
+ print("Command Output of mp3 conversion:\n", result1.stdout)
29
+ except subprocess.CalledProcessError as e:
30
+ print(f"Error converting to MP3: {e}")
31
+ print(f"Return code: {e.returncode}")
32
+ print(f"Output: {e.output}")
33
+
34
+ try:
35
  command2wav = ["ffmpeg", "-i", "speech.mp3", "speech.wav"]
36
  result2 = subprocess.run(command2wav, capture_output=True, text=True, check=True, shell=True)
37
+ print("Command Output of wav conversion:\n", result2.stdout)
38
+ except subprocess.CalledProcessError as e:
39
+ print(f"Error converting to WAV: {e}")
40
+ print(f"Return code: {e.returncode}")
41
+ print(f"Output: {e.output}")
42
+ print("Command ended")