AggrorJorn Posted June 1, 2010 Share Posted June 1, 2010 I need to know whether Lua handles this the same way as with C++. I tried both source:Free() as FreeSource(source). FreeSource is not recoqnised as a function. And Free only works returns errors. if KeyHit(KEY_P)==1 then source1 = CreateSource(sound1) PlaySource(source1) source1:Free() end Quote Link to comment Share on other sites More sharing options...
macklebee Posted June 1, 2010 Share Posted June 1, 2010 try setting source1 = nil Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
AggrorJorn Posted June 1, 2010 Author Share Posted June 1, 2010 Well this deffinetly stops the sound since the source is empty, but I don't know if it is really gone. Do you think this affects the source being freed? My soundcard seems to have an enormous amount of audio channels and I can't test whether the all audio channels are full. Quote Link to comment Share on other sites More sharing options...
Andr3wHur5t Posted June 1, 2010 Share Posted June 1, 2010 this works with models it might work with sounds. Free(source1) Quote Tools: AC3D | 3D Canvas(pro) | Texture Maker(pro) | Genetica(basic) | 3D World Studio | Fragmotion |Leadwerks 2 | XNA 4 | Visual Studio 2010 Professional | XCode 5.x |UU3D Pro Programing & Scripting Languages: C |C++ | C# | Obj-C | LUA | Javascript | PHP | Ruby Link to comment Share on other sites More sharing options...
AggrorJorn Posted June 2, 2010 Author Share Posted June 2, 2010 Hi Ryao, thanks for the suggestions but that doesn't work with sources. I think I will use the source = nil. it seems to work okay. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.