Reggae tutorial: Playing a synthesized, continuous wave

From MorphOS Library

Revision as of 09:23, 17 June 2010 by Krashan (talk | contribs) (Introduction)

Grzegorz Kraszewski


Introduction

This tutorial shows how raw sound data may be played with Reggae. The example code synthesizes a 1 kHz sine wave and plays it continuously. The wave is synthesized into a table in memory. Then memory.stream is used to access it. The next object, an instance of rawaudio.filter, attaches audio parameters to the raw data. Finally audio.output plays the wave in a endless loop, using its looping feature.

Raw sine wave synthesis

Using memory.stream for synthesis buffer

Applying audio parameters with rawaudio.filter

Looping the sound to make it continuous