This commit is contained in:
encrypt 2020-04-15 20:17:43 +02:00
parent 17ec4d3bf7
commit 881905a4b3

View file

@ -32,19 +32,12 @@ cursor_time = None
cursor_time = time.time() - BUFFER
while mumble.is_alive():
if cursor_time < time.time() - BUFFER: # it's time to check audio
if cursor_time < time.time() - BUFFER:
base_sound = None
try:
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.first_sound().time >= cursor_time and
user.sound.first_sound().time < cursor_time + FLOAT_RESOLUTION ):
# available sound is to be treated now and not later
sound = user.sound.get_sound(FLOAT_RESOLUTION)
stereo_pcm = audioop.tostereo(sound.pcm, 2, 1, 1)
@ -63,4 +56,3 @@ while mumble.is_alive():
cursor_time += FLOAT_RESOLUTION
else:
time.sleep(FLOAT_RESOLUTION)