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

Time to take control


We have the ability to control our sounds, now that we can play them in the simulator. If you think back to the days of cassette tape players, it had the ability to use functions such as pause, stop, and rewind. Corona's audio API library can do just that.

audio.stop()

The audio.stop() function stops playback on a channel and clears the channel, so it can be played on again.

The syntax is audio.stop( [channel] ) or audio.stop( [ { channel = c } ] ).

Having no parameters stops all active channels. The channel parameter specifies the channel to stop. Specifying 0 stops all channels.

audio.pause()

The audio.pause() function pauses playback on a channel. This has no effect on channels that aren't playing.

The syntax is audio.pause( [channel] ) or audio.pause( [ {channel = c} ] ).

Having no parameters pauses all active channels. The channel parameter specifies the channel to pause. Specifying 0 pauses all channels.

audio.resume()

The audio.resume() function resumes playback on a channel...