diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 1996-03-18 13:33:48 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 1996-03-18 13:33:48 (GMT) |
commit | 52a40ac03b68366d39d60e1801dd9129d07a8847 (patch) | |
tree | 421a22feafce5aca1c6fa8161518d1eb18a50599 /Mac/Lib/Audio_mac.py | |
parent | dca8788d1c3baf4211068659f46367ec7f7f9311 (diff) | |
download | cpython-52a40ac03b68366d39d60e1801dd9129d07a8847.zip cpython-52a40ac03b68366d39d60e1801dd9129d07a8847.tar.gz cpython-52a40ac03b68366d39d60e1801dd9129d07a8847.tar.bz2 |
Added option to set queue size
Diffstat (limited to 'Mac/Lib/Audio_mac.py')
-rw-r--r-- | Mac/Lib/Audio_mac.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Mac/Lib/Audio_mac.py b/Mac/Lib/Audio_mac.py index d64bf4d..450cdf1 100644 --- a/Mac/Lib/Audio_mac.py +++ b/Mac/Lib/Audio_mac.py @@ -1,10 +1,11 @@ QSIZE = 100000 +error='Audio_mac.error' class Play_Audio_mac: - def __init__(self): + def __init__(self, qsize=QSIZE): self._chan = None - self._qsize = QSIZE + self._qsize = qsize self._outrate = 22254 self._sampwidth = 1 self._nchannels = 1 @@ -46,7 +47,7 @@ class Play_Audio_mac: self._chan = Snd.SndNewChannel(5, 0, self._callback) nframes = len(data) / self._nchannels / self._sampwidth if len(data) != nframes * self._nchannels * self._sampwidth: - raise ValueError, 'data is not a whole number of frames' + raise error, 'data is not a whole number of frames' while self._gc and \ self.getfilled() + nframes > \ self._qsize / self._nchannels / self._sampwidth: |