Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PCM stuttering #138

Open
marcomac01 opened this issue Jan 6, 2024 · 1 comment
Open

PCM stuttering #138

marcomac01 opened this issue Jan 6, 2024 · 1 comment

Comments

@marcomac01
Copy link

Hi guys. I was trying to make a simple mumble client. I wrote the basics but the audio i get stutters a lot. The code follows:

import pymumble_py3
from pymumble_py3.callbacks import PYMUMBLE_CLBK_SOUNDRECEIVED as PCS
import alsaaudio as a

# Mumble server connection Settings
password = "" 
server = "192.168.1.61"  
username = "Pi"
port = 64738 

# Audio stream settings
CHUNK = 5000
DATATYPE = 'int16'
CHANNELS = 1
RATE = 48000

# Inistialize the audio stream using devices



# This part is about the connection to the Mumble Server
# Setting 


device = 'hw:CARD=PCH,DEV=0'
out = a.PCM(a.PCM_PLAYBACK, channels=1, rate=48000, format=a.PCM_FORMAT_S16_LE, periodsize=32,
             device=device, mode=a.PCM_NONBLOCK)
def sound_received_handler(user, soundchunk):
    out.write(soundchunk.pcm)
    pass


mumble = pymumble_py3.Mumble(server, username, password=password, port=port)
mumble.callbacks.set_callback(PCS, sound_received_handler)
mumble.set_receive_sound(1)
mumble.start()
mumble.is_ready()

while True:
    pass

thanks for your patience

@ossilator
Copy link
Collaborator

ossilator commented Jan 31, 2024

if you were not using version 0.10.0, then you most probably just saw the effect of buffer underruns, which this library unfortunately just papers over. i had sort of fixed that, but it was reverted (for the time being) - see #130.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants