Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d9feb59

Browse files
committed
Adopted new readcd interface; caught interrupts
1 parent f94e309 commit d9feb59

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

Demo/sgi/cd/cdaiff.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,21 @@ def main():
2424
a.sampwidth = AL.SAMPLE_16
2525
a.nchannels = AL.STEREO
2626
a.samprate = AL.RATE_44100
27+
r = readcd.Readcd().init()
2728
l = []
2829
for arg in sys.argv[2:]:
29-
l.append(eval(arg))
30-
print l
31-
r = readcd.Readcd().init()
32-
r.set(l)
30+
x = eval(arg)
31+
try:
32+
l = len(x)
33+
r.appendstretch(x[0], x[1])
34+
except TypeError:
35+
r.appendtrack(x)
3336
r.setcallback(CD.AUDIO, writeaudio, a)
3437
r.setcallback(CD.PTIME, ptimecallback, None)
35-
r.play()
38+
try:
39+
r.play()
40+
except KeyboardInterrupt:
41+
pass
3642
a.destroy()
3743

3844
main()

0 commit comments

Comments
 (0)