A little problem regarding audio.
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
A little problem regarding audio.
I have this laser shooting spaceship, and a sound is supposed to play when the laser is fired. However, when there is only one source it only plays every few seconds. Making a new source every time in order to play it works, but it takes up a lot of memory. If anyone can provide a solution, I would be glad to hear it.
- TechnoCat
- Inner party member
- Posts: 1611
- Joined: Thu Jul 30, 2009 12:31 am
- Location: Milwaukee, WI
- Contact:
Re: A little problem regarding audio.
You can recycle old ones done playing right? http://love2d.org/wiki/TEsoundthegenius wrote:I have this laser shooting spaceship, and a sound is supposed to play when the laser is fired. However, when there is only one source it only plays every few seconds. Making a new source every time in order to play it works, but it takes up a lot of memory. If anyone can provide a solution, I would be glad to hear it.
Re: A little problem regarding audio.
I'm not sure I'd like to use an entire script to fix what seems to be a small problem. Is there any other way?TechnoCat wrote:You can recycle old ones done playing right? http://love2d.org/wiki/TEsoundthegenius wrote:I have this laser shooting spaceship, and a sound is supposed to play when the laser is fired. However, when there is only one source it only plays every few seconds. Making a new source every time in order to play it works, but it takes up a lot of memory. If anyone can provide a solution, I would be glad to hear it.
Re: A little problem regarding audio.
It's inherently the way the audio system works in LOVE. LOVE does not like to quickly start and stop audio sources, there is always a huge delay. The best way to do it is to create a new source every sound effect and have a way of clearing them all out when they are done playing, which frees up resources.
Taehl and I created TEsound to do just that. The current sound system is not very user friendly and thedevs really have no intention of fixing it or writing a proper tutorial anytime soon.
EDIT: Retracting that statement.
Taehl and I created TEsound to do just that. The current sound system is not very user friendly and the
EDIT: Retracting that statement.
Last edited by Ensayia on Mon Oct 03, 2011 5:38 am, edited 1 time in total.
- slime
- Solid Snayke
- Posts: 3163
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: A little problem regarding audio.
There are a few filetype-specific issues with sounds in LÖVE 0.7.2. One of them is that .wav files have a few seconds of silence at the end of them. You can call
to manually restart the sound.
Ogg files are the best-supported currently AFAIK. Most of the sound issues can be avoided by using ogg files.
The real problem here is the lack of documentation on the love.audio portion of the wiki, someone should fix that.
Code: Select all
source:stop()
source:play()
Ogg files are the best-supported currently AFAIK. Most of the sound issues can be avoided by using ogg files.
The real problem here is the lack of documentation on the love.audio portion of the wiki, someone should fix that.
Re: A little problem regarding audio.
Thanks, using .ogg files now, they work much better.slime wrote:There are a few filetype-specific issues with sounds in LÖVE 0.7.2. One of them is that .wav files have a few seconds of silence at the end of them. You can callto manually restart the sound.Code: Select all
source:stop() source:play()
Ogg files are the best-supported currently AFAIK. Most of the sound issues can be avoided by using ogg files.
The real problem here is the lack of documentation on the love.audio portion of the wiki, someone should fix that.
Who is online
Users browsing this forum: No registered users and 3 guests