Voice_Commands / script.py
zinoubm's picture
finished setup
bb7af57
raw
history blame
413 Bytes
import os
from pydub import AudioSegment
path = "command_responses"
file_names = os.listdir(path)
res_path = "assets\command_responses"
for file_name in file_names:
m4a_file = file_name
wav_filename = os.path.splitext(file_name)[0] + ".wav"
track = AudioSegment.from_file(os.path.join(path, m4a_file), format="m4a")
file_handle = track.export(os.path.join(res_path, wav_filename), format="wav")