(duration: Duration)
| 1173 | (duration.as_secs_f64() * SAMPLE_RATE as f64).max(0.0) as u64 |
| 1174 | } |
| 1175 | |
| 1176 | #[doc(hidden)] |
| 1177 | pub fn parse_built_in_midi_file(bytes: &[u8]) -> Result<Arc<BuiltInMidiFileData>, String> { |
| 1178 | let smf = Smf::parse(bytes).map_err(|err| err.to_string())?; |
| 1179 | let ticks_per_beat = match smf.header.timing { |
| 1180 | Timing::Metrical(ticks) => ticks.as_int().max(1) as f64, |
no test coverage detected