When creating good quality audios for your games, refer to the helpful notes mentioned here.
It is best to preload the files you regularly use on startup of your application. While loadStream()
is generally fast, loadSound()
may take a while 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 application that users expect it to be running smoothly when events occur, such as during game play.
In the config.lua
file, you may specify a field called audioPlayFrequency
:
application = { content = { width = 480, height = 960, 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 22,050 Hz playback, set this to 22,050. It produces quality speech recordings or middle-quality...