f5tts/app/w4a2wav.py

15 lines
272 B
Python
Raw Normal View History

2024-12-19 16:50:53 +08:00
import os
import sys
from pydub import AudioSegment
if len(sys.argv) < 2:
exit(1)
m4afn = sys.argv[1]
wavfn = m4afn[:-3] + 'wav'
# Load the m4a file
audio = AudioSegment.from_file(m4afn, format="m4a")
# Export the audio as a wav file
audio.export(wavfn, format="wav")