summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1996-01-02 12:09:30 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1996-01-02 12:09:30 (GMT)
commit6601964f7b07cce77e3558cb88a7e539b65c495a (patch)
tree8a45ed6c6715c3c0b3c7aa77f030672b11df0fa0
parente8ea21b0fe21df7b5889ff851751c6614810550e (diff)
downloadcpython-6601964f7b07cce77e3558cb88a7e539b65c495a.zip
cpython-6601964f7b07cce77e3558cb88a7e539b65c495a.tar.gz
cpython-6601964f7b07cce77e3558cb88a7e539b65c495a.tar.bz2
Fixed example
-rw-r--r--Mac/Lib/Audio_mac.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Mac/Lib/Audio_mac.py b/Mac/Lib/Audio_mac.py
index 373f16a..fef7d6e 100644
--- a/Mac/Lib/Audio_mac.py
+++ b/Mac/Lib/Audio_mac.py
@@ -89,8 +89,12 @@ class Play_Audio_mac:
import audioop
return audioop.ulaw2lin(data, 2)
-def test(fn = 'f:just samples:just.aif'):
+def test():
import aifc
+ import macfs
+ fss, ok = macfs.PromptGetFile("Select an AIFF soundfile", "AIFF")
+ if not ok: return
+ fn = fss.as_pathname()
af = aifc.open(fn, 'r')
print af.getparams()
p = Play_Audio_mac()
@@ -102,6 +106,7 @@ def test(fn = 'f:just samples:just.aif'):
data = af.readframes(BUFSIZ)
if not data: break
p.writeframes(data)
+ print 'wrote', len(data), 'space', p.getfillable()
p.wait()
if __name__ == '__main__':