Commit 951a58df authored by Guido van Rossum's avatar Guido van Rossum

Adopted new readcd interface; caught interrupts

parent 25d77dc1
...@@ -24,15 +24,21 @@ def main(): ...@@ -24,15 +24,21 @@ def main():
a.sampwidth = AL.SAMPLE_16 a.sampwidth = AL.SAMPLE_16
a.nchannels = AL.STEREO a.nchannels = AL.STEREO
a.samprate = AL.RATE_44100 a.samprate = AL.RATE_44100
r = readcd.Readcd().init()
l = [] l = []
for arg in sys.argv[2:]: for arg in sys.argv[2:]:
l.append(eval(arg)) x = eval(arg)
print l try:
r = readcd.Readcd().init() l = len(x)
r.set(l) r.appendstretch(x[0], x[1])
except TypeError:
r.appendtrack(x)
r.setcallback(CD.AUDIO, writeaudio, a) r.setcallback(CD.AUDIO, writeaudio, a)
r.setcallback(CD.PTIME, ptimecallback, None) r.setcallback(CD.PTIME, ptimecallback, None)
r.play() try:
r.play()
except KeyboardInterrupt:
pass
a.destroy() a.destroy()
main() main()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment