snellito
This commit is contained in:
parent
17ec4d3bf7
commit
881905a4b3
1 changed files with 11 additions and 19 deletions
|
@ -32,26 +32,19 @@ cursor_time = None
|
||||||
cursor_time = time.time() - BUFFER
|
cursor_time = time.time() - BUFFER
|
||||||
|
|
||||||
while mumble.is_alive():
|
while mumble.is_alive():
|
||||||
|
if cursor_time < time.time() - BUFFER:
|
||||||
if cursor_time < time.time() - BUFFER: # it's time to check audio
|
|
||||||
base_sound = None
|
base_sound = None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
for user in mumble.users.values(): # check the audio queue of each user
|
for user in mumble.users.values(): # check the audio queue of each user
|
||||||
while ( user.sound.is_sound() and
|
|
||||||
user.sound.first_sound().time < cursor_time):
|
|
||||||
user.sound.get_sound(FLOAT_RESOLUTION) # forget about too old sounds
|
|
||||||
|
|
||||||
if user.sound.is_sound():
|
if user.sound.is_sound():
|
||||||
if ( user.sound.first_sound().time >= cursor_time and
|
# available sound is to be treated now and not later
|
||||||
user.sound.first_sound().time < cursor_time + FLOAT_RESOLUTION ):
|
sound = user.sound.get_sound(FLOAT_RESOLUTION)
|
||||||
# available sound is to be treated now and not later
|
stereo_pcm = audioop.tostereo(sound.pcm, 2, 1, 1)
|
||||||
sound = user.sound.get_sound(FLOAT_RESOLUTION)
|
if base_sound == None:
|
||||||
stereo_pcm = audioop.tostereo(sound.pcm, 2, 1, 1)
|
base_sound = stereo_pcm
|
||||||
if base_sound == None:
|
else:
|
||||||
base_sound = stereo_pcm
|
base_sound = audioop.add(base_sound, stereo_pcm, 2)
|
||||||
else:
|
|
||||||
base_sound = audioop.add(base_sound, stereo_pcm, 2)
|
|
||||||
except RuntimeError:
|
except RuntimeError:
|
||||||
eprint("ignored exception in stderr...")
|
eprint("ignored exception in stderr...")
|
||||||
|
|
||||||
|
@ -63,4 +56,3 @@ while mumble.is_alive():
|
||||||
cursor_time += FLOAT_RESOLUTION
|
cursor_time += FLOAT_RESOLUTION
|
||||||
else:
|
else:
|
||||||
time.sleep(FLOAT_RESOLUTION)
|
time.sleep(FLOAT_RESOLUTION)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue