Skip to content
Advertisement

Tag: pyglet

Why python tries to use directly Alsa as a sound output?

I’m using Ubuntu 20.04.5 LTS When I try to play sound with pygame or pyglet, it plays it normally. However, when my computer is playing sound from any other source, I just get error Here is the pygame version I get an error: It seems that pygame tries to play audio directly from ALSA and that’s why I cannot play

Pyglet game movement lagging behind

So, my snake makes a continuous movement, but if I press any key it goes back in time and lags back and forward. Here is a video: https://youtu.be/KCesu5bGiS8 My guess would be to update the key input faster, but when I do that everything updates faster, so the snake goes faster etc. Code (as requested in text form) here: Answer

pyglet: on_resize breaks graphics

I’m writing an application with pyglet where all rendered objects are children of the window class. I’m trying to draw a simple rectangle, but using on_resize seems to break everything. There’s no error message, it just doesn’t draw the rectangle. This is my file structure: This code doesn’t work, but if I remove the on_resize methods it does: I would

how to play wav file in python?

I tried pygame for playing wav file like this: but It change the voice and I don’t know why! I read this link solutions and can’t solve my problem with playing wave file! for this solution I dont know what should I import? and for this solution /dev/dsp dosen’t exist in new version of linux : and when I tried

Advertisement