SOUND4 BIGVOICE.CL Library [2.0.0]
Loading...
Searching...
No Matches
sound4.bigvoice.cl.h
Go to the documentation of this file.
1
4#pragma once
5
6#ifdef __unix__
7 #include <sys/types.h>
8 #define BIGVOICE_DECL __attribute__ ((visibility ("default")))
9#elif defined(_WIN32) || defined(WIN32)
10 #include <windows.h>
11 #ifdef BUILDING_BIGVOICE_DLL
12 #define BIGVOICE_DECL __declspec(dllexport)
13 #else
14 #define BIGVOICE_DECL __declspec(dllimport)
15 #endif
16 #ifdef _MSC_VER
17 #pragma warning(disable : 4996)
18 #endif
19#elif defined(__APPLE__)
20 #include <sys/types.h>
21 #define BIGVOICE_DECL __attribute__ ((visibility ("default")))
22#endif
23#include <stdint.h>
24
25#define BIGVOICE_HAS_WEBSERVER 1
26#define BIGVOICE_HAS_CLOUDBUS 1
27
28#ifdef __cplusplus
29extern "C" {
30#endif // __cplusplus
31
32// --------------------------------------------------------------
46#define BIGVOICE_AUDIOFRAME_COUNT 12
52#define BIGVOICE_CHANNEL_COUNT 1
58#define BIGVOICE_AUDIO_INPUT_COUNT 1
64#define BIGVOICE_AUDIO_OUTPUT_COUNT 1
70#define BIGVOICE_SAMPLE_RATE 48000
71
78 size_t struct_size;
79 const char *name;
80 const char *prefix;
81 const char *shortname;
82 const char *version;
83};
84
93
100
114
124
133
143
153
162
178
185typedef void (*bigvoice_loggerfn) (enum bigvoice_LogSeverity, const char *);
186
198
207
210// --------------------------------------------------------------
218// --------------------------------------------------------------
222struct bigvoice_CInstance;
223
228
237
242
254BIGVOICE_DECL void bigvoice_SetParameter(struct bigvoice_CParameters *params, const char *name, const char *value);
255
261BIGVOICE_DECL const char *bigvoice_GetParameter(struct bigvoice_CParameters *params, const char *name);
262
269
278 const char *LoginKey,
279 const char *RadioName,
280 const char *Access_Key_ID,
281 const char *Access_Key_Secret,
282 const char *save_path
283 );
284
293 const char *LoginKey,
294 const char *RadioName,
295 const char *Access_Key_ID,
296 const char *Access_Key_Secret,
297 const char *save_path,
298 const struct bigvoice_CParameters *parameters
299 );
300
329 const char *LoginKey,
330 const char *RadioName,
331 const char *Access_Key_ID,
332 const char *Access_Key_Secret,
333 const char *save_path,
334 const struct bigvoice_CParameters *parameters,
335 unsigned int frames_per_chunk
336 );
337
350
361
368
371#if BIGVOICE_HAS_CLOUDBUS
372// --------------------------------------------------------------
382struct bigvoice_CBus;
383
390
397
408
409
411#endif // BIGVOICE_HAS_CLOUDBUS
412
413// --------------------------------------------------------------
414// Tracing (Windows only)
415// --------------------------------------------------------------
416#ifdef _WIN32
417#ifndef TLG_HAVE_EVENT_SET_INFORMATION // TraceLoggingProvider.h has not been included
418 struct _tlgProvider_t;
419 typedef struct _tlgProvider_t const* TraceLoggingHProvider;
420#endif // !TLG_HAVE_EVENT_SET_INFORMATION
421// --------------------------------------------------------------
436BIGVOICE_DECL void bigvoice_SetInstanceTracing(struct bigvoice_CParameters *params, TraceLoggingHProvider tracing_provider, GUID activity_guid);
437
446
448#endif // _WIN32
449
450// --------------------------------------------------------------
473// --------------------------------------------------------------
474
475// OS dependent filesystem path char type
476#ifdef _WIN32
477 typedef wchar_t fs_char;
478#else // !_WIN32
479 typedef char fs_char;
480#endif // !_WIN32
481
489typedef char * (*bigvoice_storage_reader) (const fs_char *filename, void* userdata);
490
497typedef void (*bigvoice_storage_reader_free) (char *content, void* userdata);
498
507typedef int (*bigvoice_storage_writer) (const fs_char *filename, const char *content, void* userdata);
508
516typedef int (*bigvoice_storage_exists) (const fs_char *filename, void* userdata);
517
525typedef fs_char** (*bigvoice_storage_getall) (void* userdata);
526
533typedef void (*bigvoice_storage_getall_free) (fs_char**all, void* userdata);
534
542typedef int (*bigvoice_storage_remove) (const fs_char *filename, void* userdata);
543
552typedef int (*bigvoice_storage_rename) (const fs_char *from, const fs_char *to, void* userdata);
553
578 , int IsReadOnly
579 , void* userdata
580 );
581
590
600
603// --------------------------------------------------------------
611// --------------------------------------------------------------
612
629BIGVOICE_DECL void bigvoice_SetMetadata(struct bigvoice_CInstance *instance, const char* key, const char* value);
630
641BIGVOICE_DECL void bigvoice_SetMetadataMulti(struct bigvoice_CInstance *instance, const char** keyvalue);
642
651
658BIGVOICE_DECL void bigvoice_FreeMetadataInfos(struct bigvoice_CInstance *instance, const char** infos);
659
662// --------------------------------------------------------------
669// --------------------------------------------------------------
670
683BIGVOICE_DECL void bigvoice_StartUpdateThread(struct bigvoice_CInstance *instance, unsigned int port);
684
691
700
703// --------------------------------------------------------------
710// --------------------------------------------------------------
732BIGVOICE_DECL void bigvoice_ProcessAudio(struct bigvoice_CInstance *instance, const float *input, float *output );
733
753 , float const * const *input
754 , float * const *output);
755
769
783
794
797// --------------------------------------------------------------
807// --------------------------------------------------------------
812 char *id;
814 unsigned int sample_rate;
815 unsigned int channel_count;
816 const float *buffer;
817};
818
827
834
845
857BIGVOICE_DECL unsigned int bigvoice_GetAuxiliaryAudioEstimatedDelay(struct bigvoice_CInstance *instance, const char* id);
858
861// --------------------------------------------------------------
870// --------------------------------------------------------------
871 #ifdef _MSC_VER
872 #define __BYTE_ORDER__ REG_DWORD
873 #define __ORDER_LITTLE_ENDIAN__ REG_DWORD_LITTLE_ENDIAN
874 #define __ORDER_BIG_ENDIAN__ REG_DWORD_BIG_ENDIAN
875 #endif
876
890
891 // Native definitions, only links to the physical ones
892 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
897 #else
902 #endif
903};
904
912
920
928
929
937
948BIGVOICE_DECL unsigned int bigvoice_AddAudio(struct bigvoice_CInstance *instance, const uint8_t *payload, unsigned int nFrame, enum bigvoice_SampleFormat fmt );
949
957
965
975BIGVOICE_DECL unsigned int bigvoice_GetAudio(struct bigvoice_CInstance *instance, uint8_t *payload, unsigned int max_nFrame, enum bigvoice_SampleFormat fmt );
976
980// --------------------------------------------------------------
987// --------------------------------------------------------------
998BIGVOICE_DECL void bigvoice_AudioConvertFrom(const uint8_t *payload, float *output, size_t nSpl, enum bigvoice_SampleFormat fmt);
999
1010BIGVOICE_DECL void bigvoice_AudioConvertTo(const float *input, uint8_t *payload, size_t nSpl, enum bigvoice_SampleFormat fmt);
1011
1021BIGVOICE_DECL void bigvoice_StereoToMono(const float *input, float *output, size_t nFrame);
1022
1032BIGVOICE_DECL void bigvoice_MonoToStereo(const float *input, float *output, size_t nFrame);
1033
1044BIGVOICE_DECL void bigvoice_StereoToMono_Planar(const float *inputL, const float *inputR, float *output, size_t nFrame);
1045
1056BIGVOICE_DECL void bigvoice_MonoToStereo_Planar(const float *input, float *outputL, float *outputR, size_t nFrame);
1057
1064BIGVOICE_DECL void bigvoice_AudioMonoFromLiveStereo(const uint8_t *payload, float *output);
1065
1072BIGVOICE_DECL void bigvoice_AudioMonoToLiveStereo(const float *input, uint8_t *payload);
1073
1080
1091
1114 , size_t payl_ch, size_t payl_ch_offset
1115 , enum bigvoice_ConverterTargetMode target_mode);
1116
1121
1131BIGVOICE_DECL void bigvoice_AudioConverter_From(struct bigvoice_CAudioConverter *converter, const uint8_t *payload, float *output);
1132
1142BIGVOICE_DECL void bigvoice_AudioConverter_To(struct bigvoice_CAudioConverter *converter, const float *input, uint8_t *payload);
1143
1146// --------------------------------------------------------------
1153// --------------------------------------------------------------
1158
1168
1175
1189BIGVOICE_DECL const char *bigvoice_ProcessJson(struct bigvoice_CClientInstance *client, const char *json_str, int *need_save);
1190
1196BIGVOICE_DECL void bigvoice_FreeJsonAnswer(const char *json_str);
1197
1210
1213#if BIGVOICE_HAS_WEBSERVER
1214// --------------------------------------------------------------
1232// --------------------------------------------------------------
1240BIGVOICE_DECL uint64_t bigvoice_Webserver_tcp(unsigned int listenport, unsigned int listenport_secure, const char *socket_ip, unsigned int socket_port);
1241
1242// --------------------------------------------------------------
1262BIGVOICE_DECL uint64_t bigvoice_Webserver_tcp2(unsigned int listenport, unsigned int listenport_secure, const char *socket_ip, unsigned int socket_port, const struct bigvoice_CParameters *parameters);
1263
1283BIGVOICE_DECL uint64_t bigvoice_Webserver(unsigned int listenport, unsigned int listenport_secure, struct bigvoice_CInstance *instance);
1284
1294BIGVOICE_DECL int bigvoice_Webserver_Stop(uint64_t id, int timeout_ms);
1295
1305
1316BIGVOICE_DECL void bigvoice_Webserver_SetAppHealth(struct bigvoice_CInstance *instance, int httpcode, const char *contenttype, const char *content);
1317
1326BIGVOICE_DECL void bigvoice_Webserver_GetAppHealth(struct bigvoice_CInstance *instance, int* httpcode, char** contenttype, char** content);
1327
1334
1339#define SOUND4_INVALID_WEBSERVER_ID ((uint64_t)-1)
1340
1344#define SOUND4_WEBSERVER_HTTP_OK (1<<0)
1348#define SOUND4_WEBSERVER_HTTPS_OK (1<<1)
1349
1351#endif // BIGVOICE_HAS_WEBSERVER
1352
1353#ifdef __cplusplus
1354} // extern "C"
1355#endif // __cplusplus
unsigned int bigvoice_GetOutputCount(struct bigvoice_CInstance *instance)
unsigned int bigvoice_GetAudio(struct bigvoice_CInstance *instance, uint8_t *payload, unsigned int max_nFrame, enum bigvoice_SampleFormat fmt)
unsigned int bigvoice_GetMaxPacketFrame(struct bigvoice_CInstance *instance)
bigvoice_SampleFormat
const char * bigvoice_GetFormatName(const enum bigvoice_SampleFormat fmt)
unsigned int bigvoice_GetBytesFromFormat(const enum bigvoice_SampleFormat fmt)
unsigned int bigvoice_AddPadAudio(struct bigvoice_CInstance *instance)
enum bigvoice_SampleFormat bigvoice_GetFormatFromName(const char *name)
unsigned int bigvoice_AddAudio(struct bigvoice_CInstance *instance, const uint8_t *payload, unsigned int nFrame, enum bigvoice_SampleFormat fmt)
@ F32_NATIVE
32-bit floating-point, native
@ INVALID_FORMAT
Invalid.
@ S16_NATIVE
16-bit signed integer, native
@ F32_LE
32-bit floating-point, little-endian
@ S16_BE
16-bit signed integer, big-endian
@ S32_BE
32-bit signed integer, big-endian
@ S24_BE
24-bit signed integer, big-endian
@ S16_LE
16-bit signed integer, little-endian
@ F32_BE
32-bit floating-point, big-endian
@ S32_NATIVE
32-bit signed integer, native
@ S24_LE
24-bit signed integer, little-endian
@ S32_LE
32-bit signed integer, little-endian
@ S24_NATIVE
24-bit signed integer, native
struct SOUND4_AuxiliaryOutputInfos ** bigvoice_GetAuxiliaryAudioOutputInfos(struct bigvoice_CInstance *instance)
int bigvoice_ActivateAuxiliaryAudioID(struct bigvoice_CInstance *instance, const char *id)
void bigvoice_FreeAuxiliaryAudioInfos(struct SOUND4_AuxiliaryOutputInfos **infos)
unsigned int bigvoice_GetAuxiliaryAudioEstimatedDelay(struct bigvoice_CInstance *instance, const char *id)
int bigvoice_SaveState(struct bigvoice_CInstance *instance)
void bigvoice_DeleteClient(struct bigvoice_CClientInstance *client)
const char * bigvoice_ProcessJson(struct bigvoice_CClientInstance *client, const char *json_str, int *need_save)
void bigvoice_FreeJsonAnswer(const char *json_str)
struct bigvoice_CClientInstance * bigvoice_NewClient(struct bigvoice_CInstance *instance)
struct bigvoice_CBus * bigvoice_NewBus()
void bigvoice_FreeBus(struct bigvoice_CBus *bus)
void bigvoice_SetInstanceBus(struct bigvoice_CParameters *params, struct bigvoice_CBus *bus)
void bigvoice_AudioConverter_To(struct bigvoice_CAudioConverter *converter, const float *input, uint8_t *payload)
void bigvoice_FreeAudioConverter(struct bigvoice_CAudioConverter *converter)
void bigvoice_AudioConvertTo(const float *input, uint8_t *payload, size_t nSpl, enum bigvoice_SampleFormat fmt)
void bigvoice_AudioConvertFrom(const uint8_t *payload, float *output, size_t nSpl, enum bigvoice_SampleFormat fmt)
void bigvoice_AudioMonoToLiveStereo(const float *input, uint8_t *payload)
void bigvoice_AudioConverter_From(struct bigvoice_CAudioConverter *converter, const uint8_t *payload, float *output)
void bigvoice_StereoToMono_Planar(const float *inputL, const float *inputR, float *output, size_t nFrame)
void bigvoice_MonoToStereo_Planar(const float *input, float *outputL, float *outputR, size_t nFrame)
void bigvoice_AudioMonoFromLiveStereo(const uint8_t *payload, float *output)
void bigvoice_MonoToStereo(const float *input, float *output, size_t nFrame)
void bigvoice_StereoToMono(const float *input, float *output, size_t nFrame)
bigvoice_ConverterTargetMode
struct bigvoice_CAudioConverter * bigvoice_GetAudioConverter(enum bigvoice_SampleFormat fmt, size_t nFrame, size_t payl_ch, size_t payl_ch_offset, enum bigvoice_ConverterTargetMode target_mode)
@ ConverterTargetMode_Mono
Mono process (using mono extract/payload)
@ ConverterTargetMode_StereoToMono
Mono process, using stereo extract/payload (converts stereo to mono)
@ ConverterTargetMode_AsInput
Same channels as input (no extract/insert)
@ ConverterTargetMode_Stereo
Stereo process (using stereo extract/payload)
@ ConverterTargetMode_MonoToStereo
Stereo process, using mono extract/payload (converts mono to stereo)
void bigvoice_ProcessAudio(struct bigvoice_CInstance *instance, const float *input, float *output)
unsigned int bigvoice_GetEstimatedDelay(struct bigvoice_CInstance *instance)
float * bigvoice_GetBufferOut(struct bigvoice_CInstance *instance)
float * bigvoice_GetBufferIn(struct bigvoice_CInstance *instance)
void bigvoice_ProcessAudio_Planar(struct bigvoice_CInstance *instance, float const *const *input, float *const *output)
const struct SOUND4_ProcessInfo * SOUND4_GetProcessInfo()
bigvoice_LogSeverity
void(* bigvoice_loggerfn)(enum bigvoice_LogSeverity, const char *)
unsigned int bigvoice_GetAudioInputCount()
unsigned int bigvoice_GetChannelCount()
void bigvoice_SetLoggerCallback(bigvoice_loggerfn logger)
void bigvoice_SetLogSeverity(enum bigvoice_LogSeverity severity)
unsigned int bigvoice_GetChunkSizeInFrames()
unsigned int bigvoice_GetAudioOutputCount()
const char * bigvoice_GetVersion()
unsigned int bigvoice_GetSampleRate()
unsigned int * bigvoice_GetPossibleChunkSizeInFrames()
@ verbose5
verbose5
@ fatal
fatal error
@ warning
warning
@ verbose4
verbose4
@ info
info
@ none
Not used.
@ error
error
@ verbose2
verbose2
@ verbose3
verbose3
@ verbose
verbose
void bigvoice_FreeParameterValue(const char *value)
int bigvoice_TerminateProcess(struct bigvoice_CInstance *instance)
struct bigvoice_CInstance * bigvoice_InitProcess3(const char *LoginKey, const char *RadioName, const char *Access_Key_ID, const char *Access_Key_Secret, const char *save_path, const struct bigvoice_CParameters *parameters, unsigned int frames_per_chunk)
void bigvoice_FreeParameters(struct bigvoice_CParameters *params)
void bigvoice_ExitProcess(struct bigvoice_CInstance *instance)
struct bigvoice_CParameters * bigvoice_NewParameters()
unsigned int bigvoice_GetProcessChunkFrames(struct bigvoice_CInstance *instance)
struct bigvoice_CInstance * bigvoice_InitProcess2(const char *LoginKey, const char *RadioName, const char *Access_Key_ID, const char *Access_Key_Secret, const char *save_path, const struct bigvoice_CParameters *parameters)
void bigvoice_SetParameter(struct bigvoice_CParameters *params, const char *name, const char *value)
struct bigvoice_CInstance * bigvoice_InitProcess(const char *LoginKey, const char *RadioName, const char *Access_Key_ID, const char *Access_Key_Secret, const char *save_path)
const char * bigvoice_GetParameter(struct bigvoice_CParameters *params, const char *name)
void bigvoice_FreeMetadataInfos(struct bigvoice_CInstance *instance, const char **infos)
void bigvoice_SetMetadata(struct bigvoice_CInstance *instance, const char *key, const char *value)
const char ** bigvoice_GetMetadataInfos(struct bigvoice_CInstance *instance)
void bigvoice_SetMetadataMulti(struct bigvoice_CInstance *instance, const char **keyvalue)
void(* bigvoice_storage_getall_free)(fs_char **all, void *userdata)
int(* bigvoice_storage_exists)(const fs_char *filename, void *userdata)
fs_char **(* bigvoice_storage_getall)(void *userdata)
int(* bigvoice_storage_remove)(const fs_char *filename, void *userdata)
int(* bigvoice_storage_writer)(const fs_char *filename, const char *content, void *userdata)
bigvoice_PresetChange_Kind
char *(* bigvoice_storage_reader)(const fs_char *filename, void *userdata)
void bigvoice_SetPresetManager(struct bigvoice_CParameters *params, bigvoice_storage_reader reader, bigvoice_storage_reader_free, bigvoice_storage_writer writer, bigvoice_storage_exists exists, bigvoice_storage_getall getall, bigvoice_storage_getall_free getall_free, bigvoice_storage_remove remove, bigvoice_storage_rename rename, int IsReadOnly, void *userdata)
void(* bigvoice_storage_reader_free)(char *content, void *userdata)
void bigvoice_PresetManager_InformChange(struct bigvoice_CInstance *instance, const fs_char *relative_path, enum bigvoice_PresetChange_Kind change_kind)
wchar_t fs_char
int(* bigvoice_storage_rename)(const fs_char *from, const fs_char *to, void *userdata)
@ change_kind_modified
Path has been modified.
@ change_kind_created
Path has been created.
@ change_kind_deleted
Path has been deleted.
void bigvoice_SetInstanceTracingProcessActivity(struct bigvoice_CInstance *instance, GUID activity_guid)
void bigvoice_SetInstanceTracing(struct bigvoice_CParameters *params, TraceLoggingHProvider tracing_provider, GUID activity_guid)
void bigvoice_StopUpdateThread(struct bigvoice_CInstance *instance)
int bigvoice_WaitUpdateThreadReady(struct bigvoice_CInstance *instance, int milliseconds)
void bigvoice_StartUpdateThread(struct bigvoice_CInstance *instance, unsigned int port)
uint64_t bigvoice_Webserver_tcp(unsigned int listenport, unsigned int listenport_secure, const char *socket_ip, unsigned int socket_port)
uint64_t bigvoice_Webserver(unsigned int listenport, unsigned int listenport_secure, struct bigvoice_CInstance *instance)
int bigvoice_Webserver_Stop(uint64_t id, int timeout_ms)
uint64_t bigvoice_Webserver_tcp2(unsigned int listenport, unsigned int listenport_secure, const char *socket_ip, unsigned int socket_port, const struct bigvoice_CParameters *parameters)
int bigvoice_Webserver_Status(uint64_t id)
void bigvoice_Webserver_SetAppHealth(struct bigvoice_CInstance *instance, int httpcode, const char *contenttype, const char *content)
void bigvoice_Webserver_FreeString(char *str)
void bigvoice_Webserver_GetAppHealth(struct bigvoice_CInstance *instance, int *httpcode, char **contenttype, char **content)
struct _tlgProvider_t const * TraceLoggingHProvider
#define BIGVOICE_DECL
const float * buffer
The output buffer of the output. See bigvoice_ProcessAudio for format.
char * id
The ID of the output (fixed across versions)
char * description
The description of the output.
unsigned int sample_rate
The sampling rate of this output.
unsigned int channel_count
The number of channels of this output.
const char * version
Library version.
const char * shortname
A short name of the processor, single word.
const char * prefix
The prefix of this processor functions.
size_t struct_size
The size of total this structure, for compatibility checking.
const char * name
The name of the processor.