diff options
Diffstat (limited to 'Lib/sndhdr.py')
-rw-r--r-- | Lib/sndhdr.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/sndhdr.py b/Lib/sndhdr.py index 240e507..e5901ec 100644 --- a/Lib/sndhdr.py +++ b/Lib/sndhdr.py @@ -32,6 +32,11 @@ explicitly given directories. __all__ = ['what', 'whathdr'] +from collections import namedtuple + +SndHeaders = namedtuple('SndHeaders', + 'filetype framerate nchannels nframes sampwidth') + def what(filename): """Guess the type of a sound file.""" res = whathdr(filename) @@ -45,7 +50,7 @@ def whathdr(filename): for tf in tests: res = tf(h, f) if res: - return res + return SndHeaders(*res) return None |