I'm posting this in here because this is not a game. No, this is a set of scripts that should make your life a bit easier when it comes to multiple sound managing.
When I started with python I had an interesting time figuring out sounds. I was a bit annoyed that there was no sound_pool module for it and I had an idea. Let's convert BGT sound_pool to python!
And so here we are.
Before I give out the links, I want to say one thing: I didn't write it myself. Yes, I translated the entire file from BGT to python, but what made it possible was Carter Tem's sound class. He also figured out why the pan wasn't working as it should and was kind enough to give me the sound positioning functions and his permission for me to release the two files here publicly on the forum.
As well as Carter, I would like to thank Sam Tupy for releasing his 3D sound pool which this conversion is based on. Without Sam, the pool would only have 2D functionality, and without Carter, the pool would still have been broken in terms of pan. Thank you both.
So what do you need to run this?
First, you will need sound_lib, which I will link to after this post. That or you can go check out Carter's Github and find it yourself.
Then you need to import the sound_pool within your project. It comes with an instantiated object of size 100 named p, which you can find at the bottom of the sound_pool.py file. Previously, you were required to change the sound pool values, but that is changed. Though you still may do so, the sound pool defaults are sufficient enough.
There is no read me. If you really need one, go check out the BGT manual or Sam's package, though that one still assumes you worked with the sound_pool before.
Lastly, the links.
Tiny upload link, guaranteed to stay
Dropbox link, not guaranteed to stay forever but should work for a while
Sam's 3D sound pool, this is what I converted to python
The sound_lib, this is what you need in order for the sound class to function properly
Again, thanks goes to Carter and Sam for making this possible.
A quick note: Some of this has not been tested well, so if you find an error do let me know so I can fix it. Seems to work fine when I messed around with it. Also, optimizations and performance improvements tips are greatly appreciated.
Quick note 2: The sound pool already assumes that you are in your sounds folder. So for example, if I had the folder named steps within my sounds and I want the sample to play step one, I would do steps/step1.ogg as a function parameter. I tried to come up with a way to change this, but I haven’t found an easy solution.
What is hard is making code that accepts different and sometimes unexpected types of input and still works.
This is what truly takes a large amount of effort on a developer's part.