https://www.youtube.com/watch?v=lbV2SoeAggU
Originally by NightStatic.
import numpy as np | |
from scipy.io.wavfile import write | |
sps = 44100 # Samples per Second | |
freq = 440 # Frequency is Hz | |
time = 5 # Duration of the audio in seconds | |
amp = 0.3 | |
# Create the Audio | |
samples = np.arange(time*sps) | |
waveform = amp * np.sin(2 * np.pi * samples * freq / sps) | |
waveform_int = np.int16(waveform) | |
write('wave.wav', sps, waveform_int) | |
print('Wavefile has been saved') |
https://www.youtube.com/watch?v=lbV2SoeAggU
Originally by NightStatic.