[solved] ogreAL soundmanager?

futnuh

16-04-2007 23:37:53

I've been struggling with python-ogre's OgreAL wrapper for the last few hours. I can get one sound to play at a time but am experiencing intermittent "AttributeError: '_Exception_' object has no attribute 'py_err_class'" exceptions. I have little doubt that this is a question of my usage rather than a fault in the wrapper.

Does anyone have any code they'd be willing to share?

roman.yakovenko

17-04-2007 07:56:32

Thanks for bug reporting. Luckily it is pretty easy to fix and you don't have recompile the code.

Your ogre package should contain _ogre_exceptions_.py file. You will have to modify it. Please add next line to the file and let us know whether it worked for you or not:

_ogre_._Exception_.py_err_class = OgreException

Thanks

futnuh

17-04-2007 08:22:22

Thanks Roman. Yes, that fixed it. (Will you either commit the change or let Andy know?)

roman.yakovenko

17-04-2007 09:53:50

Andy already committed the changes:
http://python-ogre.org/browser/trunk/py ... eptions.py

futnuh

17-04-2007 10:07:32

The above exception problem aside, I'm still struggling to get python-OgreAL to function properly on our delivery machine. On my laptop it works fine. On the delivery platform, however, I hear a little blip of sound from the beginning of the ambient (background) track and then silence. I don't hear any fx.


self.soundmanager = OgreAL.SoundManager()

# ambient
self.ambient = self.soundmanager.createSoundStream("ambient", "ambient.ogg", True)
self.ambient.setGain(0.4)
self.ambient.setRelativeToListener(True)
self.ambient.play()

# fx (triggered on player action events)
self.sound = self.soundmanager.createSound('tool-off', 'tool-off.wav', False)
self.node.attachObject(self.sound)
self.sound.play()

andy

17-04-2007 10:11:44

Done -- in the SVN (untested)...

roman.yakovenko

17-04-2007 10:58:19

The above exception problem aside, I'm still struggling to get python-OgreAL to function properly on our delivery machine. On my laptop it works fine. On the delivery platform, however, I hear a little blip of sound from the beginning of the ambient (background) track and then silence. I don't hear any fx.


I am not sure whether this is an Python-Ogre bug or not. Can you write small tester using C++?

P.S. My guess is that bug is related to OgreAL and not to the bindings, but of course I could be wrong.

andy

17-04-2007 15:21:26

You might want to download openal (check out the OgreAL mailing list etc for details) and install it on the deployment machines to see if this makes a difference..

Also could you try a clean PythonOgre 1.0RC1 binary install (I think you are building from source?) to see if that works..

Cheers

Andy

futnuh

18-04-2007 02:17:37

Fixed. The problem went away by calling the sound's play method in a listener rather than prior to entering Ogre's rendering loop.