(path_ptr: *const u8)
| 1174 | |
| 1175 | #[no_mangle] |
| 1176 | pub extern "C" fn bloom_load_music(path_ptr: *const u8) -> f64 { |
| 1177 | let path = str_from_header(path_ptr); |
| 1178 | match std::fs::read(resolve_path(path)) { |
| 1179 | Ok(data) => { |
| 1180 | if let Some(s) = parse_ogg(&data) { engine().audio.load_music(s) } |
| 1181 | else if let Some(s) = parse_wav(&data) { engine().audio.load_music(s) } |
| 1182 | else if let Some(s) = parse_mp3(&data) { engine().audio.load_music(s) } |
| 1183 | else { 0.0 } |
| 1184 | } |
| 1185 | Err(_) => 0.0, |
| 1186 | } |
| 1187 | } |
| 1188 | #[no_mangle] |
| 1189 | pub extern "C" fn bloom_play_music(handle: f64) { engine().audio.play_music(handle); } |
| 1190 | #[no_mangle] |
nothing calls this directly
no test coverage detected