In my system i have to list all the wav files from one folder and then i have to bind that files as one file. I have the code to bind two files but i have 8 or more sound file i have to bind those file. Anybody can you help me? Stackoverflow solution have merge only two audio file. I have to merge lot of audio file from the folder. I don't know how many audio file will come into that folder.
this code is bind two files:
print(glob.glob('upload/updated_audios/*.wav'))
file_data = glob.glob('upload/convertedAudio/*.wav')
outfile = "upload/output_files/output.wav"
data = []
for infile in file_data:
w = wave.open(infile, 'rb')
data.append([w.getparams(), w.readframes(w.getnframes())])
w.close()
output = wave.open(outfile, 'wb')
output.setparams(data[0][0])
output.writeframes(data[0][1])
output.writeframes(data[1][1])
output.close()