:mod:`sndhdr` --- Determine type of sound file ============================================== .. module:: sndhdr :synopsis: Determine type of a sound file. .. sectionauthor:: Fred L. Drake, Jr. .. Based on comments in the module source file. .. index:: single: A-LAW single: u-LAW The :mod:`sndhdr` provides utility functions which attempt to determine the type of sound data which is in a file. When these functions are able to determine what type of sound data is stored in a file, they return a tuple ``(type, sampling_rate, channels, frames, bits_per_sample)``. The value for *type* indicates the data type and will be one of the strings ``'aifc'``, ``'aiff'``, ``'au'``, ``'hcom'``, ``'sndr'``, ``'sndt'``, ``'voc'``, ``'wav'``, ``'8svx'``, ``'sb'``, ``'ub'``, or ``'ul'``. The *sampling_rate* will be either the actual value or ``0`` if unknown or difficult to decode. Similarly, *channels* will be either the number of channels or ``0`` if it cannot be determined or if the value is difficult to decode. The value for *frames* will be either the number of frames or ``-1``. The last item in the tuple, *bits_per_sample*, will either be the sample size in bits or ``'A'`` for A-LAW or ``'U'`` for u-LAW. .. function:: what(filename) Determines the type of sound data stored in the file *filename* using :func:`whathdr`. If it succeeds, returns a tuple as described above, otherwise ``None`` is returned. .. function:: whathdr(filename) Determines the type of sound data stored in a file based on the file header. The name of the file is given by *filename*. This function returns a tuple as described above on success, or ``None``. ctive' href='/oss-git/cpython.git/tree/Lib?h=v3.8.14&id=621601a698a285a45231a6fd223db33566dcb842'>treecommitdiffstats
path: root/Lib
ModeNameSize
-rw-r--r--__future__.py4380logstatsplain
-rw-r--r--__phello__.foo.py64logstatsplain
-rw-r--r--_abcoll.py15066logstatsplain
-rw-r--r--_dummy_thread.py4431logstatsplain
-rw-r--r--_markupbase.py14305logstatsplain
-rw-r--r--_strptime.py19757logstatsplain
-rw-r--r--_threading_local.py6935logstatsplain
-rw-r--r--_weakrefset.py4173logstatsplain
-rw-r--r--abc.py6781logstatsplain
-rw-r--r--aifc.py30853logstatsplain
-rw-r--r--antigravity.py60logstatsplain
-rw-r--r--ast.py11340logstatsplain
-rw-r--r--asynchat.py12133logstatsplain
-rw-r--r--asyncore.py19201logstatsplain
-rwxr-xr-xbase64.py13335logstatsplain
-rw-r--r--bdb.py20379logstatsplain
-rw-r--r--binhex.py13890logstatsplain
-rw-r--r--bisect.py2662logstatsplain
-rw-r--r--build_class.py0logstatsplain
-rwxr-xr-xcProfile.py6363logstatsplain
-rw-r--r--calendar.py22681logstatsplain
-rwxr-xr-xcgi.py30158logstatsplain
-rw-r--r--cgitb.py12009logstatsplain
-rw-r--r--chunk.py5377logstatsplain
-rw-r--r--cmd.py14815logstatsplain
-rw-r--r--code.py9602logstatsplain
-rw-r--r--codecs.py34798logstatsplain
-rw-r--r--codeop.py6007logstatsplain
-rw-r--r--collections.py17446logstatsplain
-rw-r--r--colorsys.py3459logstatsplain
-rw-r--r--compileall.py5612logstatsplain
-rw-r--r--configparser.py24475logstatsplain
-rw-r--r--contextlib.py4191logstatsplain
-rw-r--r--copy.py9808logstatsplain
-rw-r--r--copyreg.py6633logstatsplain
-rw-r--r--csv.py15232logstatsplain
d---------ctypes217logstatsplain
d---------curses225logstatsplain
d---------dbm143logstatsplain
-rw-r--r--decimal.py198486logstatsplain
-rw-r--r--difflib.py81072logstatsplain