[EMAIL PROTECTED] wrote: >From reading the fcntl module's docs, I came to the following solution: > > try: > f = array.array('h', [0]) > fcntl.ioctl(audio_fd, ossaudiodev.SNDCTL_DSP_GETBLKSIZE, f, 1) > frag_size = f.tolist()[0] > except: > frag_size = -1 > if frag_size <= 0: > frag_size = 4096 > > I would feel more confident if anyone could explain how ioctl is supposed > to be used ( I also felt that I should use the try...except block for the > call in case it fails, but I don't have an idea "except *what*"). Fairly normal practice is to wait for a failure (or try to instigate one) _without_ the try: ... except: ..., and then use the one you get. Or, you could go for IOError, which sounds right to me. remember your current "except:" is catching any attempt at KeyBoardEscape (Control-C, Control-Break, and such like).
--Scott David Daniels [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list