auditok.io.player_for

auditok.io.player_for(source)[source]

Return an AudioPlayer compatible with the specified source.

This function creates an AudioPlayer instance (currently only PyAudioPlayer is implemented) that matches the audio properties of the provided source, ensuring compatibility in terms of sampling rate, sample width, and number of channels.

Parameters:

source (AudioSource) – An object with sampling_rate, sample_width, and channels attributes.

Returns:

An audio player with the same sampling rate, sample width, and number of channels as source.

Return type:

PyAudioPlayer