SFML community forums
Bindings - other languages => Python => Topic started by: mweb on August 14, 2007, 11:11:36 pm
-
Hi first thanks for this lib. Im only using the audio part but it looks good.
I wrote a few swig files to use your audio lib with python. It works but i got a small problem that sometimes i get slowdown of the music it is playing. The same for wave effects. It will last usually for a second and then it will play normal again. Do you have any idea what this could be?
Here my sys specs:
I'm using Gentoo Linux with openal 0.8, libvorbis 1.1.2.
I also just get stereo even if i have a 5.1 setup. I got this problem with several linux programs but some can handle it (for example VLC). But shuldn't openal be able to use it?
My second question is would it not by nice to change the listener position i have seen that you set the camera position on the creation of the sfAudioDevice. I think it is easier to change the listener position than to change all the Sound objects.
-
I wrote a few swig files to use your audio lib with python
Do you mean you created a Python binding for SFML-Audio ? So you could create bindings for other SFML packages and other languages ? :D
It works but i got a small problem that sometimes i get slowdown of the music it is playing. The same for wave effects. It will last usually for a second and then it will play normal again. Do you have any idea what this could be?
No idea, maybe your hardware or drivers ? The music class could have some issues, as it's using streaming, but wave sounds just use the basic OpenAL functions so it would be more surprising. By the way, OpenAL 0.8 looks a bit old, current versoin is 1.1 (or 1.2 ?).
I also just get stereo even if i have a 5.1 setup. I got this problem with several linux programs but some can handle it (for example VLC). But shuldn't openal be able to use it?
OpenAL is supposed to handle it, yes.
My second question is would it not by nice to change the listener position i have seen that you set the camera position on the creation of the sfAudioDevice. I think it is easier to change the listener position than to change all the Sound objects.
Yes, I should really create an interface to expose the listener properties.
-
Do you mean you created a Python binding for SFML-Audio ? So you could create bindings for other SFML packages and other languages ?
Yes, but it is not finished, i just did the fastest possible solution. I just added for each public header file a SWIG interface file. The disadvantage is that it is not a very pythonic implementation, but it works.
This way it should be quite easy to do it for the howl library and this would work for almost all the suportet languages from SWIG.
No idea, maybe your hardware or drivers ? The music class could have some issues, as it's using streaming, but wave sounds just use the basic OpenAL functions so it would be more surprising. By the way, OpenAL 0.8 looks a bit old, current version is 1.1 (or 1.2 ?).
I will check the drivers, but since i never got any problem with any other software i may have to see if i really got the errors with playing the wave sounds.
OpenAL 0.0.8 is the current version you get from the OpenAL site. The Version 1.1 is for ALUT.
Yes, I should really create an interface to expose the listener properties.
Sounds great, thanks.
-
Yes, but it is not finished, i just did the fastest possible solution. I just added for each public header file a SWIG interface file. The disadvantage is that it is not a very pythonic implementation, but it works.
This way it should be quite easy to do it for the howl library and this would work for almost all the suportet languages from SWIG.
Interesting. Would you like to help provide such bindings ? Otherwise I'll do it anyway, it was one of the next priorities.
OpenAL 0.0.8 is the current version you get from the OpenAL site. The Version 1.1 is for ALUT.
Yes, you're right. OpenAL 1.1 is only available for Windows.
-
I can create the first very basic bindings as described above but since my interested is only on the audio part. So I may help with creating more advanced bindings but won't do it through all parts.
But at least this would get you starting with the bindings.
I will rename each class since the prefix is something i don't like on the classes especially since i got a package in the scripting language anyway. This won't affect the C++ implementation.
I hope SWIG is ok for you.
-
Just do what you want / can, and I'll do the rest. It will help me a lot since it's my first experience with creating such bindings.