June 2025
Intermediate to advanced
515 pages
17h 5m
English
SciPy has many submodules, classes, and functions that you can use to read and write data from various file formats (e.g., MATLAB or Fortran files). This section focuses on the treatment of the write() and read() functions of the io submodule for saving and reading sound files in the WAV format.
The write(filename,rate,data) function expects three arguments when called: The first parameter filename creates a wav file from a NumPy array. As the second argument, the function expects the sampling rate rate. The third parameter (data) expects a NumPy array containing the sampled audio signals.
Listing 6.27 produces the concert pitch A (440 Hz). A program that can play ...
Read now
Unlock full access