MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / bloom_load_sound

Function bloom_load_sound

native/ios/src/lib.rs:1786–1802  ·  view source on GitHub ↗
(path_ptr: *const u8)

Source from the content-addressed store, hash-verified

1784
1785#[no_mangle]
1786pub extern "C" fn bloom_load_sound(path_ptr: *const u8) -> f64 {
1787 let path = str_from_header(path_ptr);
1788 match std::fs::read(resolve_path(path)) {
1789 Ok(data) => {
1790 if let Some(s) = parse_wav(&data) {
1791 engine().audio.load_sound(s)
1792 } else if let Some(s) = parse_ogg(&data) {
1793 engine().audio.load_sound(s)
1794 } else if let Some(s) = parse_mp3(&data) {
1795 engine().audio.load_sound(s)
1796 } else {
1797 0.0
1798 }
1799 }
1800 Err(_) => 0.0,
1801 }
1802}
1803
1804#[no_mangle]
1805pub extern "C" fn bloom_play_sound(handle: f64) { engine().audio.play_sound(handle); }

Callers 1

loadSoundFunction · 0.50

Calls 7

str_from_headerFunction · 0.85
parse_wavFunction · 0.85
parse_oggFunction · 0.85
parse_mp3Function · 0.85
load_soundMethod · 0.80
resolve_pathFunction · 0.70
engineFunction · 0.70

Tested by

no test coverage detected