Hi, thank you for your reply. I tried to use the code in the simple.cpp file before posting here and it didn't work for me. As you have said that this is the way to do it, I have given a second try to that code and, after some changes and tests, I have managed to make it work, so thank you! :)
Now, the following question: is there a straight way to connect the audio from a video to osgAudio? I am using the ffmpeg plugin to read the videos and I get audioStreams as it is done in the osgmovie example. Thank you in advance. Best regards. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Chris 'Xenon' Hanson Sent: viernes, 20 de enero de 2012 18:29 To: OpenSceneGraph Users Subject: Re: [osg-users] Play audio files On 1/20/2012 6:42 AM, Héctor Martínez wrote: > I have downloaded and compiled osgAudio. Now I want to integrate it in > my own OSG-based program. So, how can I just open an audio file and > play it? I mean the simplest way, no need for complicated features > right now. Something > like: > open("myAudio.wav"); > playAudio(); See examples/openal-lowlevel/simple.cpp. osgAudio::AudioEnvironment::instance()->init(); osg::ref_ptr<Source> bgsound = new Source; bgsound->stop(); osg::ref_ptr<Sample> sample = new Sample("myAudio.wav"); bgsound->setSound(sample.get()); bgsound->setGain(0.6f); // Lower gain (volume) bgsound->setLooping(); bgsound->setAmbient(); // Make sound ambient (i.e. not attenuated) bgsound->play(); // Start playing -- Chris 'Xenon' Hanson, omo sanza lettere. [email protected] http://www.alphapixel.com/ Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. Contracting. "There is no Truth. There is only Perception. To Perceive is to Exist." - Xen _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

