[pythonvis] Re: Managing keyboard and sounds with Python. Was: Re: Questions from a beginner

  • From: Bobby McNab <kiltedmenace161@xxxxxxxxx>
  • To: pythonvis@xxxxxxxxxxxxx
  • Date: Wed, 5 May 2021 08:47:50 +0100

Hi,

Have you tried lucia?

pip install lucia

Similar to the blastbay toolkit, it's a python library for creating audio games.

Bobby


On 05/05/2021 07:45, Gabriele Battaglia (Redacted sender iz4apu for DMARC) wrote:

Ciao Immigrant.
Those you have are my same problems with Python.
I'm also used to create small games and tools for me and my friends and I also would like to include sounds generated by python, not saved in wav file and use keystrokes not in a form of input that block the script's flow.
I tried many many solution but, due to my lack of knoledge, I've never been able to find something sadisfiying for me.

If you develope for Windows only, you can solve the keyboard problem by importing the msvcrt library than use its KBhit function, which is I really really want to use everywhere because it is simple to use and it does exactly what I want. Unfortunately though, it is not available elsewhere but Windows.

People suggested me pynput, a module you can import via pip but I'm not able to understand how does it work. Same result with keyboard module, also available via pip.

With sound the situation is even worst, at least to me. I wasn't able to find a simple module that takes parameters like frquency, duration, waveform, ADSR, just to play some audio effect. Each modules I tried they want to have pre-recorded audio file to load, and this is not what I wish to.

Gabe.
List web page is //www.freelists.org/webpage/pythonvis

To unsubscribe, send email to pythonvis-request@xxxxxxxxxxxxx with "unsubscribe" in the Subject field.
List web page is //www.freelists.org/webpage/pythonvis

To unsubscribe, send email to pythonvis-request@xxxxxxxxxxxxx with "unsubscribe" in the Subject field.

Other related posts: