auditok.io.WaveAudioSource

class auditok.io.WaveAudioSource(filename)[source]

An AudioSource class for reading data from a wave file.

This class is suitable for large wave files, allowing for efficient data handling without loading the entire file into memory.

Parameters:

filename (str or Path) – The path to a valid wave file.

__init__(filename)[source]

Methods

__init__(filename)

close()

Close audio source.

is_open()

Return True if audio source is open, False otherwise.

open()

Open audio source.

read(size)

Read and return up to size audio samples.

Attributes

ch

Number of channels in audio stream (alias for channels).

channels

Number of channels in audio stream.

sample_width

Number of bytes used to represent one audio sample.

sampling_rate

Number of samples per second of audio stream.

sr

Number of samples per second of audio stream (alias for sampling_rate).

sw

Number of bytes used to represent one audio sample (alias for sample_width).