MCPcopy Create free account
hub / github.com/bajrangCoder/setu / probe_duration

Method probe_duration

src/components/audio_player.rs:67–73  ·  view source on GitHub ↗
(bytes: &[u8], _content_type: &str)

Source from the content-addressed store, hash-verified

65 }
66 }
67
68 fn probe_duration(bytes: &Bytes, _content_type: &str) -> Option<Duration> {
69 use rodio::Source;
70
71 let cursor = Cursor::new(bytes.clone());
72 let source = rodio::Decoder::try_from(cursor).ok()?;
73 source.total_duration()
74 }
75
76 fn ensure_backend(&mut self) -> bool {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected