I have a aac file uploaded from http request.How can I transfom it into a wav file without writing it into a aac file on disk at first.
Here is my code:
with open(filepath, 'wb') as up:
up.write(file_metas[0]['body'])
cf = AudioSegment.from_file(filepath)
cf.export(wav_filepath, format="wav")
How can i get cf without writing file_metas[0]['body'] into a file.
I find a solution myself.I can use cStringIO model. It is a object that has the same interface with file, but its data is in memory.