summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2017-01-24 21:26:10 -0500
committerDavid Thompson <dthompson2@worcester.edu>2017-01-24 21:26:10 -0500
commit534677086a1336c727261504ba75a7e169305532 (patch)
treeaf2cc81a6232a4dcbf764ea1ef4ccc61f83a63bb /doc
parente46df21886b186cfcf28008eac4b9cb6577b4689 (diff)
Add audio support.
* chickadee/audio.scm: New file. * Makefile.am (SOURCES): Add it. * chickadee.scm (run-game): Initialize audio. * doc/api.texi ("Audio"): Document it.
Diffstat (limited to 'doc')
-rw-r--r--doc/api.texi61
1 files changed, 60 insertions, 1 deletions
diff --git a/doc/api.texi b/doc/api.texi
index 554b531..d72980a 100644
--- a/doc/api.texi
+++ b/doc/api.texi
@@ -732,4 +732,63 @@ considered an advanced feature.
@node Audio
@section Audio
-There is no audio support yet. Stay tuned!
+Chickadee has two data types for audio: samples and music. Samples
+are for short sound effects like explosions. Music is for, well,
+uh@dots{}, music.
+
+Supported file formats include WAV and OGG.
+
+@deffn {Scheme Procedure} load-sample @var{file}
+Load audio sample from @var{file}.
+@end deffn
+
+@deffn {Scheme Procedure} set-sample-volume! @var{volume}
+Set the volume that all samples are played at to @var{volume}, an
+integer value between 0 and 128.
+@end deffn
+
+@deffn {Scheme Procedure} play-sample @var{sample}
+Play @var{sample}. Pretty straightforward!
+@end deffn
+
+@deffn {Scheme Procedure} load-music @var{file}
+Load music from @var{file}.
+@end deffn
+
+@deffn {Scheme Procedure} music-volume
+Return the volume level for music, an integer value between 0 and 128.
+@end deffn
+
+@deffn {Scheme Procedure} set-music-volume! @var{volume}
+Set the volume that music is played at to @var{volume}, an integer
+value between 0 and 128.
+@end deffn
+
+@deffn {Scheme Procedure} play-music @var{music} [@var{loop?}]
+Play @var{music}. If @var{loop?}, play it over and over and over and
+over and@dots{}
+@end deffn
+
+@deffn {Scheme Procedure} pause-music
+Pause the current music track.
+@end deffn
+
+@deffn {Scheme Procedure} resume-music
+Resume the current music track.
+@end deffn
+
+@deffn {Scheme Procedure} rewind-music
+estart the current music track from the beginning.
+@end deffn
+
+@deffn {Scheme Procedure} stop-music
+Stop playing the current music track.
+@end deffn
+
+@deffn {Scheme Procedure} music-playing?
+Return @code{#t} if music is currently playing.
+@end deffn
+
+@deffn {Scheme Procedure} music-paused?
+Return @code{#t} if music is currently paused.
+@end deffn