(path_ptr: *const u8)
| 1574 | |
| 1575 | #[no_mangle] |
| 1576 | pub extern "C" fn bloom_load_music(path_ptr: *const u8) -> f64 { |
| 1577 | let path = str_from_header(path_ptr); |
| 1578 | match std::fs::read(path) { |
| 1579 | Ok(data) => { |
| 1580 | if let Some(s) = parse_ogg(&data) { engine().audio.load_music(s) } |
| 1581 | else if let Some(s) = parse_wav(&data) { engine().audio.load_music(s) } |
| 1582 | else if let Some(s) = parse_mp3(&data) { engine().audio.load_music(s) } |
| 1583 | else { 0.0 } |
| 1584 | } |
| 1585 | Err(_) => 0.0, |
| 1586 | } |
| 1587 | } |
| 1588 | #[no_mangle] |
| 1589 | pub extern "C" fn bloom_play_music(handle: f64) { engine().audio.play_music(handle); } |
| 1590 | #[no_mangle] |
nothing calls this directly
no test coverage detected