Fixes re: zognia's testing #2
1 changed files with 6 additions and 5 deletions
|
@ -33,7 +33,7 @@ class AudioAlert(PluginBase):
|
||||||
else:
|
else:
|
||||||
self.clips[key][1] = maya.now()
|
self.clips[key][1] = maya.now()
|
||||||
|
|
||||||
stream_dq = self.streams.get(path, None)
|
stream_dq = self.streams.get(key, None)
|
||||||
if stream_dq is None:
|
if stream_dq is None:
|
||||||
stream_dq = deque(maxlen=poly)
|
stream_dq = deque(maxlen=poly)
|
||||||
self.streams[key] = stream_dq
|
self.streams[key] = stream_dq
|
||||||
|
@ -41,13 +41,14 @@ class AudioAlert(PluginBase):
|
||||||
if stream_dq.maxlen != poly:
|
if stream_dq.maxlen != poly:
|
||||||
self.logger.warn('Cannot change poly while streams are active!')
|
self.logger.warn('Cannot change poly while streams are active!')
|
||||||
|
|
||||||
if len(stream_dq) != poly:
|
if len(stream_dq) == stream_dq.maxlen:
|
||||||
|
stream_dq.rotate(1)
|
||||||
|
stream = stream_dq[0]
|
||||||
|
else:
|
||||||
stream = Stream(clip, self.output_index,
|
stream = Stream(clip, self.output_index,
|
||||||
buffer_length=self.buffer_length)
|
buffer_length=self.buffer_length)
|
||||||
stream_dq.append(stream)
|
stream_dq.append(stream)
|
||||||
else:
|
|
||||||
stream_dq.rotate(1)
|
|
||||||
stream = stream_dq[0]
|
|
||||||
|
|
||||||
if immediate:
|
if immediate:
|
||||||
asyncio.create_task(stream.aplay())
|
asyncio.create_task(stream.aplay())
|
||||||
|
|
Loading…
Add table
Reference in a new issue