Skip to content

Commit 30e7be1

Browse files
committed
Decoding example: Support more latency categories
1 parent 0f3ce63 commit 30e7be1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

examples/decoding.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,14 @@ fn main() {
2929
"samples/sample.webm", // 48kHz,
3030
];
3131

32-
let latency_hint = match std::env::var("WEB_AUDIO_LATENCY").as_deref() {
32+
let latency_hint = match std::env::var("WEB_AUDIO_LATENCY")
33+
.as_deref()
34+
.map(str::trim)
35+
.map(str::to_ascii_lowercase)
36+
.as_deref()
37+
{
38+
Ok("interactive") => AudioContextLatencyCategory::Interactive,
39+
Ok("balanced") => AudioContextLatencyCategory::Balanced,
3340
Ok("playback") => AudioContextLatencyCategory::Playback,
3441
_ => AudioContextLatencyCategory::default(),
3542
};

0 commit comments

Comments
 (0)