pub fn track_info(&self) -> AudioTrackInfo {
        let mut ai = AudioTrackInfo {
            codec_id:   "mp4a".to_string(),
            codec_name: Some("MPEG4 Audio".to_string()),
            channel_count:  self.channel_count as u16,
            bit_depth: if self.sample_size > 0 { Some(self.sample_size) } else { None },
            sample_rate: if self.sample_rate_hi > 0 { Some(self.sample_rate_hi as u32) } else { None },
            ..AudioTrackInfo::default()
        };

        if let Some(esds) = first_box!(&self.boxes, ESDescriptorBox) {
            ai.codec_id = esds.codec_id();
            ai.codec_name = Some(esds.codec_name().to_string());
            let config = &esds.es_descriptor.decoder_config;
            if let Some(ref audio) = config.specific_info.audio {
                ai.channel_configuration = match audio.channel_config {
                    1 => Some("C"),
                    2 => Some("L,R"),
                    3 => Some("C,L,R"),
                    4 => Some("C,L,R,S"),
                    5 => Some("C,L,R,LS,RS"),
                    6 => Some("C,L,R,LS,RS"),
                    _ => None,
                }.map(|x| x.to_string());
                let c = match audio.channel_config {
                    1 => 1,
                    2 => 2,
                    3 => 3,
                    4 => 4,
                    5 => 5,
                    6 => 5,
                    7 => 7,
                    11 => 6,
                    12 => 7,
                    13 => 22,
                    14 =>7,
                    _ => 0,
                };
                if c > 0 {
                    ai.channel_count = c;
                }
                ai.lfe_channel = match audio.channel_config {
                    6|7|11|12|13|14 => true,
                    _ => false,
                };
                if audio.sampling_frequency_index < 12 {
                    let sr: u32 = [ 
                        96000, 88200, 64000, 48000, 44100, 32000,
                        24000, 22050, 16000, 12000, 11025, 8000
                    ][audio.sampling_frequency_index as usize];
                    ai.sample_rate = Some(sr);
                } else if audio.sampling_frequency_index == 0xf && audio.sampling_frequency > 0 {
                    ai.sample_rate = Some(audio.sampling_frequency);
                }
            }
        }

        ai
    }
/// Return audio specific track info.
Return audio specific track info.
Return audio specific track info .
pub fn track_info(&self) -> AudioTrackInfo {
        let mut ai = AudioTrackInfo {
            codec_id:   "mp4a".to_string(),
            codec_name: Some("MPEG4 Audio".to_string()),
            channel_count:  self.channel_count as u16,
            bit_depth: if self.sample_size > 0 { Some(self.sample_size) } else { None },
            sample_rate: if self.sample_rate_hi > 0 { Some(self.sample_rate_hi as u32) } else { None },
            ..AudioTrackInfo::default()
        };
        if let Some(esds) = first_box!(&self.boxes, ESDescriptorBox) {
            ai.codec_id = esds.codec_id();
            ai.codec_name = Some(esds.codec_name().to_string());
            let config = &esds.es_descriptor.decoder_config;
            if let Some(ref audio) = config.specific_info.audio {
                ai.channel_configuration = match audio.channel_config {
                    1 => Some("C"),
                    2 => Some("L,R"),
                    3 => Some("C,L,R"),
                    4 => Some("C,L,R,S"),
                    5 => Some("C,L,R,LS,RS"),
                    6 => Some("C,L,R,LS,RS"),
                    _ => None,
                }.map(|x| x.to_string());
                let c = match audio.channel_config {
                    1 => 1,
                    2 => 2,
                    3 => 3,
                    4 => 4,
                    5 => 5,
                    6 => 5,
                    7 => 7,
                    11 => 6,
                    12 => 7,
                    13 => 22,
                    14 =>7,
                    _ => 0,
                };
                if c > 0 {
                    ai.channel_count = c;
                }
                ai.lfe_channel = match audio.channel_config {
                    6|7|11|12|13|14 => true,
                    _ => false,
                };
                if audio.sampling_frequency_index < 12 {
                    let sr: u32 = [ 
                        96000, 88200, 64000, 48000, 44100, 32000,
                        24000, 22050, 16000, 12000, 11025, 8000
                    ][audio.sampling_frequency_index as usize];
                    ai.sample_rate = Some(sr);
                } else if audio.sampling_frequency_index == 0xf && audio.sampling_frequency > 0 {
                    ai.sample_rate = Some(audio.sampling_frequency);
                }
            }
        }
        ai
    }
pub fn track_info ( & self ) -> AudioTrackInfo { let mut ai = AudioTrackInfo { codec_id : " " . to_string ( ) , codec_name : Some ( " " . to_string ( ) ) , channel_count : self . channel_count as u16 , bit_depth : if self . sample_size > 0 { Some ( self . sample_size ) } else { None } , sample_rate : if self . sample_rate_hi > 0 { Some ( self . sample_rate_hi as u32 ) } else { None } , .. AudioTrackInfo :: default ( ) } ; if let Some ( esds ) = first_box ! ( self boxes ESDescriptorBox ) { ai . codec_id = esds . codec_id ( ) ; ai . codec_name = Some ( esds . codec_name ( ) . to_string ( ) ) ; let config = & esds . es_descriptor . decoder_config ; if let Some ( ref audio ) = config . specific_info . audio { ai . channel_configuration = match audio . channel_config { 1 => Some ( " " ) , 2 => Some ( " " ) , 3 => Some ( " " ) , 4 => Some ( " " ) , 5 => Some ( " " ) , 6 => Some ( " " ) , _ => None , } . map ( | x | x . to_string ( ) ) ; let c = match audio . channel_config { 1 => 1 , 2 => 2 , 3 => 3 , 4 => 4 , 5 => 5 , 6 => 5 , 7 => 7 , 11 => 6 , 12 => 7 , 13 => 22 , 14 => 7 , _ => 0 , } ; if c > 0 { ai . channel_count = c ; } ai . lfe_channel = match audio . channel_config { 6 | 7 | 11 | 12 | 13 | 14 => true , _ => false , } ; if audio . sampling_frequency_index < 12 { let sr : u32 = [ 96000 , 88200 , 64000 , 48000 , 44100 , 32000 , 24000 , 22050 , 16000 , 12000 , 11025 , 8000 ] [ audio . sampling_frequency_index as usize ] ; ai . sample_rate = Some ( sr ) ; } else if audio . sampling_frequency_index == 0xf && audio . sampling_frequency > 0 { ai . sample_rate = Some ( audio . sampling_frequency ) ; } } } ai }
Return audio specific track info.
Return audio specific track info .
&self
&self