If you are using a looping soundsource you should allocate a soundsource
(Hardware soundsource).

So before calling setPlay(true);
call soundState::allocateSource( priority );

where priority is an integer indicating the prority of the sound you want to
play (a higher priority will increase the chance of actually succeeding
getting a hw soundsource if all of them are in use).

/Anders


On Dec 28, 2007 8:20 PM, maruti borker <[EMAIL PROTECTED]> wrote:

>
> 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<http://students.iiit.ac.in/%7Emaruti>
> Blog:- http://marutiborker.wordpress.com
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>


-- 


________________________________________________________________
Anders Backman               Email:    [EMAIL PROTECTED]
HPC2N/VRlab                  Phone:    +46 (0)90-786 9936
Umea university              Cellular: +46 (0)70-392 64 67
S-901 87 UMEA SWEDEN         Fax:      +46 90-786 6126
                              http://www.cs.umu.se/~andersb
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to