
ReadSecs ( float) – Total amount of sound data in seconds that has been fetched from the RecordedSecs ( float) – Total amount of recorded sound data (in seconds) since start of capture.

PositionSecs ( float) – Current stream playback position in seconds this loop. Value is in absolute system time and reported forĮlapsedOutSamples ( int) – Total number of samples submitted since the start of playback. RequestedStopTime ( float) – Stop time requested when starting the stream.ĮstimatedStopTime ( float) – Estimated stop time given requestedStopTime.ĬurrentStreamTime ( float) – Estimate of the time it will take for the most recently submitted sample Usually, this time corresponds to the time when the first StartTime ( float) – The actual (real) start time of audio playback or recording.ĬaptureStartTime ( float) – Estimate of the start time of audio capture. RequestedStartTime ( float) – Requested start time of the audio stream after the start of playback or State ( int) – State of the device, either 1 for playback, 2 for recording or 3 Users should never instance this class themselves unless they have goodĪctive ( bool) – True if playback or recording has started, else False. Other audio backends should try to populate these fields asīest they can with their equivalent status values. Properties of this class are standardized on the status information returnedīy Psychtoolbox. AudioDeviceStatus ( active = 0, state = 0, requestedStartTime = 0.0, startTime = 0.0, captureStartTime = 0.0, requestedStopTime = 0.0, estimatedStopTime = 0.0, currentStreamTime = 0.0, elapsedOutSamples = 0, positionSecs = 0.0, recordedSecs = 0.0, readSecs = 0.0, schedulePosition = 0.0, xRuns = 0, totalCalls = 0, timeFailed = 0, bufferSize = 0, cpuLoad = 0.0, predictedLatency = 0.0, latencyBias = 0.0, sampleRate = 48000, outDeviceIndex = 0, inDeviceIndex = 0, audioLib = 'Null Audio Library' ) ¶ĭescriptor for audio device status information.

Low and high output latency in milliseconds (low, high). True if this device is suitable for playback ( bool). True if this device is suitable for capture and playback ( bool). True if this device is suitable for capture ( bool). Low and high input latency in milliseconds (low, high). Human-readable name ( str) for the host API. Human-readable name ( str) for the audio device reported by the property deviceIndex ¶Įnumerated index ( int) of the audio device. Return typeĪudioDeviceInfo property defaultSampleRate ¶ĭefault sample rate in Hertz (Hz) for this device ( int). Parametersĭesc ( dict) – Audio device descriptor returned from Psychtoolbox’s get_devicesĪudio device descriptor with properties set using desc. static createFromPTBDesc ( desc ) ¶Ĭreate an AudioDevice instance with values populated using aĭescriptor ( dict) returned from the PTB audio.get_devices API call. start () # start recording sound property audioLib ¶Īudio library used to query device information ( str). Microphone ( device = recordingDevice ) mic.

getDevices () recordingDevice = recordingDevicesList # pass the descriptor to microphone to configure it mic = sound. # get the first suitable capture device found by the sound engine recordingDevicesList = sound. Properties of this descriptor (e.g., 'ptb' for Psychtoolbox). InputLatency ( tuple) – Low ( float) and high ( float) input latency in milliseconds.ĭefaultSampleRate ( int) – Default sample rate for the device in Hertz (Hz).ĪudioLib ( str) – Audio library that queried device information used to populate the InputChannels ( int) – Number of input channels. OutputLatency ( tuple) – Low ( float) and high ( float) output latency in milliseconds. OutputChannels ( int) – Number of output channels.

HostAPIName ( str) – Human-readable name of the host API used for audio. This number is specific to theĭeviceName ( str) – Human-readable name of the device. This class is usually instanced only by callingĪvoid creating instances of this class themselves unless they have goodĭeviceIndex ( int) – Enumerated index of the audio device. Properties associated with this class provide information about a specificĪudio playback or recording device. AudioDeviceInfo ( deviceIndex = - 1, deviceName = 'Null Device', hostAPIName = 'Null Audio Driver', outputChannels = 0, outputLatency = 0.0, 0.0, inputChannels = 0, inputLatency = 0.0, 0.0, defaultSampleRate = 48000, audioLib = '' ) ¶ĭescriptor for an audio device (playback or recording) on this system.
