(path_ptr: *const u8)
| 1411 | |
| 1412 | #[no_mangle] |
| 1413 | pub extern "C" fn bloom_load_music(path_ptr: *const u8) -> f64 { |
| 1414 | let path = str_from_header(path_ptr); |
| 1415 | match std::fs::read(path) { |
| 1416 | Ok(data) => { |
| 1417 | if let Some(s) = parse_ogg(&data) { engine().audio.load_music(s) } |
| 1418 | else if let Some(s) = parse_wav(&data) { engine().audio.load_music(s) } |
| 1419 | else if let Some(s) = parse_mp3(&data) { engine().audio.load_music(s) } |
| 1420 | else { 0.0 } |
| 1421 | } |
| 1422 | Err(_) => 0.0, |
| 1423 | } |
| 1424 | } |
| 1425 | #[no_mangle] |
| 1426 | pub extern "C" fn bloom_play_music(handle: f64) { engine().audio.play_music(handle); } |
| 1427 | #[no_mangle] |
nothing calls this directly
no test coverage detected