php IHDR w Q )Ba pHYs sRGB gAMA a IDATxMk\U s&uo,mD )Xw+e?tw.oWp;QHZnw`gaiJ9̟灙a=nl[ ʨ G;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ y H@E7j 1j+OFRg}ܫ;@Ea~ j`u'o> j- $_q?qS XzG'ay
files >> /usr/lib/python2.6/ |
files >> //usr/lib/python2.6/sndhdr.pyc |
Lc @ s, d Z d d g Z d Z d Z g Z d Z e i e d Z e i e d Z e i e d Z e i e d Z e i e d Z e i e d Z e i e d Z e i e d Z d Z d Z d Z d Z d Z e d j o e n d S( s Routines to help recognizing sound files. Function whathdr() recognizes various types of sound file headers. It understands almost all headers that SOX can decode. The return tuple contains the following items, in this order: - file type (as SOX understands it) - sampling rate (0 if unknown or hard to decode) - number of channels (0 if unknown or hard to decode) - number of frames in the file (-1 if unknown or hard to decode) - number of bits/sample, or 'U' for U-LAW, or 'A' for A-LAW If the file doesn't have a recognizable type, it returns None. If the file can't be opened, IOError is raised. To compute the total time, divide the number of frames by the sampling rate (a frame contains a sample for each channel). Function what() calls whathdr(). (It used to also use some heuristics for raw data, but this doesn't work very well.) Finally, the function test() is a simple main program that calls what() for all files mentioned on the argument list. For directory arguments it calls what() for all files in that directory. Default argument is "." (testing all files in the current directory). The option -r tells it to recurse down directories found inside explicitly given directories. t whatt whathdrc C s t | } | S( s Guess the type of a sound file( R ( t filenamet res( ( s /usr/lib/python2.6/sndhdr.pyR # s c C sN t | d } | i d } x) t D]! } | | | } | o | Sq% Wd S( s Recognize sound headerst rbi N( t opent readt testst None( R t ft ht tfR ( ( s /usr/lib/python2.6/sndhdr.pyR ) s c C s d d k } | d d j o d S| d d !d j o d } n# | d d !d j o d } n d S| i d y | i | d } Wn t | i f j o d SX| | i | i | i d | i f S( Nii t FORMi i t AIFCt aifct AIFFt aiffi t r( R R t seekt openfpt EOFErrort Errort getframeratet getnchannelst getnframest getsampwidth( R R R t fmtt a( ( s /usr/lib/python2.6/sndhdr.pyt test_aifc: s c C s | d d j o t } n | d d j o t } n d Sd } | | d d ! } | | d d ! } | | d d ! } | | d d ! } | | d d ! } d } | d j o d } n; | d j o d } n$ | d j o d } d } n d } | | } | | | | | | f S( Ni s .sndt ds.s dns.t aui i i i i i t Ui i t ?( R s dns.( t get_long_bet get_long_leR ( R R t typet hdr_sizet data_sizet encodingt ratet nchannelst sample_sizet sample_bitst frame_size( ( s /usr/lib/python2.6/sndhdr.pyt test_auO s, c C sW | d d !d j p | d d !d j o d St | d d ! } d d | d d d f S( NiA iE t FSSDi i t HCOMi i t hcomi"V i ii i i ( R R! ( R R t divisor( ( s /usr/lib/python2.6/sndhdr.pyt test_hcoml s (c C s | d d j o d St | d d ! } d } d | j o d j n o= | | d j o, t | | d } t d d | } n d | d d d f S( Ni s Creative Voice Filei i i s i g .Ai t voci ii ( R t get_short_let ordt int( R R t sbseekR' t ratecode( ( s /usr/lib/python2.6/sndhdr.pyt test_vocu s /c C s | d d j p( | d d !d j p | d d !d j o d St | d d ! } t | d d ! } t | d d ! } t | d d ! } d | | d | f S( Ni t RIFFi i t WAVEi s fmt i i i i i"