-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
about.html
158 lines (135 loc) · 19 KB
/
about.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8"> <title>Cl-Flac</title> <meta name="viewport" content="width=device-width"> <meta name="description" content="Bindings to libflac, a simple FLAC decoding library"> <meta name="author" content="Nicolas Hafner <[email protected]>"> <style type="text/css"> body{
max-width: 1024px;
margin: 0 auto 0 auto;
font-family: sans-serif;
color: #333333;
font-size: 14pt;
padding: 5px;
}
body>header{
display:flex;
align-items: center;
justify-content: center;
flex-direction: column;
max-width: 100%;
text-align: center;
}
body>header img{
max-width: 50%;
}
img{
max-width: 100%;
max-height: 100%;
}
code{
font-family: Consolas, Inconsolata, monospace;
}
a{
text-decoration: none;
color: #0055AA;
}
a img{
border: none;
}
#documentation{
text-align: justify;
}
#documentation pre{
margin-left: 20px;
overflow: auto;
}
#documentation img{
margin: 5px;
}
#symbol-index>ul{
list-style: none;
padding: 0;
}
#symbol-index .package>ul{
list-style: none;
padding: 0 0 0 10px;
}
#symbol-index .package .nicknames{
font-weight: normal;
}
#symbol-index .package h4{
display: inline-block;
margin: 0;
}
#symbol-index .package article{
margin: 0 0 15px 0;
}
#symbol-index .package article header{
font-size: 1.2em;
font-weight: normal;
}
#symbol-index .package .name{
margin-right: 5px;
}
#symbol-index .package .docstring{
margin: 0 0 0 15px;
white-space: pre-wrap;
font-size: 12pt;
}
@media (max-width: 800px){
body{font-size: 12pt;}
} </style> </head> <body> <header> <h1>cl-flac</h1> <span class="version">1.0.0</span> <p class="description">Bindings to libflac, a simple FLAC decoding library</p> </header> <main> <article id="documentation"> <div><h2 id="about_cl-flac">About cl-flac</h2> <p>This is a bindings library to <a href="https://github.com/Shirakumo/libflac">libflac</a>, a simple library for decoding FLAC files.</p> <h2 id="how_to">How To</h2> <p>Precompiled versions of the underlying library are included in this. If you want to build it manually however, refer to the <a href="https://github.com/Shirakumo/libflac">libflac</a> page.</p> <p>Load the system through ASDF or Quicklisp:</p> <pre><code>(ql:quickload :cl-flac)
</code></pre> <p>Create a new <code><a href="#CL-FLAC:FILE">file</a></code> object:</p> <pre><code>(<a href="http://l1sp.org/cl/defvar">defvar</a> *file* (<a href="#CL-FLAC:MAKE-FILE">cl-flac:make-file</a> #p"~/my-cool-music.flac"))
</code></pre> <p>You can query the file information with <code><a href="#CL-FLAC:SAMPLERATE">samplerate</a></code>, <code><a href="#CL-FLAC-CFFI:CHANNELS">channels</a></code>, <code><a href="#CL-FLAC-CFFI:SAMPLE-COUNT">sample-count</a></code>, <code><a href="#CL-FLAC-CFFI:FRAME-COUNT">frame-count</a></code>, and <code><a href="#CL-FLAC-CFFI:BITS-PER-SAMPLE">bits-per-sample</a></code>.</p> <p>Reading samples from the file happens with <code><a href="#CL-FLAC:READ-DIRECTLY">read-directly</a></code>, <code><a href="#CL-FLAC:READ-INTO-VECTOR">read-into-vector</a></code>, or <code><a href="#CL-FLAC:READ-TO-VECTOR">read-to-vector</a></code>. A basic playback loop could look like this:</p> <pre><code>(<a href="http://l1sp.org/cl/loop">loop</a> with buffer = (<a href="http://l1sp.org/cl/make-array">make-array</a> 512 :element-type 'single-float)
for samples = (<a href="#CL-FLAC:READ-INTO-VECTOR">cl-flac:read-into-vector</a> *file* buffer)
until (<a href="http://l1sp.org/cl/=">=</a> 0 samples)
do (process-buffer-somehow buffer))
</code></pre> <p>When you're done with the file, you can either just let it be GCd or close it explicitly with <code><a href="#CL-FLAC:CLOSE-FILE">close-file</a></code>.</p> <p>A complete test that allows you to play back a flac file is included in <a href="test.lisp">test.lisp</a></p> </div> </article> <article id="copyright"> <h2>Copyright</h2> <span>cl-flac</span> is licensed under the <span><a href="https://tldrlegal.com/search?q=Artistic">Artistic</a></span> license. © <span>Nicolas Hafner <[email protected]></span> . This library can be obtained on <a href="https://github.com/Shirakumo/cl-flac">https://github.com/Shirakumo/cl-flac</a>. </article> <article id="symbol-index"> <h2>Package Index</h2> <ul><li class="package"> <h3> <a name="CL-FLAC-CFFI" href="#CL-FLAC-CFFI">CL-FLAC-CFFI</a> <span class="nicknames">(ORG.SHIRAKUMO.FRAF.FLAC.CFFI)</span> </h3> <ul><li> <a name="CL-FLAC-CFFI:ERROR"> </a> <article id="CONDITION CL-FLAC-CFFI:ERROR"> <header class="condition"> <span class="type">condition</span> <h4 class="name"><code><a href="#CONDITION%20CL-FLAC-CFFI%3AERROR">ERROR</a></code></h4> </header> <div class="docstring"><i>No docstring provided.</i></div> </article> </li><li> <a name="CL-FLAC-CFFI:BITS-PER-SAMPLE"> </a> <article id="FUNCTION CL-FLAC-CFFI:BITS-PER-SAMPLE"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20CL-FLAC-CFFI%3ABITS-PER-SAMPLE">BITS-PER-SAMPLE</a></code></h4> <code class="qualifiers"></code> <code class="arguments">FILE</code><code>)</code> </header> <div class="docstring"><i>No docstring provided.</i></div> </article> </li><li> <a name="CL-FLAC-CFFI:CHANNELS"> </a> <article id="FUNCTION CL-FLAC-CFFI:CHANNELS"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20CL-FLAC-CFFI%3ACHANNELS">CHANNELS</a></code></h4> <code class="qualifiers"></code> <code class="arguments">FILE</code><code>)</code> </header> <div class="docstring"><i>No docstring provided.</i></div> </article> </li><li> <a name="CL-FLAC-CFFI:ERROR"> </a> <article id="FUNCTION CL-FLAC-CFFI:ERROR"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20CL-FLAC-CFFI%3AERROR">ERROR</a></code></h4> <code class="qualifiers"></code> <code class="arguments">DATUM &REST ARGUMENTS</code><code>)</code> </header> <div class="docstring"><pre>Invoke the signal facility on a condition formed from DATUM and ARGUMENTS.
If the condition is not handled, the debugger is invoked.</pre></div> </article> </li><li> <a name="CL-FLAC-CFFI:FRAME-COUNT"> </a> <article id="FUNCTION CL-FLAC-CFFI:FRAME-COUNT"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20CL-FLAC-CFFI%3AFRAME-COUNT">FRAME-COUNT</a></code></h4> <code class="qualifiers"></code> <code class="arguments">FILE</code><code>)</code> </header> <div class="docstring"><i>No docstring provided.</i></div> </article> </li><li> <a name="CL-FLAC-CFFI:FREE-FILE"> </a> <article id="FUNCTION CL-FLAC-CFFI:FREE-FILE"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20CL-FLAC-CFFI%3AFREE-FILE">FREE-FILE</a></code></h4> <code class="qualifiers"></code> <code class="arguments">FILE</code><code>)</code> </header> <div class="docstring"><i>No docstring provided.</i></div> </article> </li><li> <a name="CL-FLAC-CFFI:OPEN-FILE"> </a> <article id="FUNCTION CL-FLAC-CFFI:OPEN-FILE"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20CL-FLAC-CFFI%3AOPEN-FILE">OPEN-FILE</a></code></h4> <code class="qualifiers"></code> <code class="arguments">PATH FILE</code><code>)</code> </header> <div class="docstring"><i>No docstring provided.</i></div> </article> </li><li> <a name="CL-FLAC-CFFI:READ-F32"> </a> <article id="FUNCTION CL-FLAC-CFFI:READ-F32"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20CL-FLAC-CFFI%3AREAD-F32">READ-F32</a></code></h4> <code class="qualifiers"></code> <code class="arguments">DATA SAMPLES FILE</code><code>)</code> </header> <div class="docstring"><i>No docstring provided.</i></div> </article> </li><li> <a name="CL-FLAC-CFFI:READ-S16"> </a> <article id="FUNCTION CL-FLAC-CFFI:READ-S16"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20CL-FLAC-CFFI%3AREAD-S16">READ-S16</a></code></h4> <code class="qualifiers"></code> <code class="arguments">DATA SAMPLES FILE</code><code>)</code> </header> <div class="docstring"><i>No docstring provided.</i></div> </article> </li><li> <a name="CL-FLAC-CFFI:READ-S32"> </a> <article id="FUNCTION CL-FLAC-CFFI:READ-S32"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20CL-FLAC-CFFI%3AREAD-S32">READ-S32</a></code></h4> <code class="qualifiers"></code> <code class="arguments">DATA SAMPLES FILE</code><code>)</code> </header> <div class="docstring"><i>No docstring provided.</i></div> </article> </li><li> <a name="CL-FLAC-CFFI:SAMPLE-COUNT"> </a> <article id="FUNCTION CL-FLAC-CFFI:SAMPLE-COUNT"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20CL-FLAC-CFFI%3ASAMPLE-COUNT">SAMPLE-COUNT</a></code></h4> <code class="qualifiers"></code> <code class="arguments">FILE</code><code>)</code> </header> <div class="docstring"><i>No docstring provided.</i></div> </article> </li><li> <a name="CL-FLAC-CFFI:SAMPLE-RATE"> </a> <article id="FUNCTION CL-FLAC-CFFI:SAMPLE-RATE"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20CL-FLAC-CFFI%3ASAMPLE-RATE">SAMPLE-RATE</a></code></h4> <code class="qualifiers"></code> <code class="arguments">FILE</code><code>)</code> </header> <div class="docstring"><i>No docstring provided.</i></div> </article> </li><li> <a name="CL-FLAC-CFFI:SEEK"> </a> <article id="FUNCTION CL-FLAC-CFFI:SEEK"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20CL-FLAC-CFFI%3ASEEK">SEEK</a></code></h4> <code class="qualifiers"></code> <code class="arguments">SAMPLE FILE</code><code>)</code> </header> <div class="docstring"><i>No docstring provided.</i></div> </article> </li><li> <a name="CL-FLAC-CFFI:STRERROR"> </a> <article id="FUNCTION CL-FLAC-CFFI:STRERROR"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20CL-FLAC-CFFI%3ASTRERROR">STRERROR</a></code></h4> <code class="qualifiers"></code> <code class="arguments">ERROR</code><code>)</code> </header> <div class="docstring"><i>No docstring provided.</i></div> </article> </li></ul> </li><li class="package"> <h3> <a name="CL-FLAC" href="#CL-FLAC">CL-FLAC</a> <span class="nicknames">(ORG.SHIRAKUMO.FRAF.FLAC)</span> </h3> <ul><li> <a name="CL-FLAC:FILE"> </a> <article id="CLASS CL-FLAC:FILE"> <header class="class"> <span class="type">class</span> <h4 class="name"><code><a href="#CLASS%20CL-FLAC%3AFILE">FILE</a></code></h4> </header> <div class="docstring"><pre>Container for the FLAC file.
Note that you do not need to explicitly close the file.
It will automatically clean up when this instance is
garbage collected.
See <a href="#CL-FLAC:MAKE-FILE">MAKE-FILE</a>
See <a href="#CL-FLAC:CLOSE-FILE">CLOSE-FILE</a>
See <a href="#CL-FLAC:HANDLE">HANDLE</a>
See <a href="NIL">PATH</a>
See <a href="#CL-FLAC-CFFI:CHANNELS">CHANNELS</a>
See <a href="#CL-FLAC:SAMPLERATE">SAMPLERATE</a>
See <a href="#CL-FLAC-CFFI:BITS-PER-SAMPLE">BITS-PER-SAMPLE</a>
See <a href="#CL-FLAC-CFFI:SAMPLE-COUNT">SAMPLE-COUNT</a>
See <a href="#CL-FLAC-CFFI:FRAME-COUNT">FRAME-COUNT</a>
See <a href="#CL-FLAC:READ-DIRECTLY">READ-DIRECTLY</a>
See <a href="#CL-FLAC:READ-INTO-VECTOR">READ-INTO-VECTOR</a>
See <a href="#CL-FLAC:READ-TO-VECTOR">READ-TO-VECTOR</a>
See <a href="#CL-FLAC-CFFI:SEEK">SEEK</a></pre></div> </article> </li><li> <a name="CL-FLAC:HANDLE"> </a> <article id="ACCESSOR CL-FLAC:HANDLE"> <header class="accessor"> <span class="type">accessor</span> <code>(</code><h4 class="name"><code><a href="#ACCESSOR%20CL-FLAC%3AHANDLE">HANDLE</a></code></h4> <code class="qualifiers"></code> <code class="arguments">INSTANCE</code><code>)</code> </header> <div class="docstring"><pre>Accessor to the handle for the underlying C data of the FLAC file.
See <a href="#CL-FLAC:FILE">FILE</a></pre></div> </article> </li><li> <a name="CL-FLAC:BITS-PER-SAMPLE"> </a> <article id="FUNCTION CL-FLAC:BITS-PER-SAMPLE"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20CL-FLAC%3ABITS-PER-SAMPLE">BITS-PER-SAMPLE</a></code></h4> <code class="qualifiers"></code> <code class="arguments">FILE0</code><code>)</code> </header> <div class="docstring"><pre>Returns the number of bits per sample as encoded in the file.
See <a href="#CL-FLAC:FILE">FILE</a></pre></div> </article> </li><li> <a name="CL-FLAC:CHANNELS"> </a> <article id="FUNCTION CL-FLAC:CHANNELS"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20CL-FLAC%3ACHANNELS">CHANNELS</a></code></h4> <code class="qualifiers"></code> <code class="arguments">FILE0</code><code>)</code> </header> <div class="docstring"><pre>Returns the number of channels that the file encodes.
See <a href="#CL-FLAC:FILE">FILE</a></pre></div> </article> </li><li> <a name="CL-FLAC:CLOSE-FILE"> </a> <article id="FUNCTION CL-FLAC:CLOSE-FILE"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20CL-FLAC%3ACLOSE-FILE">CLOSE-FILE</a></code></h4> <code class="qualifiers"></code> <code class="arguments">FILE</code><code>)</code> </header> <div class="docstring"><pre>Explicitly close the file.
Note that this will render the instance useless.
See <a href="#CL-FLAC:FILE">FILE</a></pre></div> </article> </li><li> <a name="CL-FLAC:FRAME-COUNT"> </a> <article id="FUNCTION CL-FLAC:FRAME-COUNT"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20CL-FLAC%3AFRAME-COUNT">FRAME-COUNT</a></code></h4> <code class="qualifiers"></code> <code class="arguments">FILE0</code><code>)</code> </header> <div class="docstring"><pre>Returns the number of frames stored in the file.
This is the number of samples divided by the number
of channels, this giving the number of frames.
See <a href="#CL-FLAC-CFFI:SAMPLE-COUNT">SAMPLE-COUNT</a>
See <a href="#CL-FLAC:FILE">FILE</a></pre></div> </article> </li><li> <a name="CL-FLAC:MAKE-FILE"> </a> <article id="FUNCTION CL-FLAC:MAKE-FILE"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20CL-FLAC%3AMAKE-FILE">MAKE-FILE</a></code></h4> <code class="qualifiers"></code> <code class="arguments">PATH</code><code>)</code> </header> <div class="docstring"><pre>Create a new FLAC file from the given path.
If the path is not accessible, or the file is malformatted,
an error is signalled.
See <a href="#CL-FLAC:FILE">FILE</a></pre></div> </article> </li><li> <a name="CL-FLAC:READ-DIRECTLY"> </a> <article id="FUNCTION CL-FLAC:READ-DIRECTLY"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20CL-FLAC%3AREAD-DIRECTLY">READ-DIRECTLY</a></code></h4> <code class="qualifiers"></code> <code class="arguments">FILE BUFFER-POINTER BUFFER-SIZE</code><code>)</code> </header> <div class="docstring"><pre>Directly decode samples from the file into the buffer.
BUFFER-SIZE is in number of bytes, but must be aligned
with the sample size. The buffer is filled with 32-bit
float samples.
Returns the number of bytes successfully read. If this
number is lower than the requested amount, the file has
reached its end.
See <a href="#CL-FLAC:FILE">FILE</a></pre></div> </article> </li><li> <a name="CL-FLAC:READ-INTO-VECTOR"> </a> <article id="FUNCTION CL-FLAC:READ-INTO-VECTOR"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20CL-FLAC%3AREAD-INTO-VECTOR">READ-INTO-VECTOR</a></code></h4> <code class="qualifiers"></code> <code class="arguments">FILE VECTOR &OPTIONAL (START 0) END</code><code>)</code> </header> <div class="docstring"><pre>Decode samples into the vector.
The vector must have an element-type of either
SINGLE-FLOAT, (SIGNED-BYTE 16), or (SIGNED-BYTE 32).
Returned is the number of samples that were actually
decoded, as that might be lower than the requested
amount if the file does not contain enough samples
anymore.
See <a href="#CL-FLAC:FILE">FILE</a></pre></div> </article> </li><li> <a name="CL-FLAC:READ-TO-VECTOR"> </a> <article id="FUNCTION CL-FLAC:READ-TO-VECTOR"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20CL-FLAC%3AREAD-TO-VECTOR">READ-TO-VECTOR</a></code></h4> <code class="qualifiers"></code> <code class="arguments">FILE SAMPLES</code><code>)</code> </header> <div class="docstring"><pre>Reads the given number of samples into a single-float vector.
Returns the vector and the number of samples that were
actually decoded.
See <a href="#CL-FLAC:READ-INTO-VECTOR">READ-INTO-VECTOR</a>
See <a href="#CL-FLAC:FILE">FILE</a></pre></div> </article> </li><li> <a name="CL-FLAC:SAMPLE-COUNT"> </a> <article id="FUNCTION CL-FLAC:SAMPLE-COUNT"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20CL-FLAC%3ASAMPLE-COUNT">SAMPLE-COUNT</a></code></h4> <code class="qualifiers"></code> <code class="arguments">FILE0</code><code>)</code> </header> <div class="docstring"><pre>Returns the total number of samples stored in the file.
See <a href="#CL-FLAC-CFFI:FRAME-COUNT">FRAME-COUNT</a>
See <a href="#CL-FLAC:FILE">FILE</a></pre></div> </article> </li><li> <a name="CL-FLAC:SAMPLERATE"> </a> <article id="FUNCTION CL-FLAC:SAMPLERATE"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20CL-FLAC%3ASAMPLERATE">SAMPLERATE</a></code></h4> <code class="qualifiers"></code> <code class="arguments">FILE0</code><code>)</code> </header> <div class="docstring"><pre>Returns the samplerate of the file in Hertz.
See <a href="#CL-FLAC:FILE">FILE</a></pre></div> </article> </li><li> <a name="CL-FLAC:SEEK"> </a> <article id="FUNCTION CL-FLAC:SEEK"> <header class="function"> <span class="type">function</span> <code>(</code><h4 class="name"><code><a href="#FUNCTION%20CL-FLAC%3ASEEK">SEEK</a></code></h4> <code class="qualifiers"></code> <code class="arguments">FILE FRAME</code><code>)</code> </header> <div class="docstring"><pre>Seek to the requested frame.
Returns the file on success, signals a condition on
failure.
See <a href="#CL-FLAC:FILE">FILE</a></pre></div> </article> </li></ul> </li></ul> </article> </main> </body> </html>