pydub -wav 音频拼接

# -*- coding:utf8 -*-\
from pydub import AudioSegment
input_music_1 = AudioSegment.from_wav("1.wav")
input_music_2 = AudioSegment.from_wav("2.wav")
input_music_1_db = input_music_1.dBFS
input_music_2_db = input_music_2.dBFS
# 获取两个音频的时长,单位为毫秒
input_music_1_time = len(input_music_1)
input_music_2_time = len(input_music_2)
# 调整两个音频的响度一致
db = input_music_1_db - input_music_2_db
if db > 0:
    input_music_1 += db
elif db < 0:
    input_music_2 += db
# 合并音频
output_music = input_music_1 + input_music_2
# 简单输入合并之后的音频
output_music.export("./output_music.wav", format="wav")
讨论数量: 0
(= ̄ω ̄=)··· 暂无内容!

请勿发布不友善或者负能量的内容。与人为善,比聪明更重要!