ó
è¾bc           @   sd   d  Z  d d l m Z e d d d ƒ[ d Z d e f d „  ƒ  YZ d	 „  Z d
 „  Z d „  Z d S(   s   Interpret sun audio headers.iÿÿÿÿ(   t   warnpy3ksP   the sunaudio module has been removed in Python 3.0; use the sunau module insteadt
   stackleveli   s   .sndt   errorc           B   s   e  Z RS(    (   t   __name__t
   __module__(    (    (    s   /usr/lib/python2.7/sunaudio.pyR   
   s   c         C   sD   t  |  d ƒ d >t  |  d ƒ d >Bt  |  d ƒ d >Bt  |  d ƒ BS(   s"   Convert a 4-char value to integer.i    i   i   i   i   i   i   (   t   ord(   t   s(    (    s   /usr/lib/python2.7/sunaudio.pyt   get_long_be   s    c         C   sã   |  j  d ƒ t k r! t d ‚ n  t |  j  d ƒ ƒ } t |  j  d ƒ ƒ } t |  j  d ƒ ƒ } t |  j  d ƒ ƒ } t |  j  d ƒ ƒ } | d } | d k  r¬ t d ‚ n  | d k rÊ |  j  | ƒ } n d } | | | | | f S(   s&   Read a sound header from an open file.i   s   gethdr: bad magic wordi   i    s   gethdr: bad hdr_sizet    (   t   readt   MAGICR   R   (   t   fpt   hdr_sizet	   data_sizet   encodingt   sample_ratet   channelst   excesst   info(    (    s   /usr/lib/python2.7/sunaudio.pyt   gethdr   s    
c         C   s‹   t  t |  d ƒ ƒ } | \ } } } } } x | d d k rJ | d  } q- Wd G|  GHd G| GHd G| GHd G| GHd G| GHd	 Gt | ƒ GHd
 S(   s0   Read and print the sound header of a named file.t   riÿÿÿÿs    s   File name:  s   Data size:  s   Encoding:   s   Sample rate:s   Channels:   s   Info:       N(   R   t   opent   repr(   t   filet   hdrR   R   R   R   R   (    (    s   /usr/lib/python2.7/sunaudio.pyt   printhdr&   s    					N(	   t   __doc__t   warningsR    R
   t	   ExceptionR   R   R   R   (    (    (    s   /usr/lib/python2.7/sunaudio.pyt   <module>   s   			