supernova: fixes for boost-1.49 and gcc-4.7
[supercollider.git] / Help / Files / SoundFile.html
blobc135d2bee360a8700342450e65089caaf475ceeb
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <meta http-equiv="Content-Style-Type" content="text/css">
6 <title></title>
7 <meta name="Generator" content="Cocoa HTML Writer">
8 <meta name="CocoaVersion" content="949.54">
9 <style type="text/css">
10 p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
11 p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; min-height: 12.0px}
12 p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
13 p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco}
14 p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #606060}
15 p.p6 {margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Helvetica}
16 p.p7 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #000000}
17 p.p8 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #bf0000}
18 p.p9 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #001bb9}
19 p.p10 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #ad140d}
20 p.p11 {margin: 0.0px 0.0px 0.0px 29.0px; text-indent: -29.0px; font: 12.0px Helvetica}
21 p.p12 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #ad140d; min-height: 12.0px}
22 p.p13 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Courier; min-height: 14.0px}
23 span.s1 {font: 18.0px Helvetica}
24 span.s2 {color: #001bb9}
25 span.s3 {color: #000000}
26 span.s4 {color: #0000bf}
27 span.s5 {color: #606060}
28 span.s6 {color: #0000ff}
29 span.s7 {color: #2c7014}
30 span.s8 {font: 9.0px Monaco}
31 span.s9 {font: 12.0px Helvetica}
32 span.s10 {text-decoration: underline}
33 span.Apple-tab-span {white-space:pre}
34 </style>
35 </head>
36 <body>
37 <p class="p1"><span class="s1"><b>SoundFile<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></b></span><span class="Apple-tab-span"> </span><b>sclang soundfile data</b></p>
38 <p class="p2"><br></p>
39 <p class="p1">superclass: <a href="../Core/Object.html"><span class="s2">Object</span></a></p>
40 <p class="p3"><br></p>
41 <p class="p1">The SoundFile class is used to check the size, format, channels etc. when the sclang client needs this information about a SoundFile. Soundfile data can be read and modified. Soundfile data can also be read and written incrementally, so with properly designed code, there is no restriction on the file size.</p>
42 <p class="p3"><br></p>
43 <p class="p1">In most cases you will wish to send commands to the server to get it to load SoundFiles directly into Buffers.<span class="Apple-converted-space">  </span>You will not need to use this class for this. See the <a href="../ServerArchitecture/Buffer.html"><span class="s2">Buffer</span></a> helpfile.</p>
44 <p class="p3"><br></p>
45 <p class="p2"><br></p>
46 <p class="p2"><br></p>
47 <p class="p4">(</p>
48 <p class="p4">f = <span class="s2">SoundFile</span>.new;</p>
49 <p class="p5"><span class="s3">f.openRead(</span>"sounds/a11wlk01.wav"<span class="s3">);</span></p>
50 <p class="p4">f.inspect;</p>
51 <p class="p4">f.close;</p>
52 <p class="p4">)</p>
53 <p class="p3"><br></p>
54 <p class="p3"><br></p>
55 <p class="p6"><b>Creating</b></p>
56 <p class="p3"><br></p>
57 <p class="p1"><b>*new</b></p>
58 <p class="p3"><br></p>
59 <p class="p1">Creates a new SoundFile instance.<span class="Apple-converted-space"> </span></p>
60 <p class="p3"><br></p>
61 <p class="p1"><b>*collect(pattern = "sounds/*")</b></p>
62 <p class="p3"><br></p>
63 <p class="p1">Returns an array of SoundFile objects whose paths match the pattern. <span class="Apple-converted-space"> </span></p>
64 <p class="p1">(The associated files are closed. These objects can be used to cue playback buffers)</p>
65 <p class="p3"><br></p>
66 <p class="p7"><span class="s4">SoundFile</span>.collect(<span class="s5">"sounds/*"</span>).do { <span class="s4">|f|</span> f.path.postln };</p>
67 <p class="p3"><br></p>
68 <p class="p1"><b>*use(path, function)</b></p>
69 <p class="p3"><br></p>
70 <p class="p1">Reads the data of a SoundFile, evaluates the function (passing the file as argument) and closes it again.</p>
71 <p class="p3"><br></p>
72 <p class="p8">// the above example</p>
73 <p class="p7"><span class="s4">SoundFile</span>.use(<span class="s5">"sounds/a11wlk01.wav"</span>, { <span class="s4">|f|</span> f.inspect });</p>
74 <p class="p3"><br></p>
75 <p class="p3"><br></p>
76 <p class="p6"><b>Playback</b></p>
77 <p class="p3"><br></p>
78 <p class="p1"><b>cue(event, playNow)</b></p>
79 <p class="p3"><span class="Apple-tab-span"> </span></p>
80 <p class="p1">Allocates a buffer and cues the SoundFile for playback. Returns an event parameterized to play that buffer.</p>
81 <p class="p1">(See <a href="../Streams-Patterns-Events/NodeEvent.html"><span class="s6">NodeEvent</span></a><b> </b>for a description of how events can be used to control running synths.)</p>
82 <p class="p1">The event responds to <b>play, stop, pause, resume</b>, keeping both the file and buffer open.</p>
83 <p class="p1">The file is closed and the<span class="Apple-converted-space">  </span>buffer is freed when the event is sent a <b>close </b>message.</p>
84 <p class="p3"><br></p>
85 <p class="p1"><b>arguments</b></p>
86 <p class="p1"><b><span class="Apple-tab-span"> </span>event | Nil</b></p>
87 <p class="p1"><b><span class="Apple-tab-span"> </span></b>An <b>event </b>can passed as an argument allowing playback to be customized using the following keys:</p>
88 <p class="p3"><span class="Apple-tab-span"> </span></p>
89 <p class="p1"><span class="Apple-tab-span"> </span><b><span class="Apple-tab-span"> </span>key<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>default value<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>what it does</b></p>
90 <p class="p3"><b><span class="Apple-tab-span"> </span></b><span class="Apple-tab-span"> </span></p>
91 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>// buffer and playback position:<span class="Apple-tab-span"> </span></p>
92 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>bufferSize<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>65536</p>
93 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>firstFrame<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>0<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>first frame to play</p>
94 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>lastFrame<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>nil<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>last frame to play (nil plays to end of file)</p>
95 <p class="p3"><span class="Apple-tab-span"> </span></p>
96 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>// synth parameters</p>
97 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>out:<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>0<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>sets output bus</p>
98 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>server:<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>Server.default<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>which server</p>
99 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>group:<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>1<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>what target</p>
100 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>addAction:<span class="Apple-tab-span"> </span>0<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>head/tail/before/after</p>
101 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>amp:<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>1<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>amplitude</p>
102 <p class="p3"><span class="Apple-tab-span"> </span></p>
103 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>instrument:<span class="Apple-tab-span"> </span>nil<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>if nil SoundFile:cue determines the SynthDef</p>
104 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>(one of diskIn1, diskIn2, ...diskIn16)</p>
105 <p class="p3"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
106 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>Here is the default SynthDef used for stereo files:</p>
107 <p class="p3"><span class="Apple-tab-span"> </span></p>
108 <p class="p9"><span class="s3"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></span>SynthDef<span class="s3">(</span><span class="s7">\diskIn2</span><span class="s3">, { </span>| bufnum, out,<span class="Apple-converted-space">  </span>gate = 1, sustain,<span class="Apple-converted-space">  </span>amp = 1, ar = 0, dr = 0.01 |</p>
109 <p class="p4"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="s2">Out</span>.ar(out, <span class="s2">DiskIn</span>.ar(2, bufnum)<span class="Apple-converted-space"> </span></p>
110 <p class="p4"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>* <span class="s2">Linen</span>.kr(gate, ar, 1, dr, 2)</p>
111 <p class="p4"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>* <span class="s2">EnvGen</span>.kr(<span class="s2">Env</span>.linen(0, sustain - ar - dr max: 0 ,dr),1, doneAction: 2) * amp)</p>
112 <p class="p4"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>});</p>
113 <p class="p2"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
114 <p class="p1"><span class="s8"><span class="Apple-tab-span"> </span></span><span class="Apple-tab-span"> </span>The control <b>sustain</b> determines playback duration based on the firstFrame and lastFrame.</p>
115 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>The control <b>gate </b>allows early termination of the playback</p>
116 <p class="p2"><span class="s9"><span class="Apple-tab-span"> </span></span><span class="Apple-tab-span"> </span></p>
117 <p class="p1"><span class="s8"><span class="Apple-tab-span"> </span></span><b>playNow</b></p>
118 <p class="p1"><span class="s8"><span class="Apple-tab-span"> </span></span><span class="Apple-tab-span"> </span>This is a boolean that determines whether the file is to be played immediately after cueing.</p>
119 <p class="p3"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
120 <p class="p1"><span class="Apple-tab-span"> </span><b><span class="Apple-tab-span"> </span>example:</b></p>
121 <p class="p1"><b><span class="Apple-tab-span"> </span></b><span class="Apple-tab-span"> </span>f = SoundFile.collect("sounds/*")</p>
122 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>e = f[1].cue;</p>
123 <p class="p3"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
124 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>e = f[1].cue( (addAction: 2, group: 1) );<span class="Apple-tab-span"> </span>// synth will play ahead of the default group</p>
125 <p class="p3"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
126 <p class="p6"><b>Read/Write</b></p>
127 <p class="p3"><br></p>
128 <p class="p1"><b>openRead(inPathname)</b></p>
129 <p class="p3"><br></p>
130 <p class="p1">Read the header of a file. Answers a Boolean whether the read was successful.</p>
131 <p class="p1">sets the numFrames,numChannels and sampleRate.<span class="Apple-converted-space">  </span>does not set the headerFormat and sampleFormat.</p>
132 <p class="p1"><b>inPathname</b> - a String specifying the path name of the file to read.</p>
133 <p class="p3"><br></p>
134 <p class="p1"><b>readData(rawArray)</b></p>
135 <p class="p3"><br></p>
136 <p class="p1">Reads the sample data of the file into the raw array you supply. You<span class="Apple-converted-space">  </span>must have already called openRead.</p>
137 <p class="p3"><br></p>
138 <p class="p1">The raw array must be a FloatArray. Regardless of the sample format of the file, the array will be populated with floating point values. For integer formats, the floats will all be in the range -1..1.</p>
139 <p class="p3"><br></p>
140 <p class="p1">The size of the FloatArray determines the maximum number of single samples (<i>not</i> sample frames) that will be read. If there are not enough samples left in the file, the size of the array after the readData call will be less than the original size.</p>
141 <p class="p3"><br></p>
142 <p class="p1">When you reach EOF, the array's size will be 0. Checking the array size is an effective termination condition when looping through a sound file. See the method channelPeaks for example.</p>
143 <p class="p3"><br></p>
144 <p class="p1"><b>openWrite(inPathname)</b></p>
145 <p class="p3"><br></p>
146 <p class="p1">Write the header of a file. Answers a Boolean whether the write was successful.</p>
147 <p class="p1"><b>inPathname</b> - a String specifying the path name of the file to write.</p>
148 <p class="p3"><br></p>
149 <p class="p3"><br></p>
150 <p class="p1"><b>writeData(rawArray)</b></p>
151 <p class="p3"><br></p>
152 <p class="p1">Writes the rawArray to the sample data of the file. You<span class="Apple-converted-space">  </span>must have already called openWrite.</p>
153 <p class="p3"><br></p>
154 <p class="p1">The raw array must be a FloatArray or Signal, with all values between -1 and 1 to avoid clipping during playback.</p>
155 <p class="p3"><br></p>
156 <p class="p1">Example:</p>
157 <p class="p3"><br></p>
158 <p class="p4">(</p>
159 <p class="p4">f = <span class="s2">SoundFile</span>.new.headerFormat_(<span class="s5">"AIFF"</span>).sampleFormat_(<span class="s5">"int16"</span>).numChannels_(1);</p>
160 <p class="p5"><span class="s3">f.openWrite(</span>"sounds/sfwrite.aiff"<span class="s3">);</span></p>
161 <p class="p10"><span class="s3"><span class="Apple-tab-span"> </span></span>// sawtooth</p>
162 <p class="p4">b = <span class="s2">Signal</span>.sineFill(100, (1..20).reciprocal);</p>
163 <p class="p10"><span class="s3"><span class="Apple-tab-span"> </span></span>// write multiple cycles (441 * 100 = 1 sec worth)</p>
164 <p class="p4">441.do({ f.writeData(b) });</p>
165 <p class="p4">f.close;</p>
166 <p class="p4">)</p>
167 <p class="p3"><br></p>
168 <p class="p1"><b>isOpen</b></p>
169 <p class="p1">answers if the file is open</p>
170 <p class="p3"><br></p>
171 <p class="p1"><b>close</b></p>
172 <p class="p1">closes the file</p>
173 <p class="p3"><br></p>
174 <p class="p1"><b>duration</b></p>
175 <p class="p1">the duration in seconds of the file</p>
176 <p class="p3"><br></p>
177 <p class="p3"><br></p>
178 <p class="p3"><br></p>
179 <p class="p6"><b>Normalizing</b></p>
180 <p class="p3"><br></p>
181 <p class="p1"><b>*normalize(path, outPath, newHeaderFormat, newSampleFormat, startFrame, numFrames, maxAmp, linkChannels, chunkSize, threaded)</b></p>
182 <p class="p3"><br></p>
183 <p class="p1"><b>normalize(outPath, newHeaderFormat, newSampleFormat, startFrame, numFrames, maxAmp, linkChannels, chunkSize, threaded)</b></p>
184 <p class="p3"><br></p>
185 <p class="p1">Normalizes a soundfile to a level set by the user. The normalized audio will be written into a second file.<span class="Apple-converted-space"> </span></p>
186 <p class="p3"><br></p>
187 <p class="p1"><b>Note:</b> While the normalizer is working, there is no feedback to the user. It will look like SuperCollider is hung, but it will eventually complete the operation. You can set threaded:true to get feedback but it will take slightly longer to complete.</p>
188 <p class="p3"><br></p>
189 <p class="p1">Arguments:</p>
190 <p class="p3"><br></p>
191 <p class="p11"><b>path:</b> a path to the source file</p>
192 <p class="p11"><b>outPath:</b> a path to the destination file</p>
193 <p class="p11"><b>newHeaderFormat:</b> the desired header format of the new file; if not specified, the header format of the source file will be used</p>
194 <p class="p11"><b>newSampleFormat:</b> the desired sample format of the new file; if not specified, the sample format of the source file will be used</p>
195 <p class="p11"><b>startFrame:</b> an index to the sample frame to start normalizing (default 0)</p>
196 <p class="p11"><b>numFrames:</b> the number of sample frames to copy into the destination file (default nil, or entire soundfile)</p>
197 <p class="p11"><b>maxAmp:</b> the desired maximum amplitude. Provide a floating point number or, if desired, an array to specify a different level for each channel. The default is 1.0.</p>
198 <p class="p11"><b>linkChannels:</b> a Boolean specifying whether all channels should be scaled by the same amount. The default is <b>true</b>, meaning that the peak calculation will be based on the largest sample in any channel. If false, each channel's peak will be calculated independently and all channels will be scaled to maxAmp (this would alter the relative loudness of each channel).</p>
199 <p class="p11"><b>chunkSize:</b> how many samples to read at once (default is 4194304, or 16 MB)<span class="Apple-converted-space"> </span></p>
200 <p class="p11"><b>threaded:</b> if true, the normalization runs in a routine so that SC can respond (intermittently) while processing. Prevents OSX beachballing. Default is false.</p>
201 <p class="p3"><br></p>
202 <p class="p1">Using the class method (SoundFile.normalize) will automatically open the source file for you. You may also openRead the SoundFile yourself and call normalize on it. In that case, the source path is omitted because the file is already open.</p>
203 <p class="p3"><br></p>
204 <p class="p1">The normalizer may be used to convert a soundfile from one sample format to another (e.g., to take a floating point soundfile produced by SuperCollider and produce an int16 or int24 soundfile suitable for use in other applications).</p>
205 <p class="p3"><br></p>
206 <p class="p3"><br></p>
207 <p class="p3"><br></p>
208 <p class="p6"><b>Instance Variables</b></p>
209 <p class="p3"><br></p>
210 <p class="p1"><b>&lt;path</b></p>
211 <p class="p3"><br></p>
212 <p class="p1">Get the pathname of the file. This variable is set via the openRead or openWrite calls.</p>
213 <p class="p3"><br></p>
214 <p class="p1"><b>&lt;&gt;headerFormat</b></p>
215 <p class="p3"><br></p>
216 <p class="p1">This is a String indicating the header format which was read by openRead and will be written by openWrite. In order to write a file with a certain header format you set this variable.</p>
217 <p class="p3"><br></p>
218 <p class="p1"><span class="Apple-tab-span"> </span>Sound File Format symbols:</p>
219 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>header formats:</p>
220 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>read/write formats:</p>
221 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>"AIFF"<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>- Apple/SGI AIFF format</p>
222 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>"WAV","WAVE", "RIFF"<span class="Apple-tab-span"> </span>- Microsoft WAV format</p>
223 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>"Sun", "NeXT"<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>- Sun/NeXT AU format</p>
224 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>"SD2"<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>- Sound Designer 2</p>
225 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>"IRCAM"<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>- Berkeley/IRCAM/CARL</p>
226 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>"raw"<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>- no header = raw data</p>
227 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>"MAT4"<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>- Matlab (tm) V4.2 / GNU Octave 2.0</p>
228 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>"MAT5"<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>- Matlab (tm) V5.0 / GNU Octave 2.1</p>
229 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>"PAF"<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>- Ensoniq PARIS file format</p>
230 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>"SVX"<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>- Amiga IFF / SVX8 / SV16 format</p>
231 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>"NIST"<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>- Sphere NIST format</p>
232 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>"VOC"<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>- VOC files</p>
233 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>"W64"<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>- Sonic Foundry's 64 bit RIFF/WAV</p>
234 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>"PVF"<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>- Portable Voice Format</p>
235 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>"XI"<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>- Fasttracker 2 Extended Instrument</p>
236 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>"HTK"<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>- HMM Tool Kit format</p>
237 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>"SDS"<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>- Midi Sample Dump Standard</p>
238 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>"AVR"<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>- Audio Visual Research</p>
239 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>"FLAC"<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>- FLAC lossless file format</p>
240 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>"CAF"<span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>- Core Audio File format</p>
241 <p class="p3"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
242 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>Additionally, a huge number of other formats are supported read only.</p>
243 <p class="p12"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
244 <p class="p3"><br></p>
245 <p class="p13"><br></p>
246 <p class="p1"><b>&lt;&gt;sampleFormat</b></p>
247 <p class="p3"><br></p>
248 <p class="p1">A String indicating the format of the sample data which was read by openRead and will be written by openWrite. libsndfile determines which header formats support which sample formats. This information is detailed at <span class="s10">http://www.mega-nerd.com/libsndfile</span>. The possible header formats are:</p>
249 <p class="p13"><br></p>
250 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>sample formats:</p>
251 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>"int8", "int16", "int24", "int32"</p>
252 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>"mulaw", "alaw",</p>
253 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>"float"</p>
254 <p class="p3"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
255 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>not all header formats support all sample formats.</p>
256 <p class="p13"><br></p>
257 <p class="p13"><br></p>
258 <p class="p1"><b>&lt;numFrames</b></p>
259 <p class="p3"><br></p>
260 <p class="p1">The number of sample frames in the file.</p>
261 <p class="p3"><br></p>
262 <p class="p1"><b>&lt;&gt;numChannels</b></p>
263 <p class="p3"><br></p>
264 <p class="p1">The number of channels in the file.</p>
265 <p class="p3"><br></p>
266 <p class="p1"><b>&lt;&gt;sampleRate</b></p>
267 <p class="p3"><br></p>
268 <p class="p1">The sample rate of the file.</p>
269 <p class="p3"><br></p>
270 </body>
271 </html>