comparison docs/html/sdlopenaudio.html @ 803:355632dca928

Updated SDL HTML documentation
author Sam Lantinga <slouken@libsdl.org>
date Tue, 10 Feb 2004 15:15:40 +0000
parents e5bc29de3f0a
children
comparison
equal deleted inserted replaced
802:3c609d54f100 803:355632dca928
2 ><HEAD 2 ><HEAD
3 ><TITLE 3 ><TITLE
4 >SDL_OpenAudio</TITLE 4 >SDL_OpenAudio</TITLE
5 ><META 5 ><META
6 NAME="GENERATOR" 6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.64 7 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
8 "><LINK 8 "><LINK
9 REL="HOME" 9 REL="HOME"
10 TITLE="SDL Library Documentation" 10 TITLE="SDL Library Documentation"
11 HREF="index.html"><LINK 11 HREF="index.html"><LINK
12 REL="UP" 12 REL="UP"
26 VLINK="#551a8b" 26 VLINK="#551a8b"
27 ALINK="#ff0000" 27 ALINK="#ff0000"
28 ><DIV 28 ><DIV
29 CLASS="NAVHEADER" 29 CLASS="NAVHEADER"
30 ><TABLE 30 ><TABLE
31 SUMMARY="Header navigation table"
31 WIDTH="100%" 32 WIDTH="100%"
32 BORDER="0" 33 BORDER="0"
33 CELLPADDING="0" 34 CELLPADDING="0"
34 CELLSPACING="0" 35 CELLSPACING="0"
35 ><TR 36 ><TR
43 WIDTH="10%" 44 WIDTH="10%"
44 ALIGN="left" 45 ALIGN="left"
45 VALIGN="bottom" 46 VALIGN="bottom"
46 ><A 47 ><A
47 HREF="sdlaudiospec.html" 48 HREF="sdlaudiospec.html"
49 ACCESSKEY="P"
48 >Prev</A 50 >Prev</A
49 ></TD 51 ></TD
50 ><TD 52 ><TD
51 WIDTH="80%" 53 WIDTH="80%"
52 ALIGN="center" 54 ALIGN="center"
56 WIDTH="10%" 58 WIDTH="10%"
57 ALIGN="right" 59 ALIGN="right"
58 VALIGN="bottom" 60 VALIGN="bottom"
59 ><A 61 ><A
60 HREF="sdlpauseaudio.html" 62 HREF="sdlpauseaudio.html"
63 ACCESSKEY="N"
61 >Next</A 64 >Next</A
62 ></TD 65 ></TD
63 ></TR 66 ></TR
64 ></TABLE 67 ></TABLE
65 ><HR 68 ><HR
66 ALIGN="LEFT" 69 ALIGN="LEFT"
67 WIDTH="100%"></DIV 70 WIDTH="100%"></DIV
68 ><H1 71 ><H1
69 ><A 72 ><A
70 NAME="SDLOPENAUDIO" 73 NAME="SDLOPENAUDIO"
71 >SDL_OpenAudio</A 74 ></A
72 ></H1 75 >SDL_OpenAudio</H1
73 ><DIV 76 ><DIV
74 CLASS="REFNAMEDIV" 77 CLASS="REFNAMEDIV"
75 ><A 78 ><A
76 NAME="AEN6262" 79 NAME="AEN6650"
77 ></A 80 ></A
78 ><H2 81 ><H2
79 >Name</H2 82 >Name</H2
80 >SDL_OpenAudio&nbsp;--&nbsp;Opens the audio device with the desired parameters.</DIV 83 >SDL_OpenAudio&nbsp;--&nbsp;Opens the audio device with the desired parameters.</DIV
81 ><DIV 84 ><DIV
82 CLASS="REFSYNOPSISDIV" 85 CLASS="REFSYNOPSISDIV"
83 ><A 86 ><A
84 NAME="AEN6265" 87 NAME="AEN6653"
85 ></A 88 ></A
86 ><H2 89 ><H2
87 >Synopsis</H2 90 >Synopsis</H2
88 ><DIV 91 ><DIV
89 CLASS="FUNCSYNOPSIS" 92 CLASS="FUNCSYNOPSIS"
90 ><A 93 ><A
91 NAME="AEN6266" 94 NAME="AEN6654"
92 ></A 95 ></A
93 ><P 96 ><P
94 ></P 97 ></P
95 ><PRE 98 ><PRE
96 CLASS="FUNCSYNOPSISINFO" 99 CLASS="FUNCSYNOPSISINFO"
110 ></DIV 113 ></DIV
111 ></DIV 114 ></DIV
112 ><DIV 115 ><DIV
113 CLASS="REFSECT1" 116 CLASS="REFSECT1"
114 ><A 117 ><A
115 NAME="AEN6272" 118 NAME="AEN6660"
116 ></A 119 ></A
117 ><H2 120 ><H2
118 >Description</H2 121 >Description</H2
119 ><P 122 ><P
120 >This function opens the audio device with the <TT 123 >This function opens the audio device with the <TT
155 <PRE 158 <PRE
156 CLASS="PROGRAMLISTING" 159 CLASS="PROGRAMLISTING"
157 >SDL_AudioSpec *desired; 160 >SDL_AudioSpec *desired;
158 . 161 .
159 . 162 .
160 desired=(SDL_AudioSpec *)malloc(sizeof(SDL_AudioSpec));</PRE 163 desired = malloc(sizeof(SDL_AudioSpec));</PRE
161 > 164 >
162 You must then fill this structure with your desired audio specifications.</P 165 You must then fill this structure with your desired audio specifications.</P
163 ><P 166 ><P
164 ></P 167 ></P
165 ><DIV 168 ><DIV
416 > of the audio buffer, you should allocate any local mixing buffers after you open the audio device.</P 419 > of the audio buffer, you should allocate any local mixing buffers after you open the audio device.</P
417 ></DIV 420 ></DIV
418 ><DIV 421 ><DIV
419 CLASS="REFSECT1" 422 CLASS="REFSECT1"
420 ><A 423 ><A
421 NAME="AEN6359" 424 NAME="AEN6747"
422 ></A 425 ></A
423 ><H2 426 ><H2
424 >Examples</H2 427 >Examples</H2
425 ><PRE 428 ><PRE
426 CLASS="PROGRAMLISTING" 429 CLASS="PROGRAMLISTING"
430 /* Open the audio device */ 433 /* Open the audio device */
431 SDL_AudioSpec *desired, *obtained; 434 SDL_AudioSpec *desired, *obtained;
432 SDL_AudioSpec *hardware_spec; 435 SDL_AudioSpec *hardware_spec;
433 436
434 /* Allocate a desired SDL_AudioSpec */ 437 /* Allocate a desired SDL_AudioSpec */
435 desired=(SDL_AudioSpec *)malloc(sizeof(SDL_AudioSpec)); 438 desired = malloc(sizeof(SDL_AudioSpec));
436 439
437 /* Allocate space for the obtained SDL_AudioSpec */ 440 /* Allocate space for the obtained SDL_AudioSpec */
438 obtained=(SDL_AudioSpec *)malloc(sizeof(SDL_AudioSpec)); 441 obtained = malloc(sizeof(SDL_AudioSpec));
439 442
440 /* 22050Hz - FM Radio quality */ 443 /* 22050Hz - FM Radio quality */
441 desired-&#62;freq=22050; 444 desired-&#62;freq=22050;
442 445
443 /* 16-bit signed audio */ 446 /* 16-bit signed audio */
472 SDL_PauseAudio(0);</PRE 475 SDL_PauseAudio(0);</PRE
473 ></DIV 476 ></DIV
474 ><DIV 477 ><DIV
475 CLASS="REFSECT1" 478 CLASS="REFSECT1"
476 ><A 479 ><A
477 NAME="AEN6362" 480 NAME="AEN6750"
478 ></A 481 ></A
479 ><H2 482 ><H2
480 >See Also</H2 483 >See Also</H2
481 ><P 484 ><P
482 ><A 485 ><A
511 ><DIV 514 ><DIV
512 CLASS="NAVFOOTER" 515 CLASS="NAVFOOTER"
513 ><HR 516 ><HR
514 ALIGN="LEFT" 517 ALIGN="LEFT"
515 WIDTH="100%"><TABLE 518 WIDTH="100%"><TABLE
519 SUMMARY="Footer navigation table"
516 WIDTH="100%" 520 WIDTH="100%"
517 BORDER="0" 521 BORDER="0"
518 CELLPADDING="0" 522 CELLPADDING="0"
519 CELLSPACING="0" 523 CELLSPACING="0"
520 ><TR 524 ><TR
522 WIDTH="33%" 526 WIDTH="33%"
523 ALIGN="left" 527 ALIGN="left"
524 VALIGN="top" 528 VALIGN="top"
525 ><A 529 ><A
526 HREF="sdlaudiospec.html" 530 HREF="sdlaudiospec.html"
531 ACCESSKEY="P"
527 >Prev</A 532 >Prev</A
528 ></TD 533 ></TD
529 ><TD 534 ><TD
530 WIDTH="34%" 535 WIDTH="34%"
531 ALIGN="center" 536 ALIGN="center"
532 VALIGN="top" 537 VALIGN="top"
533 ><A 538 ><A
534 HREF="index.html" 539 HREF="index.html"
540 ACCESSKEY="H"
535 >Home</A 541 >Home</A
536 ></TD 542 ></TD
537 ><TD 543 ><TD
538 WIDTH="33%" 544 WIDTH="33%"
539 ALIGN="right" 545 ALIGN="right"
540 VALIGN="top" 546 VALIGN="top"
541 ><A 547 ><A
542 HREF="sdlpauseaudio.html" 548 HREF="sdlpauseaudio.html"
549 ACCESSKEY="N"
543 >Next</A 550 >Next</A
544 ></TD 551 ></TD
545 ></TR 552 ></TR
546 ><TR 553 ><TR
547 ><TD 554 ><TD
553 WIDTH="34%" 560 WIDTH="34%"
554 ALIGN="center" 561 ALIGN="center"
555 VALIGN="top" 562 VALIGN="top"
556 ><A 563 ><A
557 HREF="audio.html" 564 HREF="audio.html"
565 ACCESSKEY="U"
558 >Up</A 566 >Up</A
559 ></TD 567 ></TD
560 ><TD 568 ><TD
561 WIDTH="33%" 569 WIDTH="33%"
562 ALIGN="right" 570 ALIGN="right"