Acoular 24.05 documentation

SoundDeviceSamplesGenerator

«  sdinput   ::   sdinput   ::   signals  »

SoundDeviceSamplesGenerator

class acoular.sdinput.SoundDeviceSamplesGenerator

Bases: SamplesGenerator

Controller for sound card hardware using sounddevice library.

Uses the device with index device to read samples from input stream, generates output stream via the generator result().

device = Int(0, desc='input device index')

input device index, refers to sounddevice list

numchannels = Long(1, desc='number of analog input channels that collects data')

Number of input channels, maximum depends on device

collectsamples = Bool(True, desc='Indicates if samples are collected')

Indicates if samples are collected, helper trait to break result loop

sample_freq = Property(desc='sampling frequency')

Sampling frequency of the signal, changes with sinusdevices

overflow = Bool(False, desc='Indicates if sounddevice buffer overflow')

Indicates that the sounddevice buffer has overflown

running = Bool(False, desc='Indicates that the stream is collecting samples')

Indicates that the stream is collecting samples

stream = Any

The sounddevice InputStream object for inspection

device_properties()
Returns:
Dictionary of device properties according to sounddevice
result(num)

Python generator that yields the output block-wise. Use at least a block-size of one ring cache block.

Parameters:
numinteger

This parameter defines the size of the blocks to be yielded (i.e. the number of samples per block).

Returns:
Samples in blocks of shape (num, numchannels).

The last block may be shorter than num.

«  sdinput   ::   sdinput   ::   signals  »