SAF
Loading...
Searching...
No Matches
ambi_roomsim_internal.h
Go to the documentation of this file.
1/*
2 * Copyright 2020 Leo McCormack
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10 * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14 * PERFORMANCE OF THIS SOFTWARE.
15 */
16
26#ifndef __AMBI_ROOMSIM_INTERNAL_H_INCLUDED__
27#define __AMBI_ROOMSIM_INTERNAL_H_INCLUDED__
28
29#include "ambi_roomsim.h" /* Include header for this example */
30#include "saf.h" /* Main include header for SAF */
31#include "saf_externals.h" /* To also include SAF dependencies (cblas etc.) */
32
33#ifdef __cplusplus
34extern "C" {
35#endif /* __cplusplus */
36
37/* ========================================================================== */
38/* Internal Parameters */
39/* ========================================================================== */
40
41#if !defined(AMBI_ROOMSIM_FRAME_SIZE)
42# if defined(FRAME_SIZE) /* Use the global framesize if it is specified: */
43# define AMBI_ROOMSIM_FRAME_SIZE ( FRAME_SIZE )
44# else /* Otherwise, the default framesize for this example is: */
45# define AMBI_ROOMSIM_FRAME_SIZE ( 128 )
46# endif
47#endif
48
49/* ========================================================================== */
50/* Structures */
51/* ========================================================================== */
52
57typedef struct _ambi_roomsim
58{
59 /* Internals */
62 float fs;
64 /* Internal */
65 void* hIms;
66 int sourceIDs[ROOM_SIM_MAX_NUM_SOURCES];
67 int receiverIDs[ROOM_SIM_MAX_NUM_RECEIVERS];
68 float** src_sigs;
69 float*** rec_sh_outsigs;
75 /* user parameters */
81 float room_dims[3];
82 float abs_wall[6];
83 float src_pos[ROOM_SIM_MAX_NUM_SOURCES][3];
84 float rec_pos[ROOM_SIM_MAX_NUM_RECEIVERS][3];
89
90
91/* ========================================================================== */
92/* Internal Functions */
93/* ========================================================================== */
94
95
96#ifdef __cplusplus
97} /* extern "C" { */
98#endif /* __cplusplus */
99
100#endif /* __AMBI_ROOMSIM_INTERNAL_H_INCLUDED__ */
#define MAX_NUM_INPUTS
Maximum number of input channels supported.
Definition _common.h:233
NORM_TYPES
Available Ambisonic normalisation conventions.
Definition _common.h:74
CH_ORDER
Available Ambisonic channel ordering conventions.
Definition _common.h:59
#define MAX_NUM_SH_SIGNALS
Maximum number of spherical harmonic components/signals supported.
Definition _common.h:239
A simple shoebox room Ambisonic encoder.
#define ROOM_SIM_MAX_NUM_RECEIVERS
Maximum supported number of receivers for the room sim example.
#define ROOM_SIM_MAX_NUM_SOURCES
Maximum supported number of sources for the room sim example.
#define AMBI_ROOMSIM_FRAME_SIZE
Framesize, in time-domain samples.
Main include header for the Spatial_Audio_Framework (SAF)
Include header for SAF externals.
Main structure for ambi_roomsim.
int enableReflections
0: disabled, 1: enabled
int new_nSources
New number of sources (current value will be replaced by this after next re-init)
int new_sh_order
New receiver SH order (current value will be replaced by this after next re-init)
CH_ORDER chOrdering
Ambisonic channel order convention (see CH_ORDER)
void * hIms
Image source implementation handle.
int nSources
Current number of sources.
float fs
Host sampling rate, in Hz.
int nReceivers
Current number of receivers.
int sh_order
Current SH order of receivers.
int reinit_room
Flag, 1: re-init required, 0: not required.
int new_nReceivers
New number of receivers (current value will be replaced by this after next re-init)
float ** src_sigs
Source signal buffers; ROOM_SIM_MAX_NUM_SOURCES x AMBI_ROOMSIM_FRAME_SIZE.
NORM_TYPES norm
Ambisonic normalisation convention (see NORM_TYPES)
float *** rec_sh_outsigs
Receiver signal buffers; ROOM_SIM_MAX_NUM_RECEIVERS x MAX_NUM_SH_SIGNALS x AMBI_ROOMSIM_FRAME_SIZE.
int refl_order
Current maximum image source reflection order.