Playing sounds makes LÖVE crash? :(
Posted: Wed Feb 17, 2010 2:44 pm
First of all: Hello everyone! I'm new to LÖVE and this forum. I plan on using LÖVE for a little hobby project I started. I want to build a voice controlled system that will (eventually...) automate as much of my home as possible. There are commercial programs that will allow you to do this, but I want my system to have a name, a face and a voice. I was inspired by JARVIS from the movie Iron Man.
I plan on using LÖVE for the main logic, graphics and audio.
Now, I have some programming experience but it's pretty limited. Especially since it's been years since I've done programming of any sort. I started experimenting with LÖVE and yesterday ran into my first real obstacle and I hope you can tell me what I'm doing wrong.
I 'stole' some code from an example I found on this forum that (amongst other things) handles keypresses. The unmodified program works perfectly. When I add the following code to the "if key=="X" then" part:
The program initially works exactly the same and plays the sound when I push the key. Nice.
However, after a few times LÖVE completely crashes. I tried taking the first line out of the keypress event, but that only made things worse. What am I doing wrong?
I'd love to hear your opinions.
I found the code I use to play the sounds here: http://love2d.org/wiki/love.audio.newSource
I plan on using LÖVE for the main logic, graphics and audio.
Now, I have some programming experience but it's pretty limited. Especially since it's been years since I've done programming of any sort. I started experimenting with LÖVE and yesterday ran into my first real obstacle and I hope you can tell me what I'm doing wrong.
I 'stole' some code from an example I found on this forum that (amongst other things) handles keypresses. The unmodified program works perfectly. When I add the following code to the "if key=="X" then" part:
Code: Select all
sfx = love.audio.newSource("sfx.wav", "static")
love.audio.play(sfx)
However, after a few times LÖVE completely crashes. I tried taking the first line out of the keypress event, but that only made things worse. What am I doing wrong?
I'd love to hear your opinions.
I found the code I use to play the sounds here: http://love2d.org/wiki/love.audio.newSource