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

Method audio_format_label

src/components/audio_player.rs:340–357  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

338 if ct.contains("mp3") || ct.contains("mpeg") {
339 "MP3"
340 } else if ct.contains("wav") {
341 "WAV"
342 } else if ct.contains("ogg") {
343 "OGG"
344 } else if ct.contains("flac") {
345 "FLAC"
346 } else if ct.contains("aac") {
347 "AAC"
348 } else if ct.contains("webm") {
349 "WebM"
350 } else {
351 "Audio"
352 }
353 }
354
355 fn format_size(bytes: usize) -> String {
356 if bytes < 1024 {
357 format!("{} B", bytes)
358 } else if bytes < 1024 * 1024 {
359 format!("{:.1} KB", bytes as f64 / 1024.0)
360 } else {

Callers 1

renderMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected