Mercurial > sdl-ios-xcode
annotate docs/html/sdlaudiospec.html @ 3243:5db962a9a991
CD-ROM support is so passé :)
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sat, 05 Sep 2009 09:11:03 +0000 |
parents | 355632dca928 |
children |
rev | line source |
---|---|
0 | 1 <HTML |
2 ><HEAD | |
3 ><TITLE | |
4 >SDL_AudioSpec</TITLE | |
5 ><META | |
6 NAME="GENERATOR" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+ |
0 | 8 "><LINK |
9 REL="HOME" | |
10 TITLE="SDL Library Documentation" | |
11 HREF="index.html"><LINK | |
12 REL="UP" | |
13 TITLE="Audio" | |
14 HREF="audio.html"><LINK | |
15 REL="PREVIOUS" | |
16 TITLE="Audio" | |
17 HREF="audio.html"><LINK | |
18 REL="NEXT" | |
19 TITLE="SDL_OpenAudio" | |
20 HREF="sdlopenaudio.html"></HEAD | |
21 ><BODY | |
22 CLASS="REFENTRY" | |
23 BGCOLOR="#FFF8DC" | |
24 TEXT="#000000" | |
25 LINK="#0000ee" | |
26 VLINK="#551a8b" | |
27 ALINK="#ff0000" | |
28 ><DIV | |
29 CLASS="NAVHEADER" | |
30 ><TABLE | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
31 SUMMARY="Header navigation table" |
0 | 32 WIDTH="100%" |
33 BORDER="0" | |
34 CELLPADDING="0" | |
35 CELLSPACING="0" | |
36 ><TR | |
37 ><TH | |
38 COLSPAN="3" | |
39 ALIGN="center" | |
40 >SDL Library Documentation</TH | |
41 ></TR | |
42 ><TR | |
43 ><TD | |
44 WIDTH="10%" | |
45 ALIGN="left" | |
46 VALIGN="bottom" | |
47 ><A | |
48 HREF="audio.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
49 ACCESSKEY="P" |
0 | 50 >Prev</A |
51 ></TD | |
52 ><TD | |
53 WIDTH="80%" | |
54 ALIGN="center" | |
55 VALIGN="bottom" | |
56 ></TD | |
57 ><TD | |
58 WIDTH="10%" | |
59 ALIGN="right" | |
60 VALIGN="bottom" | |
61 ><A | |
62 HREF="sdlopenaudio.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
63 ACCESSKEY="N" |
0 | 64 >Next</A |
65 ></TD | |
66 ></TR | |
67 ></TABLE | |
68 ><HR | |
69 ALIGN="LEFT" | |
70 WIDTH="100%"></DIV | |
71 ><H1 | |
72 ><A | |
73 NAME="SDLAUDIOSPEC" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
74 ></A |
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
75 >SDL_AudioSpec</H1 |
0 | 76 ><DIV |
77 CLASS="REFNAMEDIV" | |
78 ><A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
79 NAME="AEN6507" |
0 | 80 ></A |
81 ><H2 | |
82 >Name</H2 | |
83 >SDL_AudioSpec -- Audio Specification Structure</DIV | |
84 ><DIV | |
85 CLASS="REFSECT1" | |
86 ><A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
87 NAME="AEN6510" |
0 | 88 ></A |
89 ><H2 | |
90 >Structure Definition</H2 | |
91 ><PRE | |
92 CLASS="PROGRAMLISTING" | |
93 >typedef struct{ | |
94 int freq; | |
95 Uint16 format; | |
96 Uint8 channels; | |
97 Uint8 silence; | |
98 Uint16 samples; | |
99 Uint32 size; | |
100 void (*callback)(void *userdata, Uint8 *stream, int len); | |
101 void *userdata; | |
102 } SDL_AudioSpec;</PRE | |
103 ></DIV | |
104 ><DIV | |
105 CLASS="REFSECT1" | |
106 ><A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
107 NAME="AEN6513" |
0 | 108 ></A |
109 ><H2 | |
110 >Structure Data</H2 | |
111 ><DIV | |
112 CLASS="INFORMALTABLE" | |
113 ><A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
114 NAME="AEN6515" |
0 | 115 ></A |
116 ><P | |
117 ></P | |
118 ><TABLE | |
119 BORDER="0" | |
120 CLASS="CALSTABLE" | |
121 ><TBODY | |
122 ><TR | |
123 ><TD | |
124 ALIGN="LEFT" | |
125 VALIGN="TOP" | |
126 ><TT | |
127 CLASS="STRUCTFIELD" | |
128 ><I | |
129 >freq</I | |
130 ></TT | |
131 ></TD | |
132 ><TD | |
133 ALIGN="LEFT" | |
134 VALIGN="TOP" | |
135 >Audio frequency in samples per second</TD | |
136 ></TR | |
137 ><TR | |
138 ><TD | |
139 ALIGN="LEFT" | |
140 VALIGN="TOP" | |
141 ><TT | |
142 CLASS="STRUCTFIELD" | |
143 ><I | |
144 >format</I | |
145 ></TT | |
146 ></TD | |
147 ><TD | |
148 ALIGN="LEFT" | |
149 VALIGN="TOP" | |
150 >Audio data format</TD | |
151 ></TR | |
152 ><TR | |
153 ><TD | |
154 ALIGN="LEFT" | |
155 VALIGN="TOP" | |
156 ><TT | |
157 CLASS="STRUCTFIELD" | |
158 ><I | |
159 >channels</I | |
160 ></TT | |
161 ></TD | |
162 ><TD | |
163 ALIGN="LEFT" | |
164 VALIGN="TOP" | |
165 >Number of channels: 1 mono, 2 stereo</TD | |
166 ></TR | |
167 ><TR | |
168 ><TD | |
169 ALIGN="LEFT" | |
170 VALIGN="TOP" | |
171 ><TT | |
172 CLASS="STRUCTFIELD" | |
173 ><I | |
174 >silence</I | |
175 ></TT | |
176 ></TD | |
177 ><TD | |
178 ALIGN="LEFT" | |
179 VALIGN="TOP" | |
180 >Audio buffer silence value (calculated)</TD | |
181 ></TR | |
182 ><TR | |
183 ><TD | |
184 ALIGN="LEFT" | |
185 VALIGN="TOP" | |
186 ><TT | |
187 CLASS="STRUCTFIELD" | |
188 ><I | |
189 >samples</I | |
190 ></TT | |
191 ></TD | |
192 ><TD | |
193 ALIGN="LEFT" | |
194 VALIGN="TOP" | |
195 >Audio buffer size in samples</TD | |
196 ></TR | |
197 ><TR | |
198 ><TD | |
199 ALIGN="LEFT" | |
200 VALIGN="TOP" | |
201 ><TT | |
202 CLASS="STRUCTFIELD" | |
203 ><I | |
204 >size</I | |
205 ></TT | |
206 ></TD | |
207 ><TD | |
208 ALIGN="LEFT" | |
209 VALIGN="TOP" | |
210 >Audio buffer size in bytes (calculated)</TD | |
211 ></TR | |
212 ><TR | |
213 ><TD | |
214 ALIGN="LEFT" | |
215 VALIGN="TOP" | |
216 ><TT | |
217 CLASS="STRUCTFIELD" | |
218 ><I | |
219 >callback(..)</I | |
220 ></TT | |
221 ></TD | |
222 ><TD | |
223 ALIGN="LEFT" | |
224 VALIGN="TOP" | |
225 >Callback function for filling the audio buffer</TD | |
226 ></TR | |
227 ><TR | |
228 ><TD | |
229 ALIGN="LEFT" | |
230 VALIGN="TOP" | |
231 ><TT | |
232 CLASS="STRUCTFIELD" | |
233 ><I | |
234 >userdata</I | |
235 ></TT | |
236 ></TD | |
237 ><TD | |
238 ALIGN="LEFT" | |
239 VALIGN="TOP" | |
240 >Pointer the user data which is passed to the callback function</TD | |
241 ></TR | |
242 ></TBODY | |
243 ></TABLE | |
244 ><P | |
245 ></P | |
246 ></DIV | |
247 ></DIV | |
248 ><DIV | |
249 CLASS="REFSECT1" | |
250 ><A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
251 NAME="AEN6550" |
0 | 252 ></A |
253 ><H2 | |
254 >Description</H2 | |
255 ><P | |
256 >The <SPAN | |
257 CLASS="STRUCTNAME" | |
258 >SDL_AudioSpec</SPAN | |
259 > structure is used to describe the format of some audio data. This structure is used by <A | |
260 HREF="sdlopenaudio.html" | |
261 ><TT | |
262 CLASS="FUNCTION" | |
263 >SDL_OpenAudio</TT | |
264 ></A | |
265 > and <A | |
266 HREF="sdlloadwav.html" | |
267 ><TT | |
268 CLASS="FUNCTION" | |
269 >SDL_LoadWAV</TT | |
270 ></A | |
271 >. While all fields are used by <TT | |
272 CLASS="FUNCTION" | |
273 >SDL_OpenAudio</TT | |
274 > only <TT | |
275 CLASS="STRUCTFIELD" | |
276 ><I | |
277 >freq</I | |
278 ></TT | |
279 >, <TT | |
280 CLASS="STRUCTFIELD" | |
281 ><I | |
282 >format</I | |
283 ></TT | |
284 >, <TT | |
285 CLASS="STRUCTFIELD" | |
286 ><I | |
287 >samples</I | |
288 ></TT | |
289 > and <TT | |
290 CLASS="STRUCTFIELD" | |
291 ><I | |
292 >channels</I | |
293 ></TT | |
294 > are used by <TT | |
295 CLASS="FUNCTION" | |
296 >SDL_LoadWAV</TT | |
297 >. We will detail these common members here.</P | |
298 ><DIV | |
299 CLASS="INFORMALTABLE" | |
300 ><A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
301 NAME="AEN6564" |
0 | 302 ></A |
303 ><P | |
304 ></P | |
305 ><TABLE | |
306 BORDER="0" | |
307 CLASS="CALSTABLE" | |
308 ><TBODY | |
309 ><TR | |
310 ><TD | |
311 ALIGN="LEFT" | |
312 VALIGN="TOP" | |
313 ><TT | |
314 CLASS="STRUCTFIELD" | |
315 ><I | |
316 >freq</I | |
317 ></TT | |
318 ></TD | |
319 ><TD | |
320 ALIGN="LEFT" | |
321 VALIGN="TOP" | |
322 ><P | |
323 >The number of samples sent to the sound device every second. Common values are 11025, 22050 and 44100. The higher the better.</P | |
324 ></TD | |
325 ></TR | |
326 ><TR | |
327 ><TD | |
328 ALIGN="LEFT" | |
329 VALIGN="TOP" | |
330 ><TT | |
331 CLASS="STRUCTFIELD" | |
332 ><I | |
333 >format</I | |
334 ></TT | |
335 ></TD | |
336 ><TD | |
337 ALIGN="LEFT" | |
338 VALIGN="TOP" | |
339 ><P | |
340 >Specifies the size and type of each sample element | |
341 <P | |
342 ></P | |
343 ><DIV | |
344 CLASS="VARIABLELIST" | |
345 ><DL | |
346 ><DT | |
347 ><TT | |
348 CLASS="LITERAL" | |
349 >AUDIO_U8</TT | |
350 ></DT | |
351 ><DD | |
352 ><P | |
353 >Unsigned 8-bit samples</P | |
354 ></DD | |
355 ><DT | |
356 ><TT | |
357 CLASS="LITERAL" | |
358 >AUDIO_S8</TT | |
359 ></DT | |
360 ><DD | |
361 ><P | |
362 >Signed 8-bit samples</P | |
363 ></DD | |
364 ><DT | |
365 ><TT | |
366 CLASS="LITERAL" | |
367 >AUDIO_U16</TT | |
368 > or <TT | |
369 CLASS="LITERAL" | |
370 >AUDIO_U16LSB</TT | |
371 ></DT | |
372 ><DD | |
373 ><P | |
374 >Unsigned 16-bit little-endian samples</P | |
375 ></DD | |
376 ><DT | |
377 ><TT | |
378 CLASS="LITERAL" | |
379 >AUDIO_S16</TT | |
380 > or <TT | |
381 CLASS="LITERAL" | |
382 >AUDIO_S16LSB</TT | |
383 ></DT | |
384 ><DD | |
385 ><P | |
386 >Signed 16-bit little-endian samples</P | |
387 ></DD | |
388 ><DT | |
389 ><TT | |
390 CLASS="LITERAL" | |
391 >AUDIO_U16MSB</TT | |
392 ></DT | |
393 ><DD | |
394 ><P | |
395 >Unsigned 16-bit big-endian samples</P | |
396 ></DD | |
397 ><DT | |
398 ><TT | |
399 CLASS="LITERAL" | |
400 >AUDIO_S16MSB</TT | |
401 ></DT | |
402 ><DD | |
403 ><P | |
404 >Signed 16-bit big-endian samples</P | |
405 ></DD | |
406 ><DT | |
407 ><TT | |
408 CLASS="LITERAL" | |
409 >AUDIO_U16SYS</TT | |
410 ></DT | |
411 ><DD | |
412 ><P | |
413 >Either <TT | |
414 CLASS="LITERAL" | |
415 >AUDIO_U16LSB</TT | |
416 > or <TT | |
417 CLASS="LITERAL" | |
418 >AUDIO_U16MSB</TT | |
419 > depending on you systems endianness</P | |
420 ></DD | |
421 ><DT | |
422 ><TT | |
423 CLASS="LITERAL" | |
424 >AUDIO_S16SYS</TT | |
425 ></DT | |
426 ><DD | |
427 ><P | |
428 >Either <TT | |
429 CLASS="LITERAL" | |
430 >AUDIO_S16LSB</TT | |
431 > or <TT | |
432 CLASS="LITERAL" | |
433 >AUDIO_S16MSB</TT | |
434 > depending on you systems endianness</P | |
435 ></DD | |
436 ></DL | |
437 ></DIV | |
438 ></P | |
439 ></TD | |
440 ></TR | |
441 ><TR | |
442 ><TD | |
443 ALIGN="LEFT" | |
444 VALIGN="TOP" | |
445 ><TT | |
446 CLASS="STRUCTFIELD" | |
447 ><I | |
448 >channels</I | |
449 ></TT | |
450 ></TD | |
451 ><TD | |
452 ALIGN="LEFT" | |
453 VALIGN="TOP" | |
454 >The number of seperate sound channels. 1 is mono (single channel), 2 is stereo (dual channel).</TD | |
455 ></TR | |
456 ><TR | |
457 ><TD | |
458 ALIGN="LEFT" | |
459 VALIGN="TOP" | |
460 ><TT | |
461 CLASS="STRUCTFIELD" | |
462 ><I | |
463 >samples</I | |
464 ></TT | |
465 ></TD | |
466 ><TD | |
467 ALIGN="LEFT" | |
468 VALIGN="TOP" | |
469 >When used with <A | |
470 HREF="sdlopenaudio.html" | |
471 ><TT | |
472 CLASS="FUNCTION" | |
473 >SDL_OpenAudio</TT | |
474 ></A | |
475 > this refers to the size of the audio buffer in samples. A sample a chunk of audio data of the size specified in <TT | |
476 CLASS="PARAMETER" | |
477 ><I | |
478 >format</I | |
479 ></TT | |
480 > mulitplied by the number of channels. When the <SPAN | |
481 CLASS="STRUCTNAME" | |
482 >SDL_AudioSpec</SPAN | |
483 > is used with <A | |
484 HREF="sdlloadwav.html" | |
485 ><TT | |
486 CLASS="FUNCTION" | |
487 >SDL_LoadWAV</TT | |
488 ></A | |
489 > <TT | |
490 CLASS="STRUCTFIELD" | |
491 ><I | |
492 >samples</I | |
493 ></TT | |
494 > is set to 4096.</TD | |
495 ></TR | |
496 ></TBODY | |
497 ></TABLE | |
498 ><P | |
499 ></P | |
500 ></DIV | |
501 ></DIV | |
502 ><DIV | |
503 CLASS="REFSECT1" | |
504 ><A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
505 NAME="AEN6639" |
0 | 506 ></A |
507 ><H2 | |
508 >See Also</H2 | |
509 ><P | |
510 ><A | |
511 HREF="sdlopenaudio.html" | |
512 ><TT | |
513 CLASS="FUNCTION" | |
514 >SDL_OpenAudio</TT | |
515 ></A | |
516 >, | |
517 <A | |
518 HREF="sdlloadwav.html" | |
519 ><TT | |
520 CLASS="FUNCTION" | |
521 >SDL_LoadWAV</TT | |
522 ></A | |
523 ></P | |
524 ></DIV | |
525 ><DIV | |
526 CLASS="NAVFOOTER" | |
527 ><HR | |
528 ALIGN="LEFT" | |
529 WIDTH="100%"><TABLE | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
530 SUMMARY="Footer navigation table" |
0 | 531 WIDTH="100%" |
532 BORDER="0" | |
533 CELLPADDING="0" | |
534 CELLSPACING="0" | |
535 ><TR | |
536 ><TD | |
537 WIDTH="33%" | |
538 ALIGN="left" | |
539 VALIGN="top" | |
540 ><A | |
541 HREF="audio.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
542 ACCESSKEY="P" |
0 | 543 >Prev</A |
544 ></TD | |
545 ><TD | |
546 WIDTH="34%" | |
547 ALIGN="center" | |
548 VALIGN="top" | |
549 ><A | |
550 HREF="index.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
551 ACCESSKEY="H" |
0 | 552 >Home</A |
553 ></TD | |
554 ><TD | |
555 WIDTH="33%" | |
556 ALIGN="right" | |
557 VALIGN="top" | |
558 ><A | |
559 HREF="sdlopenaudio.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
560 ACCESSKEY="N" |
0 | 561 >Next</A |
562 ></TD | |
563 ></TR | |
564 ><TR | |
565 ><TD | |
566 WIDTH="33%" | |
567 ALIGN="left" | |
568 VALIGN="top" | |
569 >Audio</TD | |
570 ><TD | |
571 WIDTH="34%" | |
572 ALIGN="center" | |
573 VALIGN="top" | |
574 ><A | |
575 HREF="audio.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
576 ACCESSKEY="U" |
0 | 577 >Up</A |
578 ></TD | |
579 ><TD | |
580 WIDTH="33%" | |
581 ALIGN="right" | |
582 VALIGN="top" | |
583 >SDL_OpenAudio</TD | |
584 ></TR | |
585 ></TABLE | |
586 ></DIV | |
587 ></BODY | |
588 ></HTML | |
589 > |