Tramway SDK
definitions.h
Go to the documentation of this file.
1// TRAMWAY DRIFT AND DUNGEON EXPLORATION SIMULATOR 2022
2// All rights reserved.
3
4#ifndef TRAM_SDK_AUDIO_SPATIAL_DEFINITIONS_H
5#define TRAM_SDK_AUDIO_SPATIAL_DEFINITIONS_H
6
7#include <framework/math.h>
8
10
12
13const size_t PATHS_FOR_RENDERING = 10;
14const size_t PATHS_FOR_SOURCE = 5;
15const size_t PATHS_FOR_LISTENER = 5;
16
17const size_t BUFFER_COUNT = 1000;
18const size_t SOURCE_COUNT = 200;
19
20const size_t SOURCE_DEPTH_LIMIT = 3;
21const size_t LISTENER_DEPTH_LIMIT = 6;
22
23// actually this might be useful!!! for both. or not
25 float force;
28};
29
30// this is the successful path that might need to be revalidated
32 float force;
33 float distance;
37
41
42 struct {
45};
46
48 struct {
51 float force;
54};
55
56// this is handed over to the rendering algorithm
58 float force;
59 float panning;
62};
63
64enum AudioSourceFlags : uint16_t {
67};
68
69enum AudioSampleRate : uint16_t {
73};
74
77 uint32_t channels;
78 size_t length;
79 float* data;
80};
81
82// Audio source information for path tracing
85
86 PathFromAudioSource* paths; // bidirectional paths
87
89 size_t last_path;
90};
91
92// Audio source information for rendering
95 uint16_t flags;
96 uint32_t sample;
99};
100
104
107
108extern int32_t listener_reverb_delay[5];
109extern float listener_reverb_distance[5];
110extern float listener_reverb_force[5];
111extern float listener_reverb_normalized[5];
112
113}
114
115#endif // TRAM_SDK_AUDIO_SPATIAL_DEFINITIONS_H
Definition: spinlock.h:11
Definition: definitions.h:11
AudioBuffer audiobuffers[BUFFER_COUNT]
AudioSource audiosources[SOURCE_COUNT]
AudioRender audiorenders[SOURCE_COUNT]
const size_t SOURCE_COUNT
Definition: definitions.h:18
AudioSourceFlags
Definition: definitions.h:64
@ SOURCE_REPEATING
Definition: definitions.h:66
@ SOURCE_PLAYING
Definition: definitions.h:65
float listener_reverb_normalized[5]
const size_t SOURCE_DEPTH_LIMIT
Definition: definitions.h:20
int32_t listener_reverb_delay[5]
const size_t PATHS_FOR_RENDERING
Definition: definitions.h:13
float listener_reverb_distance[5]
const size_t LISTENER_DEPTH_LIMIT
Definition: definitions.h:21
const size_t PATHS_FOR_SOURCE
Definition: definitions.h:14
float listener_reverb_force[5]
const size_t PATHS_FOR_LISTENER
Definition: definitions.h:15
const size_t BUFFER_COUNT
Definition: definitions.h:17
AudioSampleRate
Definition: definitions.h:69
@ SAMPLERATE_22050
Definition: definitions.h:71
@ SAMPLERATE_11025
Definition: definitions.h:72
@ SAMPLERATE_44100
Definition: definitions.h:70
glm::vec3 vec3
Definition: math.h:12
glm::quat quat
Definition: math.h:13
Definition: definitions.h:75
AudioSampleRate sample_rate
Definition: definitions.h:76
float * data
Definition: definitions.h:79
uint32_t channels
Definition: definitions.h:77
size_t length
Definition: definitions.h:78
Definition: definitions.h:93
uint16_t flags
Definition: definitions.h:95
PathRenderingInfo * paths
Definition: definitions.h:98
uint32_t sample
Definition: definitions.h:96
AudioBuffer * buffer
Definition: definitions.h:97
Spinlock lock
Definition: definitions.h:94
Definition: definitions.h:83
PathFromAudioSource * paths
Definition: definitions.h:86
vec3 position
Definition: definitions.h:84
size_t last_path
Definition: definitions.h:89
PathTracingResult * result_paths
Definition: definitions.h:88
float force
Definition: definitions.h:25
vec3 sampling_direction
Definition: definitions.h:26
uint32_t cycles_since_last_hit
Definition: definitions.h:27
Definition: definitions.h:47
vec3 direction
Definition: definitions.h:50
float force
Definition: definitions.h:51
vec3 source_direction
Definition: definitions.h:53
vec3 point
Definition: definitions.h:49
struct tram::Audio::Spatial::PathFromAudioSource::@7 reflections[LISTENER_DEPTH_LIMIT]
Definition: definitions.h:57
int32_t panning_delay
Definition: definitions.h:60
float panning
Definition: definitions.h:59
float force
Definition: definitions.h:58
int32_t distance_delay
Definition: definitions.h:61
Definition: definitions.h:31
vec3 source_ideal_angle
Definition: definitions.h:40
uint32_t reflection_count
Definition: definitions.h:35
float force
Definition: definitions.h:32
uint32_t cycles_since_last_hit
Definition: definitions.h:34
vec3 point
Definition: definitions.h:43
vec3 listener_ideal_angle
Definition: definitions.h:39
struct tram::Audio::Spatial::PathTracingResult::@6 reflections[SOURCE_DEPTH_LIMIT *LISTENER_DEPTH_LIMIT]
vec3 arrival_direction
Definition: definitions.h:36
float distance
Definition: definitions.h:33
float reflection_absorption
Definition: definitions.h:38