Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions proto/decentraland/sdk/components/audio_event.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,13 @@ option (common.ecs_component_id) = 1105;
message PBAudioEvent {
common.MediaState state = 1;
uint32 timestamp = 2; // monotonic counter

// Playback position report, written while a source that set `PBAudioSource.report_playback_position`
// is playing, so scenes can align gameplay with the audio that is actually heard (the renderer starts a
// clip some milliseconds after being asked to, and `PBAudioSource.current_time` is a write-only seek).
// Left unset on state changes that carry no position, on sources that did not opt in, and on players
// that expose no position at all, such as live audio streams.
optional uint32 tick_number = 3; // scene tick in which the report was taken, equals EngineInfo.tick_number
optional float current_offset = 4; // playback position of the clip in seconds at that tick
optional float clip_length = 5; // total length of the clip in seconds, when known
}
6 changes: 6 additions & 0 deletions proto/decentraland/sdk/components/audio_source.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,10 @@ message PBAudioSource {
string audio_clip_url = 5; // the clip path as given in the `files` array of the scene's manifest.
optional float current_time = 6; // specifies the current playback time of the clip in seconds (default: 0).
optional bool global = 7; // whether the audio plays at constant volume across the scene.

// Whether the renderer should report this source's playback position in `PBAudioEvent` while it plays
// (default: false). Media state changes are reported either way; this only enables the position reports,
// which a renderer writes far more often. Scenes that align gameplay with the audio they can actually hear
// set it; scenes playing fire-and-forget sounds leave it unset and pay nothing.
optional bool report_playback_position = 8;
}
Loading