2018-12-06 18:37:07

Sound_lib is probably your best bet imho, i’ve used it a few times with no real issues.

2018-12-06 18:40:54

it seems like i am to stupid to understand sound_lib. i tried and tried... any ways one day i will start figuring it out. if i am not wrong, it is almost like the system in BGT where you say sound.play() and sound.stop()..

best regards
never give up on what ever you are doing.

2018-12-06 20:04:13

Sound_lib has a problem that I've seen, as it stands it only allows file streams (sample support wasn't put in by the original developer). When operating in low latency environments (i.e. audiogames), sampling sounds from memory is important. For this, sound_lib would need to have a soundObject with a load function that uses an updated versoin of sound_lib with samples support to load sounds into memory, and let the load and stream functions use the loaded sound's memory address for faster loading and more eficient memory use.

This is a project I'm willing to work on, but maybe later.

Thumbs up

2018-12-06 20:12:18 (edited by pauliyobo 2018-12-06 20:15:20)

sound_lib does support memory streams
from sound_lib import stream, output
from sound_lib import stream, output
import ctypes

with open('sound.ogg') as f:
sound= f.read()
array=ctypes.create_string_buffer(sound)
addr=ctypes.addressof(array)
o= output.Output()
handle=stream.FileStream(mem=True, file=addr, length=len(bla))
handle.looping=False
handle.play_blocking()
PS. Indent under the with statement. I did but it doesn't show it here on AG

If you want to get in touch with me you can follow me on Twitter
have a nice day.
Paul

2018-12-06 20:38:28

Huh... wonder why pybass isn't up to date on Pip? I could probably make a C wrapper around it that has no Python bindings other than DLLs (Pybass is missing out on a lot of things: BASS Threaded Mixer, bass_adx, bass_aix, bass_fx, and so on), so I'm wondering if I should try and make my own version that wraps all of those?

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.

Thumbs up

2018-12-06 22:48:17

You seriously have to mess with ctypes yourself when using sound_lib? Well then...
We should probably invest more time into getting one single working product instead of creating 5 several products, each working a little bit differently. Ctypes isn't that up-to-date with wrapping external code either, but you can probably send pull requests to more advanced wrappers like Bass4Py, since pybass seems to be long dead by now.
Best Regards.
Hijacker

Thumbs up +1

2018-12-06 22:58:13

We could always make our own custom version that has all the featurs we need for audio game development in Python and use that. That would give us the flexibility and open-source-ish feeling we'd need to actually develop audio games in Python.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.

Thumbs up

2018-12-06 23:06:46

Sure, but why start a totally new project if something doing the job totally fine but only requiring some more little tweaks already exists?
Enhancing this product will be of more use to everyone. Hence the main thought of open source development, many people working on one project in public, instead of everyone cooking their own in privacy.
Best Regards.
Hijacker

Thumbs up +1

2018-12-06 23:52:35

True.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.

Thumbs up

2018-12-06 23:55:04

I honestly think those are all really good ideas.

2018-12-07 01:38:26

Which ones?

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.

Thumbs up

2018-12-07 03:27:07

writing a more up to date wrapper for bass and trying to work on some audio games like system.

2018-12-07 10:33:00

i just wish that we can have some thing that can handle keyboard input reelly well. i am fine with the audio...

best regards
never give up on what ever you are doing.

2018-12-07 10:57:46

@88, pysdl2 is what you are looking for.

bitcoin address: 1LyQ3hziMC2DTnCtgM3V1zfuZ73P3CYT9P

2018-12-07 11:06:50

Most graphics libraries also have functions for handling keyboard input, Pyglet, Pygame, wxPython, etc.

-BrushTone v1.3.3: Accessible Paint Tool
-AudiMesh3D v1.0.0: Accessible 3D Model Viewer

Thumbs up

2018-12-07 18:34:44

SDL2 in general is extremely low-level. At least in the C interface I found it extremely hard to figure out and use.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.

Thumbs up

2018-12-08 08:40:55

Pygame has OK keyboard handling, not sure about the delay or not because I haven't tried yet, but you can do events like pygame_keydown, etc
so it's good if you want to write a high level wrapper around pygame which lets you do if keyPressed functions, events, etc.

A lot of work is needed, imo.

Thumbs up

2018-12-08 09:58:47

Well yeah, a lot of work will be needed no matter what you work with. A game framework isn't gonna give you all you need on a silver platter. That's not the point of a game framework or a game engine. big_smile

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.

Thumbs up

2018-12-08 19:26:57

like pygame, pysdl2 has those events, even with support for force feedback (which i don't know if pygame has it).
pysdl2 is a wrapper to sdl2 which is available on here
just do pip install pysdl2 and you will be good to go (without any pygame*.pyd/dll), just sdl2.dll

bitcoin address: 1LyQ3hziMC2DTnCtgM3V1zfuZ73P3CYT9P

2018-12-08 19:58:56

Well, pygame and pysdl2 almost do the same, since pygame is a wrapper to sdl2 as well. there also is pysfml which uses the sfml library, which is a bit different but almost does the same, but in a little different way.
Best Regards.
Hijacker

Thumbs up

2018-12-08 20:18:38

i don't like pygame, because first it uses sdl1, and it's code is under gpl (sdl1 was under gpl as well while sdl2 is under zlib).
pysdl2 is a ctypes wrapper around sdl2 which is currently being developed

bitcoin address: 1LyQ3hziMC2DTnCtgM3V1zfuZ73P3CYT9P

2018-12-08 21:20:31 (edited by Ethin 2018-12-08 21:39:10)

@visualstudio, how do you know it uses SDL1? It could use SDL2 -- its possible to have a wrapper licensed under the GPL while having the underlying library licensed under something else. SDL2 is a pain. Seriously. Have you ever used its C interface? Its an absolute bitch to use properly. SFML is far easier; the problem with PySFML is that its [still] on Python 3.5, not 3.7 and up. And I'm not going to downgrade to Python 3.5 just to use PySFML. Plus, I just tried pysdl2 and it doesn't work, even when PYSDL2_DLL_PATH is set properly, and even when the SDL2.dll dll is in the directory my code is in. So unless I'm missing something, that's fucked.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.

Thumbs up

2018-12-09 03:39:28

Pygame does use SDL1, but there are a efforts to build compatibility with SDL2, such as [here], and another [here] on what looks like a renpy fork.

-BrushTone v1.3.3: Accessible Paint Tool
-AudiMesh3D v1.0.0: Accessible 3D Model Viewer

Thumbs up

2018-12-09 06:16:09

@97, first, the cdrom interface was available on sdl1, which as sdl2 is written from scratch, it doesn't have this
second, i've used it, and i didn't have any problem with it.
third, i don't know about pysfml (i've used sfml before, but in terms of keyboard input, text handling etc) sdl2 is really really better.

bitcoin address: 1LyQ3hziMC2DTnCtgM3V1zfuZ73P3CYT9P

2018-12-09 22:00:17

Not really, no... SFML is better in every way to SDL2. Considering that SDL2 has two different keyboard types (scancodes and keycodes), and not all of the functions have samples on how exactly to use them, and the examples are quite sparce.... yeah, the fact that I'd have to go digging around for examples on how to use it, whereas with SFML, I have experience with (and would rate it highly above SDL2)....

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.

Thumbs up