]> gitweb.factorcode.org Git - factor.git/blob - extra/audio/loader/loader-docs.factor
254443657cee8e0c90008507d0aa7c5bef9ec8f0
[factor.git] / extra / audio / loader / loader-docs.factor
1 ! (c)2010 Joe Groff bsd license
2 USING: audio help.markup help.syntax kernel quotations strings ;
3 IN: audio.loader
4
5 HELP: read-audio
6 { $values
7     { "path" "a pathname string" }
8     { "audio" audio }
9 }
10 { $description "Reads the audio data from the file on disk named " { $snippet "path" } ", saving the data in an " { $link audio } " object. If the file's extension is not recognized, an " { $link unknown-audio-extension } " error is thrown." } ;
11
12 HELP: register-audio-extension
13 { $values
14     { "extension" string } { "quot" quotation }
15 }
16 { $description "Registers a quotation for " { $link read-audio } " to use when reading audio files with filenames ending in " { $snippet ".extension" } ". The quotation should have the effect " { $snippet "( path -- audio )" } ", where " { $snippet "path" } " is the file's pathname and " { $snippet "audio" } " is the resulting " { $link audio } " object." } ;
17
18 HELP: unknown-audio-extension
19 { $values
20     { "extension" string }
21 }
22 { $description "Errors of this class are thrown by " { $link read-audio } " when it cannot recognize the extension of the file it is given to open." } ;
23
24 ARTICLE: "audio.loader" "Audio file loader"
25 "The " { $vocab-link "audio.loader" } " vocabulary provides words for reading uncompressed PCM data from files on disk."
26 { $subsections
27     read-audio
28 }
29 "Other vocabularies can extend " { $link read-audio } " by adding support for other audio file formats."
30 { $subsections
31     register-audio-extension
32     unknown-audio-extension
33 }
34 "By default, " { $snippet "audio.loader" } " supports WAV (with the file extension " { $snippet ".wav" } ") and AIFF (with extension " { $snippet ".aif" } " or " { $snippet ".aiff" } ")." ;
35
36 ABOUT: "audio.loader"