IO¶
spokestack.io.pyaudio¶
This module uses pyaudio for input and output processing
-
class
spokestack.io.pyaudio.
PyAudioInput
(sample_rate, frame_width, exception_on_overflow=True, **kwargs)[source]¶ This class retrieves audio from an input device
- Parameters
sample_rate (int) – desired sample rate for input (Hz)
frame_width (int) – desired frame width for input (ms)
exception_on_overflow (bool) – produce exception for input overflow
-
property
is_active
¶ Stream active property
- Returns
‘True’ if stream is active, ‘False’ otherwise
- Return type
bool
-
property
is_stopped
¶ Stream stopped property
- Returns
‘True’ if stream is stopped, ‘False’ otherwise
- Return type
bool
-
class
spokestack.io.pyaudio.
PyAudioOutput
(num_channels=1, sample_rate=24000, frames_per_buffer=1024)[source]¶ Outputs audio to the default system output
- Parameters
num_channels (int) – number of audio channels
sample_rate (int) – sample rate of the audio (Hz)
frames_per_buffer (int) – number of audio samples to buffer on the output device