Skip to content

Commit 151eeff

Browse files
committed
support multiple analysis modes
1 parent 75acaaa commit 151eeff

File tree

1 file changed

+25
-15
lines changed

1 file changed

+25
-15
lines changed

proto/decentraland/sdk/components/audio_analysis.proto

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,34 @@ package decentraland.sdk.components;
44
import "decentraland/sdk/components/common/id.proto";
55
option (common.ecs_component_id) = 1212;
66

7+
enum PBAudioAnalysisMode {
8+
MODE_RAW = 0;
9+
MODE_LOGARITHMIC = 1;
10+
}
11+
712
message PBAudioAnalysis {
8-
float amplitude = 1;
13+
PBAudioAnalysisMode mode = 1;
914

10-
// protobuf doesn't support fixed arrays like C-lang does. Therefore float band[8] array maps per field.
11-
float band_0 = 2;
12-
float band_1 = 3;
13-
float band_2 = 4;
14-
float band_3 = 5;
15-
float band_4 = 6;
16-
float band_5 = 7;
17-
float band_6 = 8;
18-
float band_7 = 9;
15+
// Used only when mode == MODE_LOGARITHMIC
16+
float amplitude_gain = 2;
17+
float bands_gain = 3;
18+
// End when mode == MODE_LOGARITHMIC
1919

20-
// planned to be added later
21-
// float spectral_centroid = 10;
22-
// float spectral_flux = 11;
20+
float amplitude = 4;
2321

24-
// bool onset = 12;
22+
// Protobuf doesn't support fixed arrays -> 8 band fields
23+
float band_0 = 5;
24+
float band_1 = 6;
25+
float band_2 = 7;
26+
float band_3 = 8;
27+
float band_4 = 9;
28+
float band_5 = 10;
29+
float band_6 = 11;
30+
float band_7 = 12;
2531

26-
// float bpm = 13;
32+
// Future fields (keep numbering stable)
33+
// float spectral_centroid = 13;
34+
// float spectral_flux = 14;
35+
// bool onset = 15;
36+
// float bpm = 16;
2737
}

0 commit comments

Comments
 (0)