Class HardwareController#
- class pyscab.HardwareController.CallbackParams[source]#
Bases:
objectclass for referencing parameters of callback function of portaudio.
- Attributes
- datalist of pyscab.ReadAudioChunk
containing audio data to play.
- data_finishedlist of bool
True if all audio data in attribute data which has corresponding index were played.
Methods
init()initialize all parameters hold by CallbackParams instance.
- class pyscab.HardwareController.HardwareInformation(pya)[source]#
Bases:
objectget hardware information of audio devices.
- Attributes
- devicesdict
containes device name and maximum number of output channels of each device. keys : ‘name’, ‘maxOutputChannels’
Methods
get_output_device_with_name(device_name)get device information by name.
- class pyscab.HardwareController.ReadAudioChunk(data, chunk_size, ch, volume=1.0, format=dtype('int16'), idx_obj=None)[source]#
Bases:
objectreading audio data by chunk.
- Attributes
- datanumpy.ndarray
audio data.
- n_ch_dataint
number of channels of audio data
- n_framesint
number of frames of audio data
- chunk_sixeint
chunk size.
- chlist of int
channel number of device which audio data will be played.
- formatnumpy.dtype
audio data format
- finishedBool
If True, all audio data have already been read. If False, there’s remained data.
- idx_objint
id of instance.
Methods
get_ch()get channel number to play the audio data.
check if it's finished
read audio data by chunk.
- get_ch()[source]#
get channel number to play the audio data.
- Returns
- channellist of int
channel number which audio data will be played.