]> gitweb.factorcode.org Git - factor.git/blob - extra/audio/audio-docs.factor
Reformat
[factor.git] / extra / audio / audio-docs.factor
1 ! Copyright (C) 2010 Joe Groff.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: alien byte-arrays help.markup help.syntax math memory ;
4 IN: audio
5
6 HELP: <audio>
7 { $values
8     { "channels" integer } { "sample-bits" integer } { "sample-rate" integer } { "size" integer } { "data" c-ptr }
9     { "audio" integer }
10 }
11 { $description "Constructs an " { $link audio } " object with the given parameters." } ;
12
13 HELP: audio
14 { $class-description "Objects of this class contain uncompressed PCM audio data. The " { $snippet "data" } " slot contains an " { $link alien } " pointer or " { $link byte-array } " with the binary PCM data, and the " { $link size } " slot indicates the length in bytes of the data. The " { $snippet "channels" } ", " { $snippet "sample-bits" } " and " { $snippet "sample-rate" } " slots indicate the number of channels (1 for mono, 2 for stereo), bits per sample, and sample rate of the data." } ;
15
16 HELP: format-unsupported-by-openal
17 { $values
18     { "audio" audio }
19 }
20 { $description "Errors of this class are thrown when " { $link openal-format } " is called on an " { $link audio } " object for which there is no OpenAL-supported format." } ;
21
22 HELP: openal-format
23 { $values
24     { "audio" audio }
25     { "format" "an ALenum value" }
26 }
27 { $description "Returns the OpenAL format value that corresponds to the format of the " { $snippet "audio" } " object. If the object's format doesn't match an OpenAL-supported format, a " { $link format-unsupported-by-openal } " error is thrown." } ;
28
29 ARTICLE: "audio" "Audio framework"
30 "The " { $vocab-link "audio" } " vocabulary and its child vocabularies provide a framework for reading audio data from disk and playing back audio using prerendered, streaming, or generated audio sources. By itself, the " { $snippet "audio" } " vocabulary provides a container class for prerendered PCM audio data:"
31 { $subsections
32     audio
33     <audio>
34     openal-format
35 }
36 "The following child vocabularies provide additional audio features:"
37 { $list
38 { { $vocab-link "audio.engine" } " provides a high-level OpenAL-based engine for playing audio clips." }
39 { { $vocab-link "audio.loader" } " reads PCM data from files on disk into " { $link audio } " objects. " { $vocab-link "audio.wav" } " and " { $vocab-link "audio.aiff" } " support specific audio file formats." }
40 { { $vocab-link "audio.vorbis" } " implements an " { $snippet "audio.engine" } " compatible generator object for decoding Ogg Vorbis audio data from a stream." }
41 } ;
42
43 ABOUT: "audio"