File size: 413 Bytes
bb7af57
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
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")