]> granicus.if.org Git - python/commitdiff
Fixed example
authorJack Jansen <jack.jansen@cwi.nl>
Tue, 2 Jan 1996 12:09:30 +0000 (12:09 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Tue, 2 Jan 1996 12:09:30 +0000 (12:09 +0000)
Mac/Lib/Audio_mac.py

index 373f16a9e33aeb47f8f91d89f596af093d76cba1..fef7d6e745864cc91edb660efcdd14bdbb79110f 100644 (file)
@@ -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__':