summaryrefslogtreecommitdiff
path: root/examples/play_file.py
diff options
context:
space:
mode:
authorMatthias Geier <Matthias.Geier@gmail.com>2016-11-12 19:20:22 +0100
committerMatthias Geier <Matthias.Geier@gmail.com>2016-11-13 20:35:55 +0100
commit54b729cbe7ffd6e06f5690ae655d68b7900daa89 (patch)
tree413f1c805c4e7317c5197d7653495172056b952f /examples/play_file.py
parent653f3ec09cdaa9ec341f0aff9e607dc3243051f3 (diff)
DOC: Add example program play_long_file.py
Diffstat (limited to 'examples/play_file.py')
-rwxr-xr-xexamples/play_file.py11
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()