I was going through the examples of osgal-0.6.1 ...
In the example "osgal" two sounds have been added ... and one of them is
added to the glider .
They had  used createSound() function ... which they have included in the
example.

I wanted to do the same in my program , I copied the createsound function
and then wrote the following code :-

osg::ref_ptr<osgAL::SoundNode> sound_node = createSound("wateresplash.wav");
findNodeVisitor findNode("fountain");
root->accept(findNode);
std::vector<osg::Node*>nodeList=findNode.getNodeList();
if(nodeList.size()!=0)
     (nodeList[0]->asGroup())->addChild(sound_node.get());
std::cout<<nodeList.size()<<std::endl;

But it is giving a runtime error :-

terminate called after throwing an instance of 'std::runtime_error'
  what():  SoundState::apply(): No sound source allocated.
Aborted

This error wasnt coming in the example code :( ...

Does anyone have an idea about this ?
-- 
----------------------------------------------
Maruti Borker
IIIT Hyderabad
Website:- http://students.iiit.ac.in/~maruti
Blog:- http://marutiborker.wordpress.com
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to