music.play_audio¶
- music.play_audio(sonic_vector, sample_rate=44100, normalize=True)[source]¶
Play a sonic vector using the
sounddevicelibrary.- Parameters:
- sonic_vectorarray_like
Samples to be played. Mono arrays should have shape
(n,)and stereo arrays(2, n).- sample_rate
int,optional Playback sample rate. Defaults to
44100.- normalizebool,
optional If
True(default), normalizesonic_vectorbefore playback usingnormalize_mono()ornormalize_stereo().
- Parameters:
- Return type:
None
Notes
If the
sounddevicemodule is not installed, this function logs a warning and returns without playing anything.