Code: Select all
src1=love.audio.newSource("sample.ogg","static")
love.audio.play(src1)
Regards,
Roman.
Code: Select all
src1=love.audio.newSource("sample.ogg","static")
love.audio.play(src1)
Thanks for your attention. Actually, I've just tried it again and it ran smoothly...But when I interrupted the thread by closing the window of my program and started it again the same bug happened. Then I loaded new song and it played successfully two times before new stuck. I tried 4 tracks with different extensions with nearly the same results: stuck-->change song-->playing-->trying to play the same song again-->stuck. At first glance I don't see the pattern of error. I guess the default system cleaner (I use Ubuntu 10.04 on my laptop) doesn't clean the pipeline. And after this first launch the pipeline is full and cannot accept new thread, I think. I've recently written my small mp3 player in GTK+/Ruby and had some problems with decoders and other technical stuff, but I think authors of love.audio used MIME for auto-plugging.anjo wrote:Hm. Does this happen with every OGG/MP3 you try, or just particular ones? Does it happen consistently (each time you try to run the program), or does it seem random whether it works or not with a given file? If you have a file that causes the problem consistently, do both OGG and MP3 versions have the problem (and can you upload it somewhere so we can look at it)? What OS are you on/hardware are you running?
Code: Select all
src1=love.audio.newSource("sample.ogg")
love.audio.play(src1)
--I wanted to bind Up and Down keys with volume,
--and this part of code worked successfully supposed
--the song was playing
vol=1
function love.keypressed(key,unicode)
if key == 'up' then
vol=vol+0.1
src1:setVolume(vol)
elseif key == 'down' then
vol=vol-0.1
src1:setVolume(vol)
end
end
Code: Select all
AL lib: ALc.c:1818: alcCloseDevice(): deleting 32 Buffer(s)
That depends. For shorter sounds, like shots, hits, thuds, etc. you'd usually use static. But for larger sounds like music or other background tracks, you'd use streaming.rmn_rmn wrote:do you usually use "static"?
Users browsing this forum: Ahrefs [Bot] and 5 guests