Book Image

Corona SDK Mobile Game Development: Beginner's Guide

By : Michelle M Fernandez
Book Image

Corona SDK Mobile Game Development: Beginner's Guide

By: Michelle M Fernandez

Overview of this book

Table of Contents (19 chapters)
Corona SDK Mobile Game Development Beginner's Guide Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Performance tips


When creating good quality audios for your games, refer to the helpful notes mentioned here.

Preloading phase

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.

audioPlayFrequency

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...