Skip to content

Recording

speaker_calibration.recording

Moku

Bases: RecordingDevice

This class is an implementation of the RecordingDevice class for a Moku device.

Attributes:

Name Type Description
address int

The address of the Moku device being used.

record_signal(duration, channel=1, start_event=None, result=None, filename='file')

Records the signal with a Moku device.

Parameters:

Name Type Description Default
duration float

The duration of the acquisition (s).

required
channel int

The channel to acquire from.

1
start_event Event

A thread event used to synchronize the start of the sound with the start of the recording. If start_event is not provided, the sound will play as soon as possible.

None
result list

A list to which the acquired signal will be appended.

None
filename str

The path to the file that will be saved with the acquired signal.

'file'

NiDaq

Bases: RecordingDevice

This class is an implementation of the RecordingDevice class for the Ni-DAQ.

Attributes:

Name Type Description
device_id int

The device ID of the Ni-DAQ being used.

record_signal(duration, ai_pin=1, start_event=None, result=None, filename='file')

Records the signal with the NI-DAQ.

Parameters:

Name Type Description Default
duration float

The duration of the acquisition (s).

required
ai_pin int

The analog input pin to acquire from.

1
start_event Event

A thread event used to synchronize the start of the sound with the start of the recording. If start_event is not provided, the sound will play as soon as possible.

None
result list

A list to which the acquired signal will be appended.

None
filename str

The path to the file that will be saved with the acquired signal.

'file'

RecordingDevice

Bases: ABC

The class representing an abstract recording device from which to implement specific ones.

Attributes:

Name Type Description
fs float | int

The sampling frequency of the recording device.

record_signal(duration) abstractmethod

Records the desired signal. This is the abstract method to be implemented for the specific recording devices that derive from this abstract class.