fix: remove audio channels
Some checks are pending
sync2gitee / repo-sync (push) Waiting to run
Typos Check / Spell Check with Typos (push) Waiting to run

This commit is contained in:
wxg0103 2024-12-18 11:24:31 +08:00
parent 0724fde7da
commit b2829963ab

View File

@ -150,7 +150,6 @@ def any_to_amr(any_path, amr_path):
raise NotImplementedError("Not support file type: {}".format(any_path))
audio = AudioSegment.from_file(any_path)
audio = audio.set_frame_rate(8000) # only support 8000
audio = audio.set_channels(1)
audio.export(amr_path, format="amr")
return audio.duration_seconds * 1000
@ -166,7 +165,6 @@ def any_to_mp3(any_path, mp3_path):
sil_to_wav(any_path, any_path)
any_path = mp3_path
audio = AudioSegment.from_file(any_path)
audio = audio.set_channels(1)
audio.export(mp3_path, format="mp3")