INNER CODE UNIT · Rust
Some
xiaobaimc/myune_music · rust/src/api/audio_info.rs:124
if let Some(album_artist_str) = tag.get_string(ItemKey::AlbumArtist) {
info.album_artist = Some(album_artist_str.to_string());
}
}
if options.need_track_number {
if let Some(track_str) = tag.get_string(ItemKey::TrackNumber) {
info.track_number = track_str.parse::<u32>().ok();
}
}
}
// 只在需要时读取音频属性,避免未使用警告
if options.need_audio_props {
let props = tagged_file.properties();
info.duration_ms = Some(props.duration().as_millis() as u64);
info.sample_rate = props.sample_rate();