The following are some helpful notes when creating good quality audio for your games.
It is best to pre-load all your files at the startup of your application. While loadStream()
is generally fast, loadSound()
may take awhile since it must load and decode the entire file the instant it needs to be used. Generally, you don't want to be calling loadSound()
in the parts of your app where users expect it to be running smoothly when events occur, such as during gameplay.
In your config.lua
file, you may specify a field called audioPlayFrequency
.
application = { content = { width = 320, height = 480, scale = "letterbox", audioPlayFrequency = 22050 }, }
This tells the OpenAL system what sample rate to mix and playback at. For best results, set this no higher than you actually need. So if you never need better than 22050 Hz playback, set this to 22050. It produces quality speech recordings or middle-quality recordings of...