| 1 | <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> |
| 2 | <html> |
| 3 | <head> |
| 4 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
| 5 | <meta name="GENERATOR" content="Mozilla/4.77 [en]C-gatewaynet (Win98; U) [Netscape]"> |
| 6 | <meta name="Author" content="Phil Burk"> |
| 7 | <meta name="Description" content="Tutorial for PortAudio, a cross platform, open-source, audio I/O library.It provides a very simple API for recording and/or playing sound using a simple callback function."> |
| 8 | <meta name="KeyWords" content="audio, tutorial, library, portable, open-source, DirectSound,sound, music, JSyn, synthesis,"> |
| 9 | <title>PortAudio Tutorial</title> |
| 10 | </head> |
| 11 | <body> |
| 12 | |
| 13 | <center><table COLS=1 WIDTH="100%" BGCOLOR="#FADA7A" > |
| 14 | <tr> |
| 15 | <td> |
| 16 | <center> |
| 17 | <h1> |
| 18 | PortAudio Tutorial</h1></center> |
| 19 | </td> |
| 20 | </tr> |
| 21 | </table></center> |
| 22 | |
| 23 | <h2> |
| 24 | Compiling for Windows (WMME or DirectSound)</h2> |
| 25 | |
| 26 | <blockquote>To compile PortAudio for Windows, you can choose between two |
| 27 | options. One implementation uses the DirectSound API. The other uses the |
| 28 | Windows MultiMedia Extensions API (aka WMME or WAVE). |
| 29 | <p>Some advantages of using DirectSound are that DirectSound may have lower |
| 30 | latency than WMME, and supports effects processing plugins. But one disadvantage |
| 31 | is that DirectSound is not installed on all PCs, and is not well supported |
| 32 | under Windows NT. So WMME is the best choice for most projects. |
| 33 | <p>For either implementation add the following source files to your project: |
| 34 | <blockquote> |
| 35 | <pre><b>pa_common\pa_lib.c |
| 36 | pa_common\portaudio.h |
| 37 | pa_common\pa_host.h</b></pre> |
| 38 | </blockquote> |
| 39 | Link with the system library "<b>winmm.lib</b>". For Visual C++: |
| 40 | <ol> |
| 41 | <li> |
| 42 | select "Settings..." from the "Project" menu,</li> |
| 43 | |
| 44 | <li> |
| 45 | select the project name in the tree on the left,</li> |
| 46 | |
| 47 | <li> |
| 48 | choose "All Configurations" in the popup menu above the tree,</li> |
| 49 | |
| 50 | <li> |
| 51 | select the "Link" tab,</li> |
| 52 | |
| 53 | <li> |
| 54 | enter "winmm.lib", without quotes, as the first item in the "Object/library |
| 55 | modules:" field.</li> |
| 56 | </ol> |
| 57 | <b>WMME</b> - To use the WMME implementation, add the following source |
| 58 | files to your project: |
| 59 | <blockquote><b><tt>pa_win_wmme/pa_win_wmme.c</tt></b></blockquote> |
| 60 | <b>DirectSound</b> - If you want to use the DirectSound implementation |
| 61 | of PortAudio then you must have a recent copy of the free |
| 62 | <a href="http://www.microsoft.com/directx/download.asp">DirectX</a> |
| 63 | SDK for Developers from Microsoft installed on your computer. To compile |
| 64 | an application add the following source files to your project: |
| 65 | <blockquote> |
| 66 | <pre><b>pa_win_ds\dsound_wrapper.c |
| 67 | pa_win_ds\pa_dsound.c</b></pre> |
| 68 | </blockquote> |
| 69 | Link with the system library "<b>dsound.lib</b>" using the procedure described |
| 70 | above for "winmm.lib".</blockquote> |
| 71 | |
| 72 | <blockquote>You might try compiling the "pa_tests\patest_saw.c" file first |
| 73 | because it is the simplest.</blockquote> |
| 74 | <font size=+2><a href="http://www.portaudio.com/">home</a> | |
| 75 | <a href="pa_tutorial.html">contents</a> |
| 76 | | <a href="pa_tut_over.html">previous</a> | <a href="pa_tut_callback.html">next</a></font> |
| 77 | </body> |
| 78 | </html> |