(self, s)
Given relevant data from the ffmpeg output, set audio
        parameter fields on this object.
Given relevant data from the ffmpeg output, set audio
        parameter fields on this object.
Given relevant data from the ffmpeg output set audio parameter fields on this object .
def _parse_info(self, s):
        """Given relevant data from the ffmpeg output, set audio
        parameter fields on this object.
        """
        # Sample rate.
        match = re.search(r'(\d+) hz', s)
        if match:
            self.samplerate = int(match.group(1))
        else:
            self.samplerate = 0

        # Channel count.
        match = re.search(r'hz, ([^,]+),', s)
        if match:
            mode = match.group(1)
            if mode == 'stereo':
                self.channels = 2
            else:
                match = re.match(r'(\d+) ', mode)
                if match:
                    self.channels = int(match.group(1))
                else:
                    self.channels = 1
        else:
            self.channels = 0

        # Duration.
        match = re.search(
            r'duration: (\d+):(\d+):(\d+).(\d)', s
        )
        if match:
            durparts = list(map(int, match.groups()))
            duration = (
                durparts[0] * 60 * 60 +
                durparts[1] * 60 +
                durparts[2] +
                float(durparts[3]) / 10
            )
            self.duration = duration
        else:
            # No duration found.
            self.duration = 0
def _parse_info ( self , s ) : # Sample rate. match = re . search ( r'(\d+) hz' , s ) if match : self . samplerate = int ( match . group ( 1 ) ) else : self . samplerate = 0 # Channel count. match = re . search ( r'hz, ([^,]+),' , s ) if match : mode = match . group ( 1 ) if mode == 'stereo' : self . channels = 2 else : match = re . match ( r'(\d+) ' , mode ) if match : self . channels = int ( match . group ( 1 ) ) else : self . channels = 1 else : self . channels = 0 # Duration. match = re . search ( r'duration: (\d+):(\d+):(\d+).(\d)' , s ) if match : durparts = list ( map ( int , match . groups ( ) ) ) duration = ( durparts [ 0 ] * 60 * 60 + durparts [ 1 ] * 60 + durparts [ 2 ] + float ( durparts [ 3 ] ) / 10 ) self . duration = duration else : # No duration found. self . duration = 0