def bitdepth ( self ) : if hasattr ( self . mgfile . info , 'bits_per_sample' ) : return self . mgfile . info . bits_per_sample return 0
get bit depth of audio python
The number of bits per sample in the audio encoding ( an int ) . Only available for certain file formats ( zero where unavailable ) .
def bitdepth(self):
        """The number of bits per sample in the audio encoding (an int).
        Only available for certain file formats (zero where
        unavailable).
        """
        if hasattr(self.mgfile.info, 'bits_per_sample'):
            return self.mgfile.info.bits_per_sample
        return 0