Immersitech Logo Developer Resources
immersitech.h
Go to the documentation of this file.
1#pragma once
2
21
22#ifndef IMMERSITECH_LIBRARY_H_
23#define IMMERSITECH_LIBRARY_H_
24
25#include <stdbool.h>
26#include <stdint.h>
27#include <stddef.h>
28
29#include "immersitech_general.h"
30
31#if HAVE_VISIBILITY
32#define IMMERSITECH_API __attribute__((__visibility__("default")))
33#elif defined _WIN32
34#define IMMERSITECH_API __declspec(dllexport)
35#else
36#define IMMERSITECH_API
37#endif
38
47typedef struct imm_position {
48 int x;
49 int y;
50 int z;
52
60typedef struct imm_heading {
64
73typedef struct imm_seat {
74 int id;
78
83typedef enum imm_audio_control {
103
109typedef enum imm_device_type {
115
129
144
157
163typedef void* imm_handle;
164
165#ifdef __cplusplus
166extern "C" {
167#endif
168
180 IMMERSITECH_API imm_handle imm_initialize_library(const char* license_file_name, const char* room_layout_file_name, const char* websocket_config_file_name, imm_library_configuration configuration, imm_error_code* error_code);
181
194 IMMERSITECH_API imm_handle imm_initialize_library_from_memory(uint8_t* license_file_data, size_t license_file_data_size, const char* room_layout_file_name, const char* websocket_config_file_name, imm_library_configuration configuration, imm_error_code* error_code);
195
203
211
218
227
235
244 IMMERSITECH_API imm_error_code imm_add_participant(imm_handle handle, int room_id, int participant_id, const char* participant_name, imm_participant_configuration config);
245
252 IMMERSITECH_API imm_error_code imm_remove_participant(imm_handle handle, int room_id, int participant_id);
253
261
271 IMMERSITECH_API imm_error_code imm_get_room_layout(imm_handle handle, int room_id, int* layout_id);
272
284
295
306
316
323
330 IMMERSITECH_API imm_error_code imm_get_participant_count(imm_handle handle, int room_id, int* participant_count);
331
342 IMMERSITECH_API imm_error_code imm_get_participant_name(imm_handle handle, int room_id, int participant_id, char* value, int value_length);
343
351 IMMERSITECH_API imm_error_code imm_set_participant_name(imm_handle handle, int room_id, int participant_id, const char* participant_name);
352
363
373 IMMERSITECH_API imm_error_code imm_set_participant_seat(imm_handle handle, int room_id, int participant_id, int seat_id);
374
385 IMMERSITECH_API imm_error_code imm_get_participant_seat(imm_handle handle, int room_id, int participant_id, imm_seat* seat);
386
396
407 IMMERSITECH_API imm_error_code imm_input_audio_short(imm_handle handle, int room_id, int participant_id, const short* audio_data, int number_frames);
408
410 IMMERSITECH_API imm_error_code imm_input_audio_float(imm_handle handle, int room_id, int participant_id, const float* audio_data, int number_frames);
411
413 IMMERSITECH_API imm_error_code imm_input_audio_double(imm_handle handle, int room_id, int participant_id, const double* audio_data, int number_frames);
414
422 IMMERSITECH_API imm_error_code imm_output_audio_short(imm_handle handle, int room_id, int participant_id, short* output);
423
425 IMMERSITECH_API imm_error_code imm_output_audio_float(imm_handle handle, int room_id, int participant_id, float* output);
426
428 IMMERSITECH_API imm_error_code imm_output_audio_double(imm_handle handle, int room_id, int participant_id, double* output);
429
441 IMMERSITECH_API imm_error_code imm_set_participant_position(imm_handle handle, int room_id, int participant_id, imm_position position, imm_heading heading);
442
451 IMMERSITECH_API imm_error_code imm_get_participant_position(imm_handle handle, int room_id, int participant_id, imm_position* position, imm_heading* heading);
452
462 IMMERSITECH_API imm_error_code imm_set_participant_state(imm_handle handle, int room_id, int participant_id, imm_audio_control control_to_edit, int value);
463
472 IMMERSITECH_API imm_error_code imm_get_participant_state(imm_handle handle, int room_id, int participant_id, imm_audio_control control, int* value);
473
486 IMMERSITECH_API imm_error_code imm_get_participant_spherical(imm_handle handle, int room_id, int listener_id, int source_id, int* azimuth, int* elevation, int* distance);
487
496 IMMERSITECH_API imm_error_code imm_flush_data(imm_handle handle, int room_id, int participant_id);
497
504
512
520
521#ifdef __cplusplus
522}
523#endif
524
525#endif // IMMERSITECH_LIBRARY_H_
IMMERSITECH_API imm_error_code imm_destroy_room(imm_handle handle, int room_id)
Function to removes all remaining participants from a room and frees all the data allocated for a roo...
IMMERSITECH_API imm_error_code imm_set_participant_state(imm_handle handle, int room_id, int participant_id, imm_audio_control control_to_edit, int value)
Function to set the state of a given participant.
IMMERSITECH_API imm_error_code imm_output_audio_float(imm_handle handle, int room_id, int participant_id, float *output)
Duplicate of imm_output_audio_short except the output is a 32 bit float. See imm_output_audio_short f...
IMMERSITECH_API imm_error_code imm_remove_participant(imm_handle handle, int room_id, int participant_id)
Function to remove a participant from a room.
IMMERSITECH_API imm_error_code imm_flush_data(imm_handle handle, int room_id, int participant_id)
Function to clear all data related to a particular participant.
IMMERSITECH_API int imm_string_to_participant_value(const char *value_string)
Convert string to specific participant value.
IMMERSITECH_API imm_handle imm_initialize_library_from_memory(uint8_t *license_file_data, size_t license_file_data_size, const char *room_layout_file_name, const char *websocket_config_file_name, imm_library_configuration configuration, imm_error_code *error_code)
Function to create an instance of the immersitech library.
struct imm_participant_configuration imm_participant_configuration
A structure to describe the configuration of a participant.
IMMERSITECH_API imm_error_code imm_create_room(imm_handle handle, int room_id)
Function to allocate memory and initialize a new room.
IMMERSITECH_API imm_error_code imm_output_audio_double(imm_handle handle, int room_id, int participant_id, double *output)
Duplicate of imm_output_audio_short except the output is a 64 bit float. See imm_output_audio_short f...
IMMERSITECH_API imm_error_code imm_input_audio_short(imm_handle handle, int room_id, int participant_id, const short *audio_data, int number_frames)
Function to input audio data from a participant into a room.
IMMERSITECH_API const char * imm_get_json_all_room_layouts(imm_handle handle)
Function to view all the available room layouts as a JSON formatted string.
IMMERSITECH_API imm_error_code imm_add_event_manager(imm_handle handle, void *event_manager)
Function to link a custom event manager with the library.
IMMERSITECH_API imm_error_code imm_set_participant_position(imm_handle handle, int room_id, int participant_id, imm_position position, imm_heading heading)
Function to set the x,y,z position of a given participant.
IMMERSITECH_API imm_error_code imm_enable_websockets(imm_handle handle, bool enable)
Function to enable the websocket server for controlling settings via websockets.
IMMERSITECH_API imm_error_code imm_destroy_library(imm_handle handle)
Function to frees all memory associated with the immersitech library.
IMMERSITECH_API imm_error_code imm_input_audio_float(imm_handle handle, int room_id, int participant_id, const float *audio_data, int number_frames)
Duplicate of imm_input_audio_short except the input is a 32 bit float. See imm_input_audio_short for ...
IMMERSITECH_API imm_error_code imm_set_room_layout(imm_handle handle, int room_id, int layout_id)
Function to set a room's layout.
IMMERSITECH_API imm_error_code imm_set_participant_name(imm_handle handle, int room_id, int participant_id, const char *participant_name)
Function to set the name of a participant.
IMMERSITECH_API imm_error_code imm_get_participant_configuration(imm_handle handle, int room_id, int participant_id, imm_participant_configuration *config)
Function to get information about a participant's configuration.
#define IMMERSITECH_API
Definition: immersitech.h:36
IMMERSITECH_API imm_error_code imm_get_participant_name(imm_handle handle, int room_id, int participant_id, char *value, int value_length)
Function view the name of a particular participant.
IMMERSITECH_API imm_error_code imm_output_audio_short(imm_handle handle, int room_id, int participant_id, short *output)
Function to process audio data and return the output audio data for a participant.
IMMERSITECH_API imm_error_code imm_get_participant_count(imm_handle handle, int room_id, int *participant_count)
Function to learn how many participants are currently in a given room.
struct imm_position imm_position
A structure to describe a position within a three-dimensional space.
struct imm_heading imm_heading
A structure to describe the direction a participant is facing in three-dimensional space.
IMMERSITECH_API imm_audio_control imm_string_to_audio_control(const char *control_string)
Convert string to an imm_audio_control enum value that is compatible with various sound manager funct...
IMMERSITECH_API imm_error_code imm_get_room_count(imm_handle handle, int *room_count)
Function to learn how many rooms are currently active.
IMMERSITECH_API imm_error_code imm_input_audio_double(imm_handle handle, int room_id, int participant_id, const double *audio_data, int number_frames)
Duplicate of imm_input_audio_short except the input is a 64 bit float. See imm_input_audio_short for ...
struct imm_seat imm_seat
A structure to describe a seat within a room.
IMMERSITECH_API const char * imm_get_license_info(imm_handle handle)
Function to return information about your current license key.
IMMERSITECH_API imm_error_code imm_get_participant_seat(imm_handle handle, int room_id, int participant_id, imm_seat *seat)
Function get information about a participant's current seat.
IMMERSITECH_API imm_error_code imm_get_participant_position(imm_handle handle, int room_id, int participant_id, imm_position *position, imm_heading *heading)
Function to retrieve Location of a given participant.
struct imm_library_configuration imm_library_configuration
A structure to describe the configuration of the Immersitech Library.
IMMERSITECH_API imm_error_code imm_add_participant(imm_handle handle, int room_id, int participant_id, const char *participant_name, imm_participant_configuration config)
Function to add a new pariticipant into a room.
imm_audio_control
Audio Controls you can change in real-time.
Definition: immersitech.h:83
@ IMM_CONTROL_WHISPER_ROOM
If a participant's whisper room is set to a non-zero value from 1-100, they will be rendered inside t...
Definition: immersitech.h:99
@ IMM_CONTROL_MASTER_GAIN
The master gain setting will adjust the volume for a participant's output audio. It is given as a per...
Definition: immersitech.h:98
@ IMM_CONTROL_AGC_ENABLE
If a participant has AGC enabled, their input audio will be automatically adjusted to match the volum...
Definition: immersitech.h:90
@ IMM_CONTROL_MIXING_3D_ENABLE
If a participant has 3D mixing enabled, they will hear all other participants spatially rendering in ...
Definition: immersitech.h:92
@ IMM_CONTROL_AUTO_EQ_ENABLE
If a participant has Auto EQ enabled, their input audio will automatically adjusted to maximize the c...
Definition: immersitech.h:91
@ IMM_CONTROL_MIXING_3D_ATTENUATION
If 3D mixing is enabled, this control will determine how the volume of a source drops off as they mov...
Definition: immersitech.h:93
@ IMM_CONTROL_SIDEBAR_ROOM
If a participant's sidebar room is set to a non-zero value from 1-100, they will be rendered inside t...
Definition: immersitech.h:100
@ IMM_CONTROL_START
This value allows you to identify the start of the enum.
Definition: immersitech.h:84
@ IMM_CONTROL_END
This value allows you to identify the end of the enum.
Definition: immersitech.h:101
@ IMM_CONTROL_MIXING_3D_MAX_DISTANCE
If 3D mixing is enabled, this control will determine the max distance up to which attenuation will ap...
Definition: immersitech.h:94
@ IMM_CONTROL_ANC_MIX
If a participant has ANC enabled, this value determines the level of cancellation desired as a percen...
Definition: immersitech.h:89
@ IMM_CONTROL_ANC_HIGH
If a participant has ANC set to High, the more powerful noise cancellation will be applied....
Definition: immersitech.h:88
@ IMM_CONTROL_MIXING_3D_REVERB_ENABLE
If 3D mixing is enabled, this control will determine if reverb is applied to the 3D rendering....
Definition: immersitech.h:95
@ IMM_CONTROL_STEREO_BYPASS_ENABLE
If the stereo bypass is enabled, all effects will be bypassed, meaning no processing will occur....
Definition: immersitech.h:85
@ IMM_CONTROL_DEVICE
The device setting will help optimize 3D processing for a particular participant's listening device....
Definition: immersitech.h:96
@ IMM_CONTROL_ANC_ENABLE
If a participant has ANC enabled, all noise in their input audio will be automatically cancelled....
Definition: immersitech.h:87
@ IMM_CONTROL_HALF_SPAN_ANGLE
If the participant is using speakers, they should set the Half Span Angle from 1 to 90 to match the p...
Definition: immersitech.h:97
@ IMM_CONTROL_MUTE_ENABLE
If a participant's mute is enabled, their input audio will not be passed to the other participants....
Definition: immersitech.h:86
IMMERSITECH_API imm_error_code imm_set_all_participants_state(imm_handle handle, int room_id, imm_audio_control control_to_edit, int value)
Function to change an audio control for every participant in a room all at once.
IMMERSITECH_API imm_error_code imm_send_custom_websocket_event(imm_handle handle, int room_id, const char *message)
Function to broadcast any arbitrary message through the websocket server to all clients.
imm_participant_type
Types of participants you can instantiate.
Definition: immersitech.h:122
@ IMM_PARTICIPANT_LISTENER_ONLY
A listener only participant will only receive other participant's audio and will NOT input audio.
Definition: immersitech.h:126
@ IMM_PARTICIPANT_REGULAR
A regular participant will both input audio and receive other participant's audio.
Definition: immersitech.h:124
@ IMM_PARTICIPANT_START
This value allows you to identify the start of the enum.
Definition: immersitech.h:123
@ IMM_PARTICIPANT_SOURCE_ONLY
A source only participant will only input audio and will NOT receive other participant's audio.
Definition: immersitech.h:125
@ IMM_PARTICIPANT_END
This value allows you to identify the end of the enum.
Definition: immersitech.h:127
IMMERSITECH_API const char * imm_audio_control_to_string(imm_audio_control control)
Convert an imm_audio_control to a human-readable string description.
IMMERSITECH_API imm_error_code imm_set_participant_seat(imm_handle handle, int room_id, int participant_id, int seat_id)
Function move a participant to a new seat.
void * imm_handle
Immersitech Library API Handler.
Definition: immersitech.h:163
IMMERSITECH_API imm_error_code imm_get_participant_state(imm_handle handle, int room_id, int participant_id, imm_audio_control control, int *value)
Function to retrieve state of a given participant.
IMMERSITECH_API imm_error_code imm_get_participant_spherical(imm_handle handle, int room_id, int listener_id, int source_id, int *azimuth, int *elevation, int *distance)
Function to retrieve Spherical Coordinates of a given source of a given participant.
IMMERSITECH_API imm_error_code imm_get_room_layout(imm_handle handle, int room_id, int *layout_id)
Function to view which room layout a paritcular room is currently set to.
imm_device_type
Output Device Types you may be listening on.
Definition: immersitech.h:109
@ IMM_DEVICE_SPEAKER
The listening device is a stereo loudspeaker pair. If this is selected, the participant should also s...
Definition: immersitech.h:112
@ IMM_DEVICE_HEADPHONE
The listening device is a headphone, including in-ear, on-ear, and over-ear variants.
Definition: immersitech.h:111
@ IMM_DEVICE_END
This value allows you to identify the end of the enum.
Definition: immersitech.h:113
@ IMM_DEVICE_START
This value allows you to identify the start of the enum.
Definition: immersitech.h:110
IMMERSITECH_API imm_handle imm_initialize_library(const char *license_file_name, const char *room_layout_file_name, const char *websocket_config_file_name, imm_library_configuration configuration, imm_error_code *error_code)
Function to create an instance of the immersitech library.
IMMERSITECH_API imm_library_configuration imm_get_library_configuration(imm_handle handle)
Function to get all the information about the way you configured the Immersitech Library.
imm_error_code
All error codes that may be produced by the library.
Definition: immersitech_general.h:26
A structure to describe the direction a participant is facing in three-dimensional space.
Definition: immersitech.h:60
int elevation_heading
Definition: immersitech.h:62
int azimuth_heading
Definition: immersitech.h:61
A structure to describe the configuration of the Immersitech Library.
Definition: immersitech.h:137
bool interleaved
Definition: immersitech.h:141
int output_sampling_rate
Definition: immersitech.h:138
int output_number_frames
Definition: immersitech.h:139
int output_number_channels
Definition: immersitech.h:140
int spatial_quality
Definition: immersitech.h:142
A structure to describe the configuration of a participant.
Definition: immersitech.h:152
int input_sampling_rate
Definition: immersitech.h:153
imm_participant_type type
Definition: immersitech.h:155
int input_number_channels
Definition: immersitech.h:154
A structure to describe a position within a three-dimensional space.
Definition: immersitech.h:47
int x
Definition: immersitech.h:48
int y
Definition: immersitech.h:49
int z
Definition: immersitech.h:50
A structure to describe a seat within a room.
Definition: immersitech.h:73
int id
Definition: immersitech.h:74
imm_position position
Definition: immersitech.h:75
imm_heading heading
Definition: immersitech.h:76