UOdinAudioCapture
- Header:
#include "OdinAudio/OdinAudioCapture.h" - Module:
Odin - Inherits from:
UAudioCapture,FTickableGameObject - Blueprint: Blueprint type, Blueprintable · Blueprint reference
Overview
Functions
| Name | Description |
|---|---|
GetCaptureDevicesAvailable | Returns all available capture devices with the device id. |
GetCurrentAudioCaptureDevice | Returns info on the current capture device. |
ChangeToDefaultCaptureDevice | Changes the current capture device to the system default and restarts the capture stream. |
ChangeCaptureDeviceById | Updates the capture device and restarts the capture stream of the Audio Capture object. |
StartCapturing | Starts Capturing Audio and returns whether capturing was started successfully. |
ChangeCaptureDeviceByName | Updates the capture device and restarts the capture stream of the Audio Capture object. |
IsStreamOpen | Get whether the stream is currently open. |
GetStreamTime | Get the stream time of the audio capture stream. |
RestartCapturing | Restart the stream, using CurrentSelectedDeviceIndex as the new capture device. |
GetTryRecognizingDeviceDisconnected | Whether capture device disconnect is being recognized automatically. |
SetTryRecognizingDeviceDisconnected | Sets automatic recognition of capture device disconnects (i.e. |
Events
| Name | Description |
|---|---|
OnCaptureDeviceReset | Will be called, if ODIN recognizes that the selected capture device does not supply data anymore, i.e. |
OnDefaultDeviceChanged | Will be called, if the Default Device is the currently selected and if the Default Device was switched by the system. |
OnCaptureDeviceChanged | Raised after the capture device changed, e.g. |
Functions
GetCaptureDevicesAvailable
Blueprint: Get Capture Devices Available
Returns all available capture devices with the device id. Only usable in GameThread.
IMPORTANT! Should not be used in tick or on a regular basis because it could lead to stuttering.
| Parameter | Type | Description |
|---|---|---|
OutDevices | TArray<FOdinCaptureDeviceInfo>& | All available capture devices |
GetCurrentAudioCaptureDevice
Const · Blueprint: Get Current Audio Capture Device
Returns info on the current capture device. Only usable in GameThread.
IMPORTANT! Should not be used in tick or on a regular basis because it could lead to stuttering.
| Parameter | Type | Description |
|---|---|---|
CurrentDevice | FOdinCaptureDeviceInfo& | Info on the current capture device |
ChangeToDefaultCaptureDevice
Blueprint: Change to Default Capture Device
Changes the current capture device to the system default and restarts the capture stream. Only usable in GameThread.
ChangeCaptureDeviceById
Blueprint: Change Capture Device by Id
Updates the capture device and restarts the capture stream of the Audio Capture object. Only usable in GameThread.
IMPORTANT! Should not be used in tick or on a regular basis because it could lead to stuttering.
| Parameter | Type | Description |
|---|---|---|
NewDeviceId | FString | The id of the targeted capture device. |
bSuccess | bool& | Whether the capture device was successfully changed |
StartCapturing
Blueprint: Start Capturing
Starts Capturing Audio and returns whether capturing was started successfully.
| Parameter | Type | Description |
|---|---|---|
bSuccess | bool& | True if capturing was started successfully. |
ChangeCaptureDeviceByName
Blueprint: Change Capture Device by Name
Updates the capture device and restarts the capture stream of the Audio Capture object. Only usable in GameThread.
IMPORTANT! Should not be used in tick or on a regular basis because it could lead to stuttering.
| Parameter | Type | Description |
|---|---|---|
DeviceName | FName | The name of the targeted capture device. Needs to be an exact match. |
bSuccess | bool& | Whether or not the capture device was successfully changed |
IsStreamOpen
Const · Blueprint: Is Stream Open
Get whether the stream is currently open. Only usable in GameThread.
Returns bool – Returns true if capturing audio
GetStreamTime
Const · Blueprint: Get Stream Time
Get the stream time of the audio capture stream. Only usable in GameThread.
Returns float – Time the stream was active.
RestartCapturing
Blueprint: Restart Capturing
Restart the stream, using CurrentSelectedDeviceIndex as the new capture device. Only usable in GameThread.
| Parameter | Type | Description |
|---|---|---|
bAutomaticallyStartCapture | bool | Whether to auto-start capturing (default true). Default: true. |
Returns bool – Success.
GetTryRecognizingDeviceDisconnected
Const
Whether capture device disconnect is being recognized automatically.
Returns bool – True, if automatic disconnection recognition is active, false otherwise.
SetTryRecognizingDeviceDisconnected
Sets automatic recognition of capture device disconnects (i.e. if a capture device was removed). Can accidentally recognize disconnects if app experiences large frame times (greater than AllowedTimeWithoutStreamUpdate value)
| Parameter | Type | Description |
|---|---|---|
bTryRecognizing | bool | New value for whether automatic recognition of disconnects is active. |
Events
OnCaptureDeviceReset
Blueprint: On Capture Device Reset
Will be called, if ODIN recognizes that the selected capture device does not supply data anymore, i.e. if a microphone was unplugged. ODIN will wait for AllowedTimeWithoutStreamUpdate seconds, before trying a stream restart.
Signature: FCaptureDeviceChange void() (multicast)
OnDefaultDeviceChanged
Blueprint: On Default Device Changed
Will be called, if the Default Device is the currently selected and if the Default Device was switched by the system.
Signature: FCaptureDeviceChange void() (multicast)
OnCaptureDeviceChanged
Blueprint: On Capture Device Changed
Raised after the capture device changed, e.g. through Change Capture Device By Id or after the default device changed.
Signature: FCaptureDeviceChangedWithDetails void(const FOdinCaptureDeviceInfo& PreviousDevice, const FOdinCaptureDeviceInfo& NewDevice) (multicast)