Class HardwareController#

class pyscab.HardwareController.CallbackParams[source]#

Bases: object

class 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.

init()[source]#

initialize all parameters hold by CallbackParams instance.

class pyscab.HardwareController.HardwareInformation(pya)[source]#

Bases: object

get 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.

get_output_device_with_name(device_name)[source]#

get device information by name.

Parameters
device_namestr

name of the device.

Returns
devicepyaudio.PaDeviceInfo
class pyscab.HardwareController.ReadAudioChunk(data, chunk_size, ch, volume=1.0, format=dtype('int16'), idx_obj=None)[source]#

Bases: object

reading 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.

is_finished()

check if it's finished

read_chunk()

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.

is_finished()[source]#

check if it’s finished

Returns
is_finishedbool

True if all data already been read, False if there’s remained data.

read_chunk()[source]#

read audio data by chunk.

Returns
chunk_datanumpy.ndarray

chunk data which have a shape of (chunk size, number of channels)

pyscab.HardwareController.callback(in_data, frame_count, time_info, status, p=<pyscab.HardwareController.CallbackParams object>)[source]#
pyscab.HardwareController.get_available_devices()[source]#

print available devices connected to the computer.