dev 4 pb audio

parent c340fe7f
...@@ -4,6 +4,7 @@ import os ...@@ -4,6 +4,7 @@ import os
import subprocess import subprocess
import math import math
import time import time
import shutil
def calculate_audio_volume(file_path): def calculate_audio_volume(file_path):
# 使用FFmpeg获取音频分贝值 # 使用FFmpeg获取音频分贝值
...@@ -45,9 +46,9 @@ def adjust_audio_volume(input_file, volume_adjustment): ...@@ -45,9 +46,9 @@ def adjust_audio_volume(input_file, volume_adjustment):
] ]
print(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>cg audio" + input_file + str(volume_adjustment)) print(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>cg audio" + input_file + str(volume_adjustment))
subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
time.sleep(1)
os.remove(input_file) os.remove(input_file)
os.rename(temp_path, input_file) # os.rename(temp_path, input_file)
shutil.move(temp_path, input_file)
def cg_wav(first_file_path, second_file_path, rate): def cg_wav(first_file_path, second_file_path, rate):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment