Engage Engine API
1.244.9084
|
Custom Audio Devices. More...
#include <stdint.h>
Go to the source code of this file.
Macros | |
#define | ENGAGE_API __attribute__ ((visibility ("default"))) |
Typedefs | |
typedef int(* | PFN_ENGAGE_AUDIO_DEVICE_CTL) (int16_t deviceId, int16_t instanceId, EngageAudioDeviceCtlOp_t op, uintptr_t p1) |
Audio Device Control instance pointer. | |
Enumerations | |
enum | EngageAudioDeviceCtlOp_t { eadCreateInstance = 1 , eadDestroyInstance , eadStart , eadStop , eadPause , eadResume , eadReset , eadRestart } |
Audio Device Control Operation enum. More... | |
Functions | |
ENGAGE_API int16_t | engageAudioDeviceRegister (const char *jsonConfiguration, PFN_ENGAGE_AUDIO_DEVICE_CTL pfnCtl) |
[SYNC] Registers an Audio Device with the Engine | |
ENGAGE_API int16_t | engageAudioDeviceUnregister (int16_t deviceId) |
[SYNC] Unregisters a virtual audio device | |
ENGAGE_API int16_t | engageAudioDeviceWriteBuffer (int16_t deviceId, int16_t instanceId, const int16_t *buffer, size_t samples) |
[SYNC] Writes a buffer of audio to the audio device | |
ENGAGE_API int16_t | engageAudioDeviceReadBuffer (int16_t deviceId, int16_t instanceId, int16_t *buffer, size_t samples) |
[SYNC] Reads a buffer of audio from the audio device | |
Variables | |
static const int | ENGAGE_AUDIO_DEVICE_RESULT_OK = 0 |
Everything is fine. | |
static const int | ENGAGE_AUDIO_DEVICE_GENERAL_ERROR = -1 |
A general error occurred. | |
static const int | ENGAGE_AUDIO_DEVICE_INVALID_CONFIGURATION = -2 |
Unable to register device due to invalid configuration. | |
static const int | ENGAGE_AUDIO_DEVICE_INVALID_DEVICE_ID = -3 |
Invalid deviceId. | |
static const int | ENGAGE_AUDIO_DEVICE_INVALID_INSTANCE_ID = -4 |
Invalid instanceId. | |
static const int | ENGAGE_AUDIO_DEVICE_INVALID_COMBINED_DEVICE_ID_AND_INSTANCE_ID = -5 |
Invalid deviceId and instanceId. | |
static const int | ENGAGE_AUDIO_DEVICE_INVALID_OPERATION = -6 |
An invalid operation has been attempted. | |
Custom Audio Devices.
TODO: Shaun, can you please review this whole file?
Definition in file EngageAudioDevice.h.
#define ENGAGE_API __attribute__ ((visibility ("default"))) |
Definition at line 31 of file EngageAudioDevice.h.
typedef int(* PFN_ENGAGE_AUDIO_DEVICE_CTL) (int16_t deviceId, int16_t instanceId, EngageAudioDeviceCtlOp_t op, uintptr_t p1) |
Audio Device Control instance pointer.
TODO: Shaun, want to add something?
Definition at line 119 of file EngageAudioDevice.h.
Audio Device Control Operation enum.
More detailed enum description.
Definition at line 39 of file EngageAudioDevice.h.
ENGAGE_API int16_t engageAudioDeviceReadBuffer | ( | int16_t | deviceId, |
int16_t | instanceId, | ||
int16_t * | buffer, | ||
size_t | samples ) |
[SYNC] Reads a buffer of audio from the audio device
TODO:Shaun, do we need any more details on the size of the buffer and samples calculation?
deviceId | device identifier returned by engageAudioDeviceRegister |
instanceId | instance identifier |
buffer | Pointer to a buffer containing the audio |
samples | The number of samples contained in the buffer |
ENGAGE_API int16_t engageAudioDeviceRegister | ( | const char * | jsonConfiguration, |
PFN_ENGAGE_AUDIO_DEVICE_CTL | pfnCtl ) |
[SYNC] Registers an Audio Device with the Engine
The jsonConfiguration JSON configuration object contains the configuration for the virtual audio device and the pfnCtl is a pointer to a control structure used to manage the audio device instance.
jsonConfiguration | pointer to JSON Audio Device configuration object ConfigurationObjects::AudioDeviceDescriptor |
pfnCtl | pointer to an Audio Device Control instance |
ENGAGE_API int16_t engageAudioDeviceUnregister | ( | int16_t | deviceId | ) |
[SYNC] Unregisters a virtual audio device
Unregisters the virtual audio device created by engageAudioDeviceRegister
deviceId | device identifier returned engageAudioDeviceRegister |
ENGAGE_API int16_t engageAudioDeviceWriteBuffer | ( | int16_t | deviceId, |
int16_t | instanceId, | ||
const int16_t * | buffer, | ||
size_t | samples ) |
[SYNC] Writes a buffer of audio to the audio device
TODO:Shaun, do we need any more details on the size of the buffer and samples calculation?
deviceId | device identifier returned by engageAudioDeviceRegister |
instanceId | instance identifier |
buffer | Pointer to a buffer containing the audio |
samples | The number of samples contained in the buffer |
|
static |
A general error occurred.
This could be due to a number of reasons. See debug output logs for more information.
Definition at line 77 of file EngageAudioDevice.h.
|
static |
Invalid deviceId and instanceId.
Both deviceId and instanceId used are no longer valid. See debug output logs for more information.
Definition at line 105 of file EngageAudioDevice.h.
|
static |
Unable to register device due to invalid configuration.
This could be due to a number of reasons. See debug output logs for more information.
Definition at line 84 of file EngageAudioDevice.h.
|
static |
Invalid deviceId.
The deviceId used is no longer valid. See debug output logs for more information.
Definition at line 91 of file EngageAudioDevice.h.
|
static |
Invalid instanceId.
The instanceId used is no longer valid. See debug output logs for more information.
Definition at line 98 of file EngageAudioDevice.h.
|
static |
An invalid operation has been attempted.
An invalid operation was attempted, please make sure you use a valid operation from EngageAudioDeviceCtlOp_t enum and that the device is in the correct state. See debug output logs for more information.
Definition at line 112 of file EngageAudioDevice.h.
|
static |
Everything is fine.
The operation executed without any errors.
Definition at line 70 of file EngageAudioDevice.h.