}
let (dsupp, decoder) = dec.unwrap();
- let ainfo = ainfo.unwrap().get_properties().get_audio_info().unwrap();
- let arate = if ainfo.sample_rate > 0 { ainfo.sample_rate } else { 44100 };
+ let info = ainfo.unwrap();
+ let ainfo = info.get_properties().get_audio_info().unwrap();
+ let sbr_hack = info.get_name() == "aac" && ainfo.sample_rate < 32000;
+ let arate = if ainfo.sample_rate > 0 {
+ if !sbr_hack {
+ ainfo.sample_rate
+ } else {
+ ainfo.sample_rate * 2
+ }
+ } else { 44100 };
let ch = ainfo.channels;
println!("Playing {} [{}Hz {}ch]", name, arate, ch);