diff options
| author | Matthias Geier <Matthias.Geier@gmail.com> | 2016-11-12 19:20:22 +0100 |
|---|---|---|
| committer | Matthias Geier <Matthias.Geier@gmail.com> | 2016-11-13 20:35:55 +0100 |
| commit | 54b729cbe7ffd6e06f5690ae655d68b7900daa89 (patch) | |
| tree | 413f1c805c4e7317c5197d7653495172056b952f /examples/play_file.py | |
| parent | 653f3ec09cdaa9ec341f0aff9e607dc3243051f3 (diff) | |
DOC: Add example program play_long_file.py
Diffstat (limited to 'examples/play_file.py')
| -rwxr-xr-x | examples/play_file.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/examples/play_file.py b/examples/play_file.py index 29a594c..d3fabb2 100755 --- a/examples/play_file.py +++ b/examples/play_file.py @@ -1,7 +1,12 @@ #!/usr/bin/env python3 -"""Load an audio file and play its contents. +"""Load an audio file into memory and play its contents. -PySoundFile (https://github.com/bastibe/PySoundFile/) has to be installed! +NumPy and the soundfile module (http://PySoundFile.rtfd.io/) must be +installed for this to work. + +This example program loads the whole file into memory before starting +playback. +To play very long files, you should use play_long_file.py instead. """ import argparse @@ -16,7 +21,7 @@ def int_or_str(text): return text parser = argparse.ArgumentParser(description=__doc__) -parser.add_argument("filename", help="audio file to be played back") +parser.add_argument('filename', help='audio file to be played back') parser.add_argument('-d', '--device', type=int_or_str, help='output device (numeric ID or substring)') args = parser.parse_args() |
