0
$\begingroup$

I would like to make an autoencoder for music generation using PyTorch. In input, I would like to have a Waveform (from a .wav file) and I want the output to be a Waveform. My problem is that I don't know how to get a .wav file from a waveform that is the output... Does anybody have an idea?

$\endgroup$

2 Answers 2

0
$\begingroup$

Python has a soundfile package. There's also scipy.io.wavfile

$\endgroup$
0
$\begingroup$

In MATLAB you can create a .wav file waveFileName.wav from a waveform y with sampling frequency Fs using MATLAB's audiowrite as follows:

filename = 'waveFileName.wav';
audiowrite(filename,y,Fs);

You can also read and output a waveform y and its sampling frequency Fs from the .wav file waveFileName.wav using MATLAB's audioread as follows.

[y,Fs] = audioread('waveFileName.wav');

I am sure there must be corresponding functions in Python.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.