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

Alterations to audio


The audio system also has the ability to alter the minimum and maximum states of audio volume, as well as fading the audio when needed.

Volume control

The volume of the audio can be set with values ranging from 0 to 1.0. This setting can be adjusted at any time before or during the extended sound playback.

audio.setVolume()

The audio.setVolume function sets the volume.

The syntax is audio.setVolume( volume [, [options] ] ) --upon success, should return true.

The parameters are as follows:

  • volume: This lets you set the volume level you want to apply. Valid numbers range from 0.0 to 1.0, where 1.0 is the maximum volume value. The default volume is based on your device ringer volume and will vary.

  • options: This is a table that supports the channel number you want to set the volume on. You can set the volume on any channel between 1 to 32. Specify 0 to apply the volume to all the channels. Omitting this parameter entirely sets the master volume, which is different from the channel...