Skip to content

Commit e4a810c

Browse files
author
Miodrag
committed
Implementation of the glue for the audio frame, audio buffer, audio data, and the glue to the callback for the audio processing module.
1 parent 77c4334 commit e4a810c

23 files changed

+1119
-85
lines changed

idl/AudioBuffers.idl

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -62,27 +62,27 @@ namespace org
6262
/// <summary>
6363
/// Gets or sets the total number of input channels.
6464
/// <summary>
65-
int inputChannels;
65+
size_t inputChannels;
6666

6767
/// <summary>
6868
/// Gets or sets the samples per input channel.
6969
/// <summary>
70-
int inputSamplesPerChannel;
70+
size_t inputSamplesPerChannel;
7171

7272
/// <summary>
7373
/// Gets or sets the total number of process channels.
7474
/// <summary>
75-
int processChannels;
75+
size_t processChannels;
7676

7777
/// <summary>
7878
/// Gets or sets the samples per process channel.
7979
/// <summary>
80-
int procesSamplesPerChannel;
80+
size_t procesSamplesPerChannel;
8181

8282
/// <summary>
8383
/// Gets or sets the total number of output channels.
8484
/// <summary>
85-
int outputChannels;
85+
size_t outputChannels;
8686
};
8787

8888
[dictionary]
@@ -99,15 +99,20 @@ namespace org
9999
/// <summary>
100100
AudioData data;
101101

102+
/// <summary>
103+
/// Gets or sets the voice activity flag.
104+
/// </summary>
105+
VadActivity activity;
106+
102107
/// <summary>
103108
/// Gets or sets the samples per input channel.
104109
/// <summary>
105-
int channels;
110+
size_t channels;
106111

107112
/// <summary>
108113
/// Gets or sets the samples per channel.
109114
/// <summary>
110-
int samplesPerChannel;
115+
size_t samplesPerChannel;
111116
};
112117

113118
[disposable]
@@ -123,32 +128,44 @@ namespace org
123128
/// Gets the total number of channels.
124129
/// <summary>
125130
[getter]
126-
int channels;
131+
size_t channels;
127132

128133
/// <summary>
129134
/// Gets the samples per channel.
130135
/// <summary>
131136
[getter]
132-
int samplesPerChannel;
137+
size_t samplesPerChannel;
138+
139+
/// <summary>
140+
/// Gets the total number of bands.
141+
/// <summary>
142+
[getter]
143+
size_t bands;
144+
145+
/// <summary>
146+
/// Gets the total number of frames per band.
147+
/// <summary>
148+
[getter]
149+
size_t framesPerBand;
133150

134151
/// <summary>
135152
/// Gets the audio samples for a given channel.
136153
/// <summary>
137-
AudioData channel(int channelIndex);
154+
AudioData channel(size_t channel);
138155

139156
/// <summary>
140157
/// Gets the audio samples for data split by bands.
141158
/// <summary>
142159
AudioData splitBand(
143-
int channel,
144-
int band);
160+
size_t channel,
161+
Band band);
145162

146163
/// <summary>
147164
/// Gets the audio samples for data split by channels.
148165
/// <summary>
149166
AudioData splitChannel(
150-
int band,
151-
int channel);
167+
Band band,
168+
size_t channel);
152169

153170
/// <summary>
154171
/// Gets a read-only view of the mixed low pass data.
@@ -157,10 +174,10 @@ namespace org
157174
AudioData mixedLowPassData;
158175

159176
/// <summary>
160-
/// Gets a read-only reference view of the low pass data.
177+
/// Gets a read-only reference view of the low pass data
178+
/// for a given channel.
161179
/// </summary>
162-
[getter]
163-
AudioData lowPassReference;
180+
AudioData lowPassReference(size_t channel);
164181

165182
/// <summary>
166183
/// Gets or sets the voice activity flag.

idl/WebRtcFactory.idl

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,44 @@ namespace org
5353
AudioBuffer buffer;
5454
};
5555

56+
/// <summary>
57+
/// The event is fired when an audio buffer needs to be reset.
58+
/// <summary>
59+
[disposable]
60+
interface AudioProcessingInitializeEvent
61+
{
62+
[constructor, delete, default]
63+
void AudioProcessingInitializeEvent();
64+
65+
/// <summary>
66+
/// Gets the audio sample hz rate.
67+
/// <summary>
68+
[getter]
69+
size_t samplRateHz;
70+
71+
/// <summary>
72+
/// Gets the total number of channels.
73+
/// <summary>
74+
[getter]
75+
size_t channels;
76+
};
77+
78+
/// <summary>
79+
/// The event is fired when an audio buffer needs to be reset.
80+
/// <summary>
81+
[disposable]
82+
interface AudioProcessingRuntimeSettingEvent
83+
{
84+
[constructor, delete, default]
85+
void AudioProcessingRuntimeSettingEvent();
86+
87+
[getter]
88+
RuntimeSetting type;
89+
90+
[getter]
91+
float value;
92+
};
93+
5694
/// <summary>
5795
/// The WebRtcFactoryConfiguration contains the boot strapping
5896
/// configuration options for the WebRtcFactory.
@@ -85,12 +123,36 @@ namespace org
85123
[constructor, default]
86124
void WebRtcFactory(WebRtcFactoryConfiguration configuration);
87125

126+
/// <summary>
127+
/// Fires events when capture audio processing is (re-)initialized.
128+
/// </summary>
129+
[event]
130+
void onAudioPostCaptureInitialize(AudioProcessingInitializeEvent event);
131+
132+
/// <summary>
133+
/// Fires events when a capture runtime setting have changed.
134+
/// </summary>
135+
[event]
136+
void onAudioPostCaptureRuntimeSetting(AudioProcessingRuntimeSettingEvent event);
137+
88138
/// <summary>
89139
/// Fires events when an audio buffer has been captured.
90140
/// </summary>
91141
[event]
92142
void onAudioPostCapture(AudioBufferEvent buffer);
93143

144+
/// <summary>
145+
/// Fires events when pre-render audio processing is (re-)initialized.
146+
/// </summary>
147+
[event]
148+
void onAudioPreRenderInitialize(AudioProcessingInitializeEvent event);
149+
150+
/// <summary>
151+
/// Fires events when a pre-render runtime setting have changed.
152+
/// </summary>
153+
[event]
154+
void onAudioPreRenderRuntimeSetting(AudioProcessingRuntimeSettingEvent event);
155+
94156
/// <summary>
95157
/// Fires events before an audio buffer is about to render.
96158
/// </summary>

idl/enums.idl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,19 @@ namespace org
936936
Unknown = 2
937937
};
938938

939+
enum Band
940+
{
941+
Band0To8kHz = 0,
942+
Band8To16kHz = 1,
943+
Band16To24kHz = 2
944+
};
945+
946+
enum RuntimeSetting
947+
{
948+
NotSpecified,
949+
CapturePreGain,
950+
CustomRenderProcessingRuntimeSetting
951+
};
939952

940953
}
941954
}

0 commit comments

Comments
 (0)