Skip to content

Commit 64a5330

Browse files
authored
feat: audio analysis (#328)
* component definition * specify package in the component def * apply lint * omit experimental features * support multiple analysis modes * relax order * optional args
1 parent b4ca911 commit 64a5330

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
syntax = "proto3";
2+
package decentraland.sdk.components;
3+
4+
import "decentraland/sdk/components/common/id.proto";
5+
option (common.ecs_component_id) = 1212;
6+
7+
enum PBAudioAnalysisMode {
8+
MODE_RAW = 0;
9+
MODE_LOGARITHMIC = 1;
10+
}
11+
12+
message PBAudioAnalysis {
13+
14+
// Parameters section
15+
PBAudioAnalysisMode mode = 1;
16+
17+
// Used only when mode == MODE_LOGARITHMIC
18+
optional float amplitude_gain = 100;
19+
optional float bands_gain = 101;
20+
// End when mode == MODE_LOGARITHMIC
21+
22+
// End Parameters section
23+
24+
// Result section
25+
float amplitude = 200;
26+
27+
// Protobuf doesn't support fixed arrays -> 8 band fields
28+
float band_0 = 201;
29+
float band_1 = 202;
30+
float band_2 = 203;
31+
float band_3 = 204;
32+
float band_4 = 205;
33+
float band_5 = 206;
34+
float band_6 = 207;
35+
float band_7 = 208;
36+
37+
// End Result section
38+
39+
// Future fields
40+
// float spectral_centroid = 13;
41+
// float spectral_flux = 14;
42+
// bool onset = 15;
43+
// float bpm = 16;
44+
}

0 commit comments

Comments
 (0)