From 159c35f706de14f3e3c6942934532011a1d77277 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Wed, 9 Jan 2019 20:26:28 -0500 Subject: audio: Add public audio API. * chickadee/audio.scm: New file. * Makefile.am (SOURCES): Add it. * api.texi (Audio): Add docs. --- doc/api.texi | 458 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 456 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/api.texi b/doc/api.texi index f1726d9..18e0841 100644 --- a/doc/api.texi +++ b/doc/api.texi @@ -2787,8 +2787,462 @@ Return the data type of @var{attribute}. @node Audio @section Audio -Most games need to play audio. Background music to set the mood and -many sound effects for when things happen. +A game isn't complete without sound. Most games play some cool +background music to set the mood and have many sound effects to play +when events happen. The @code{(chickadee audio)} module provides a +robust audio API backed by the OpenAL 3D audio system. + +@menu +* Audio Files:: Not audiophiles. +* Sources:: Audio emitters. +* The Listener:: The player's ears. +* The Environment:: Global sound model settings. +@end menu + +The basics of playing audio are very simple. Just load an audio file +in the load hook (or anywhere else once the game loop is running) and +play it! + +@example +(use-modules (chickadee audio)) + +(define audio #f) + +(define (load) + (set! audio (load-audio "neat-sound-effect.wav")) + (audio-play audio)) + +(run-game #:load load) +@end example + +For more advanced usage, check out the full API reference in the +following sections. + +@node Audio Files +@subsection Audio Files + +Sound data is represented by a special @code{