iracema.io.audiofile

Methods for reading and writing raw audio files.

iracema.io.audiofile.read(file_location)[source]

Read audio file from the local file system or download it from URL.

Parameters

file_location (str) – Path or URL to the file that will be loaded.

Returns

  • data (numpy array) – Audio data.

  • fs (int) – Sampling frequency.

  • file_name (str) – Base name of the loaded file.

iracema.io.audiofile.write(filename, data, fs)[source]

Write the contents of a data array to a WAVE file.

Parameters
  • filename (str) – Name of the audio file to be loaded.

  • data (numpy array) – Data array containing audio samples.

  • fs (int) – Sampling frequency.