Engage Engine API  1.246.9086
Loading...
Searching...
No Matches
EngageAudioDevice.h
Go to the documentation of this file.
1//
2// Copyright (c) 2019 Rally Tactical Systems, Inc.
3// All rights reserved.
4//
11#ifndef EngageAudioDevice_h
12#define EngageAudioDevice_h
13
14#include <stdint.h>
15
16
17#ifdef __cplusplus
18extern "C"
19{
20#endif
21
22#if !defined(ENGAGE_API)
23 #if defined(WIN32)
24 #ifdef ENGAGE_EXPORTS
25 // Windows needs dllexport to produce an import lib without a .DEF file
26 #define ENGAGE_API __declspec(dllexport) extern
27 #else
28 #define ENGAGE_API extern
29 #endif
30 #else
31 #define ENGAGE_API __attribute__ ((visibility ("default")))
32 #endif
33#endif
34
64
70static const int ENGAGE_AUDIO_DEVICE_RESULT_OK = 0;
71
78
85
92
99
106
113
119typedef int (*PFN_ENGAGE_AUDIO_DEVICE_CTL)(int16_t deviceId, int16_t instanceId, EngageAudioDeviceCtlOp_t op, uintptr_t p1);
120
131ENGAGE_API int16_t engageAudioDeviceRegister(const char *jsonConfiguration, PFN_ENGAGE_AUDIO_DEVICE_CTL pfnCtl);
132
142ENGAGE_API int16_t engageAudioDeviceUnregister(int16_t deviceId);
143
155ENGAGE_API int16_t engageAudioDeviceWriteBuffer(int16_t deviceId, int16_t instanceId, const int16_t *buffer, size_t samples);
156
168ENGAGE_API int16_t engageAudioDeviceReadBuffer(int16_t deviceId, int16_t instanceId, int16_t *buffer, size_t samples);
169
170#ifdef __cplusplus
171}
172#endif
173#endif // EngageAudioDevice_h
static const int ENGAGE_AUDIO_DEVICE_GENERAL_ERROR
A general error occurred.
static const int ENGAGE_AUDIO_DEVICE_INVALID_OPERATION
An invalid operation has been attempted.
static const int ENGAGE_AUDIO_DEVICE_RESULT_OK
Everything is fine.
EngageAudioDeviceCtlOp_t
Audio Device Control Operation enum.
@ eadStart
Start playback.
@ eadPause
Pause playback
@ eadResume
Resume playback.
@ eadStop
Stop playback.
@ eadRestart
Restart an audio device - TODO:Shaun.
@ eadDestroyInstance
Destroy an audio device instance.
@ eadCreateInstance
Create an audio device instance.
@ eadReset
Reset an audio device - TODO:Shaun.
int(* PFN_ENGAGE_AUDIO_DEVICE_CTL)(int16_t deviceId, int16_t instanceId, EngageAudioDeviceCtlOp_t op, uintptr_t p1)
Audio Device Control instance pointer.
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
static const int ENGAGE_AUDIO_DEVICE_INVALID_DEVICE_ID
Invalid deviceId.
static const int ENGAGE_AUDIO_DEVICE_INVALID_COMBINED_DEVICE_ID_AND_INSTANCE_ID
Invalid deviceId and instanceId.
ENGAGE_API int16_t engageAudioDeviceUnregister(int16_t deviceId)
[SYNC] Unregisters a virtual audio device
ENGAGE_API int16_t engageAudioDeviceRegister(const char *jsonConfiguration, PFN_ENGAGE_AUDIO_DEVICE_CTL pfnCtl)
[SYNC] Registers an Audio Device with the Engine
static const int ENGAGE_AUDIO_DEVICE_INVALID_CONFIGURATION
Unable to register device due to invalid configuration.
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
static const int ENGAGE_AUDIO_DEVICE_INVALID_INSTANCE_ID
Invalid instanceId.