├── .gitignore ├── Bin ├── OSX │ └── libportaudio.2.dylib ├── README.md ├── x64 │ └── portaudio_x64.dll └── x86 │ └── portaudio_x86.dll ├── Documentation └── html │ ├── License.html │ ├── annotated.html │ ├── api_overview.html │ ├── bc_s.png │ ├── bdwn.png │ ├── blocking_read_write.html │ ├── classScopedPaHandler.html │ ├── classSine.html │ ├── classes.html │ ├── closed.png │ ├── compile_cmake.html │ ├── compile_linux.html │ ├── compile_mac_coreaudio.html │ ├── compile_windows.html │ ├── compile_windows_asio_msvc.html │ ├── compile_windows_mingw.html │ ├── deprecated.html │ ├── dir_d28a4824dc47e487b107a5db32ef43c4.html │ ├── dir_d44c64559bbebec7f509842c48db8b23.html │ ├── doxygen.css │ ├── doxygen.png │ ├── dynsections.js │ ├── exploring.html │ ├── files.html │ ├── ftv2blank.png │ ├── ftv2cl.png │ ├── ftv2doc.png │ ├── ftv2folderclosed.png │ ├── ftv2folderopen.png │ ├── ftv2lastnode.png │ ├── ftv2link.png │ ├── ftv2mlastnode.png │ ├── ftv2mnode.png │ ├── ftv2mo.png │ ├── ftv2node.png │ ├── ftv2ns.png │ ├── ftv2plastnode.png │ ├── ftv2pnode.png │ ├── ftv2splitbar.png │ ├── ftv2vertline.png │ ├── functions.html │ ├── functions_vars.html │ ├── globals.html │ ├── globals_defs.html │ ├── globals_enum.html │ ├── globals_eval.html │ ├── globals_func.html │ ├── globals_type.html │ ├── group__examples__src.html │ ├── group__public__header.html │ ├── index.html │ ├── initializing_portaudio.html │ ├── jquery.js │ ├── modules.html │ ├── nav_f.png │ ├── nav_g.png │ ├── nav_h.png │ ├── open.png │ ├── open_default_stream.html │ ├── pa__asio_8h.html │ ├── pa__asio_8h_source.html │ ├── pa__devs_8c.html │ ├── pa__devs_8c_source.html │ ├── pa__fuzz_8c.html │ ├── pa__fuzz_8c_source.html │ ├── pa__jack_8h.html │ ├── pa__jack_8h_source.html │ ├── pa__linux__alsa_8h.html │ ├── pa__linux__alsa_8h_source.html │ ├── pa__mac__core_8h.html │ ├── pa__mac__core_8h_source.html │ ├── pa__win__ds_8h.html │ ├── pa__win__ds_8h_source.html │ ├── pa__win__wasapi_8h.html │ ├── pa__win__wasapi_8h_source.html │ ├── pa__win__waveformat_8h.html │ ├── pa__win__waveformat_8h_source.html │ ├── pa__win__wdmks_8h.html │ ├── pa__win__wdmks_8h_source.html │ ├── pa__win__wmme_8h.html │ ├── pa__win__wmme_8h_source.html │ ├── paex__mono__asio__channel__select_8c.html │ ├── paex__mono__asio__channel__select_8c_source.html │ ├── paex__ocean__shore_8c.html │ ├── paex__ocean__shore_8c_source.html │ ├── paex__pink_8c.html │ ├── paex__pink_8c_source.html │ ├── paex__read__write__wire_8c.html │ ├── paex__read__write__wire_8c_source.html │ ├── paex__record_8c.html │ ├── paex__record_8c_source.html │ ├── paex__record__file_8c.html │ ├── paex__record__file_8c_source.html │ ├── paex__saw_8c.html │ ├── paex__saw_8c_source.html │ ├── paex__sine_8c.html │ ├── paex__sine_8c_source.html │ ├── paex__sine__c_09_09_8cpp_source.html │ ├── paex__wmme__ac3_8c.html │ ├── paex__wmme__ac3_8c_source.html │ ├── paex__wmme__surround_8c.html │ ├── paex__wmme__surround_8c_source.html │ ├── paex__write__sine_8c.html │ ├── paex__write__sine_8c_source.html │ ├── paex__write__sine__nonint_8c.html │ ├── paex__write__sine__nonint_8c_source.html │ ├── pages.html │ ├── portaudio-external-architecture-diagram.png │ ├── portaudio_8h.html │ ├── portaudio_8h_source.html │ ├── querying_devices.html │ ├── start_stop_abort.html │ ├── structBiQuad.html │ ├── structOceanWave.html │ ├── structPaAlsaStreamInfo.html │ ├── structPaAsioStreamInfo.html │ ├── structPaDeviceInfo.html │ ├── structPaHostApiInfo.html │ ├── structPaHostErrorInfo.html │ ├── structPaMacCoreStreamInfo.html │ ├── structPaStreamCallbackTimeInfo.html │ ├── structPaStreamInfo.html │ ├── structPaStreamParameters.html │ ├── structPaVersionInfo.html │ ├── structPaWDMKSDirectionSpecificStreamInfo.html │ ├── structPaWDMKSSpecificStreamInfo.html │ ├── structPaWasapiJackDescription.html │ ├── structPaWasapiStreamInfo.html │ ├── structPaWinDirectSoundStreamInfo.html │ ├── structPaWinMmeDeviceAndChannelCount.html │ ├── structPaWinMmeStreamInfo.html │ ├── structPaWinWDMKSDeviceInfo.html │ ├── structPaWinWDMKSInfo.html │ ├── structPaWinWaveFormat.html │ ├── structPinkNoise.html │ ├── structpaTestData.html │ ├── sync_off.png │ ├── sync_on.png │ ├── tab_a.png │ ├── tab_b.png │ ├── tab_h.png │ ├── tab_s.png │ ├── tabs.css │ ├── terminating_portaudio.html │ ├── tutorial_start.html │ ├── utility_functions.html │ └── writing_a_callback.html ├── Examples ├── pa_devs │ ├── Project1.dpr │ ├── Project1.dproj │ └── Project1.res ├── paex_basic │ ├── Project1.dpr │ ├── Project1.dproj │ └── Project1.res ├── paex_saw │ ├── Project1.dpr │ ├── Project1.dproj │ └── Project1.res └── paex_sine │ ├── Project1.dpr │ ├── Project1.dproj │ └── Project1.res ├── Include └── portaudio.pas └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Uncomment these types if you want even more clean repository. But be careful. 2 | # It can make harm to an existing project source. Read explanations below. 3 | # 4 | # Resource files are binaries containing manifest, project icon and version info. 5 | # They can not be viewed as text or compared by diff-tools. Consider replacing them with .rc files. 6 | #*.res 7 | # 8 | # Type library file (binary). In old Delphi versions it should be stored. 9 | # Since Delphi 2009 it is produced from .ridl file and can safely be ignored. 10 | #*.tlb 11 | # 12 | # Diagram Portfolio file. Used by the diagram editor up to Delphi 7. 13 | # Uncomment this if you are not using diagrams or use newer Delphi version. 14 | #*.ddp 15 | # 16 | # Visual LiveBindings file. Added in Delphi XE2. 17 | # Uncomment this if you are not using LiveBindings Designer. 18 | #*.vlb 19 | # 20 | # Deployment Manager configuration file for your project. Added in Delphi XE2. 21 | # Uncomment this if it is not mobile development and you do not use remote debug feature. 22 | #*.deployproj 23 | # 24 | # C++ object files produced when C/C++ Output file generation is configured. 25 | # Uncomment this if you are not using external objects (zlib library for example). 26 | #*.obj 27 | # 28 | 29 | # Delphi compiler-generated binaries (safe to delete) 30 | *.exe 31 | *.dll 32 | *.bpl 33 | *.bpi 34 | *.dcp 35 | *.so 36 | *.apk 37 | *.drc 38 | *.map 39 | *.dres 40 | *.rsm 41 | *.tds 42 | *.dcu 43 | *.lib 44 | *.a 45 | *.o 46 | *.ocx 47 | 48 | # Delphi autogenerated files (duplicated info) 49 | *.cfg 50 | *.hpp 51 | *Resource.rc 52 | 53 | # Delphi local files (user-specific info) 54 | *.local 55 | *.identcache 56 | *.projdata 57 | *.tvsconfig 58 | *.dsk 59 | 60 | # Delphi history and backups 61 | __history/ 62 | __recovery/ 63 | *.~* 64 | 65 | # Castalia statistics file (since XE7 Castalia is distributed with Delphi) 66 | *.stat 67 | 68 | 69 | !/Bin/**/* -------------------------------------------------------------------------------- /Bin/OSX/libportaudio.2.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DelphiForBroadcasting/portaudio-delphi/de957923e704f1466dbab1ccdcad6906ec6f6901/Bin/OSX/libportaudio.2.dylib -------------------------------------------------------------------------------- /Bin/README.md: -------------------------------------------------------------------------------- 1 | PortAudio binaries 2 | ================== 3 | Git clone from [portaudio-binaries](https://github.com/spatialaudio/portaudio-binaries) 4 | 5 | This repository provides pre-compiled dynamic libraries for 6 | [PortAudio](http://www.portaudio.com/). 7 | 8 | 9 | DLLs for Windows (32-bit and 64-bit) 10 | ------------------------------------ 11 | 12 | The DLLs include all available host APIs, namely WMME, DirectSound, WDM/KS, 13 | WASAPI and ASIO. For more informaton about the ASIO SDK see 14 | http://www.steinberg.net/en/company/developers.html. 15 | 16 | The DLLs were created on a Debian GNU/Linux system using [MXE](http://mxe.cc/) 17 | ([this version](https://github.com/mxe/mxe/tree/87b08fae68f5e45263d1bb71e8061700d86e3c8c), using `pa_stable_v190600_20161030.tgz`) 18 | with the following commands (after installing the 19 | [dependencies](http://mxe.cc/#requirements)): 20 | 21 | git clone https://github.com/mxe/mxe.git 22 | wget http://www.steinberg.net/sdk_downloads/asiosdk2.3.zip 23 | export PATH=$(pwd)"/mxe/usr/bin:$PATH" 24 | 25 | Open the file `mxe/src/portaudio.mk` and change 26 | `--with-winapi=wmme,directx,wdmks,wasapi` to 27 | `--with-winapi=wmme,directx,wdmks,wasapi,asio` (and make sure to keep the 28 | backslash at the end of the line). 29 | To the first line starting with "$(MAKE)", append " EXAMPLES= SELFTESTS=" (without the quotes). 30 | Delete the 4 lines before the last line (i.e. keep the line with "endef"). 31 | After saving your changes, please continue: 32 | 33 | for TARGET in x86_64-w64-mingw32.static i686-w64-mingw32.static 34 | do 35 | unzip asiosdk2.3.zip 36 | # You'll need write access in /usr/local for this: 37 | mv ASIOSDK2.3 /usr/local/asiosdk2 38 | # If it doesn't work, prepend "sudo " to the previous command 39 | make -C mxe portaudio MXE_TARGETS=$TARGET 40 | $TARGET-gcc -O2 -shared -o libportaudio-$TARGET.dll -Wl,--whole-archive -lportaudio -Wl,--no-whole-archive -lstdc++ -lwinmm -lole32 -lsetupapi 41 | $TARGET-strip libportaudio-$TARGET.dll 42 | chmod -x libportaudio-$TARGET.dll 43 | # again, you'll probably have to use "sudo": 44 | rm -r /usr/local/asiosdk2 45 | done 46 | 47 | mv libportaudio-x86_64-w64-mingw32.static.dll libportaudio64bit.dll 48 | mv libportaudio-i686-w64-mingw32.static.dll libportaudio32bit.dll 49 | 50 | A different set of DLLs (compiled with Visual Studio) is available at 51 | https://github.com/adfernandes/precompiled-portaudio-windows. 52 | 53 | dylib for Mac OS X (64-bit) 54 | --------------------------- 55 | 56 | The dylib was created on a Mac OS X system using XCode. 57 | The XCode CLI tools were installed with: 58 | 59 | xcode-select --install 60 | 61 | The following commands were used for compilation: 62 | 63 | curl -O http://www.portaudio.com/archives/pa_stable_v190600_20161030.tgz 64 | tar xvf pa_stable_v190600_20161030.tgz 65 | cd portaudio 66 | # in configure: replace "-Werror" (just search for it) with "-DNDEBUG" 67 | ./configure --disable-mac-universal MACOSX_DEPLOYMENT_TARGET=10.6 68 | make 69 | cd .. 70 | cp portaudio/lib/.libs/libportaudio.2.dylib libportaudio.dylib 71 | 72 | Copyright 73 | --------- 74 | 75 | * PortAudio by Ross Bencina and Phil Burk, MIT License. 76 | 77 | * Steinberg Audio Stream I/O API by Steinberg Media Technologies GmbH. -------------------------------------------------------------------------------- /Bin/x64/portaudio_x64.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DelphiForBroadcasting/portaudio-delphi/de957923e704f1466dbab1ccdcad6906ec6f6901/Bin/x64/portaudio_x64.dll -------------------------------------------------------------------------------- /Bin/x86/portaudio_x86.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DelphiForBroadcasting/portaudio-delphi/de957923e704f1466dbab1ccdcad6906ec6f6901/Bin/x86/portaudio_x86.dll -------------------------------------------------------------------------------- /Documentation/html/License.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PortAudio: PortAudio License 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 23 | 24 | 25 |
19 |
PortAudio 20 |  2.0 21 |
22 |
26 |
27 | 28 | 29 | 38 |
39 |
40 |
41 |
PortAudio License
42 |
43 |
44 |

PortAudio Portable Real-Time Audio Library
45 | Copyright (c) 1999-2011 Ross Bencina, Phil Burk

46 |

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

47 |

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

48 |

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

49 |


50 |

51 |

The text above constitutes the entire PortAudio license; however, the PortAudio community also makes the following non-binding requests:

52 |

Any person wishing to distribute modifications to the Software is requested to send the modifications to the original developer so that they can be incorporated into the canonical version. It is also requested that these non-binding requests be included along with the license above.

53 |
54 | 55 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /Documentation/html/bc_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DelphiForBroadcasting/portaudio-delphi/de957923e704f1466dbab1ccdcad6906ec6f6901/Documentation/html/bc_s.png -------------------------------------------------------------------------------- /Documentation/html/bdwn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DelphiForBroadcasting/portaudio-delphi/de957923e704f1466dbab1ccdcad6906ec6f6901/Documentation/html/bdwn.png -------------------------------------------------------------------------------- /Documentation/html/classScopedPaHandler.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PortAudio: ScopedPaHandler Class Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 23 | 24 | 25 |
19 |
PortAudio 20 |  2.0 21 |
22 |
26 |
27 | 28 | 29 | 38 | 44 |
45 |
46 |
47 | Public Member Functions
48 |
49 |
ScopedPaHandler Class Reference
50 |
51 |
52 | 53 | 55 | 57 | 58 |

54 | Public Member Functions

56 | PaError result () const
 
59 |

Detailed Description

60 |
61 |

Definition at line 221 of file paex_sine_c++.cpp.

62 |

The documentation for this class was generated from the following file: 65 |
66 | 67 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /Documentation/html/classSine.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PortAudio: Sine Class Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 23 | 24 | 25 |
19 |
PortAudio 20 |  2.0 21 |
22 |
26 |
27 | 28 | 29 | 38 | 44 |
45 |
46 |
47 | Public Member Functions
48 |
49 |
Sine Class Reference
50 |
51 |
52 | 53 | 55 | 57 | 58 | 60 | 61 | 63 | 64 | 66 | 67 |

54 | Public Member Functions

56 | bool open (PaDeviceIndex index)
 
59 | bool close ()
 
62 | bool start ()
 
65 | bool stop ()
 
68 |

Detailed Description

69 |
70 |

Definition at line 58 of file paex_sine_c++.cpp.

71 |

The documentation for this class was generated from the following file: 74 |
75 | 76 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /Documentation/html/classes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PortAudio: Data Structure Index 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 23 | 24 | 25 |
19 |
PortAudio 20 |  2.0 21 |
22 |
26 |
27 | 28 | 29 | 38 | 44 |
45 |
46 |
47 |
Data Structure Index
48 |
49 |
50 |
B | O | P | S
51 | 52 | 55 | 56 | 57 | 59 | 60 | 61 | 63 | 64 | 65 | 66 |
  B  
53 |
PaAsioStreamInfo   PaStreamParameters   PaWinDirectSoundStreamInfo   
  S  
54 |
PaDeviceInfo   paTestData   PaWinMmeDeviceAndChannelCount   
BiQuad   PaHostApiInfo   PaVersionInfo   PaWinMmeStreamInfo   ScopedPaHandler   
  O  
58 |
PaHostErrorInfo   PaWasapiJackDescription   PaWinWaveFormat   Sine   
PaMacCoreStreamInfo   PaWasapiStreamInfo   PaWinWDMKSDeviceInfo   
OceanWave   PaStreamCallbackTimeInfo   PaWDMKSDirectionSpecificStreamInfo   PaWinWDMKSInfo   
  P  
62 |
PaStreamInfo   PaWDMKSSpecificStreamInfo   PinkNoise   
PaAlsaStreamInfo   
67 |
B | O | P | S
68 |
69 | 70 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /Documentation/html/closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DelphiForBroadcasting/portaudio-delphi/de957923e704f1466dbab1ccdcad6906ec6f6901/Documentation/html/closed.png -------------------------------------------------------------------------------- /Documentation/html/compile_cmake.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PortAudio: Creating MSVC Build Files via CMake 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 23 | 24 | 25 |
19 |
PortAudio 20 |  2.0 21 |
22 |
26 |
27 | 28 | 29 | 38 |
39 |
40 |
41 |
Creating MSVC Build Files via CMake
42 |
43 |
44 |

This is a simple "How-to" for creating build files for Microsoft Visual C++ via CMake and the CMakeLists.txt file

45 |
    46 |
  1. Install CMake if you haven't got it already ([http://www.cmake.org], minimum version required is 2.8).
  2. 47 |
48 |
    49 |
  1. If you want ASIO support you need to D/L the ASIO2 SDK from Steinberg, and place it according to Building Portaudio for Windows with ASIO support using MSVC
  2. 50 |
51 |
    52 |
  1. Run the CMake GUI application and browse to source files directory and build directory: a. The source files directory ("Where is the source code") is where the portaudio CMakeLists.txt file is located. b. The build directory ("Where to build the binaries") is pretty much anywhere you like. A common practice though is to have the build directory located outside the source files tree (a so called "out-of-source build")
  2. 53 |
54 |
    55 |
  1. Click Configure. This will prompt you to select which build files to generate. Note Only Microsoft Visual C++ build files currently supported!
  2. 56 |
57 |
    58 |
  1. In the CMake option list, enable the PORTAUDIO_xxx options you need, then click Configure again (Note that after this there are no options marked with red color)
  2. 59 |
60 |
    61 |
  1. Click Generate and you'll now (hopefully) have your VS build files in your previously defined build directory.
  2. 62 |
63 |

Both ASIO and DirectX SDK are automatically searched for by the CMake script, so if you have DirectX SDK installed and have placed the ASIO2 SDK according to point 2 above, you should be able to build portaudio with !DirectSound and ASIO support.

64 |

Should you later on decide to change a portaudio option, just jump in at step 5 above (MSVC will then prompt you to reload projects/solutions/workspace)

65 |

— Robert Bielik

66 |

Back to the Tutorial: PortAudio Tutorials

67 |
68 | 69 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /Documentation/html/compile_linux.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PortAudio: Building Portaudio for Linux 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 23 | 24 | 25 |
19 |
PortAudio 20 |  2.0 21 |
22 |
26 |
27 | 28 | 29 | 38 |
39 |
40 |
41 |
Building Portaudio for Linux
42 |
43 |
44 |

Note: this page has not been reviewed, and may contain errors.

45 |

46 | Installing ALSA Development Kit

47 |

The OSS sound API is very old and not well supported. It is recommended that you use the ALSA sound API. The PortAudio configure script will look for the ALSA SDK. You can install the ALSA SDK on Ubuntu using:

48 |
sudo apt-get install libasound-dev
49 |

You might need to use yum, or some other package manager, instead of apt-get on your machine. If you do not install ALSA then you might get a message when testing that says you have no audio devices.

50 |

You can find out more about ALSA here: http://www.alsa-project.org/

51 |

52 | Configuring and Compiling PortAudio

53 |

You can build PortAudio in Linux Environments using the standard configure/make tools:

54 |
./configure && make
55 |

That will build PortAudio using Jack, ALSA and OSS in whatever combination they are found on your system. For example, if you have Jack and OSS but not ALSA, it will build using Jack and OSS but not ALSA. This step also builds a number of tests, which can be found in the bin directory of PortAudio. It's a good idea to run some of these tests to make sure PortAudio is working correctly.

56 |

57 | Using PortAudio in your Projects

58 |

To use PortAudio in your apps, you can simply install the .so files:

59 |
sudo make install
60 |

Projects built this way will expect PortAudio to be installed on target systems in order to run. If you want to build a more self-contained binary, you may use the libportaudio.a file:

61 |
cp lib/.libs/libportaudio.a /YOUR/PROJECT/DIR
62 |

On some systems you may need to use:

63 |
cp /usr/local/lib/libportaudio.a /YOUR/PROJECT/DIR
64 |

You may also need to copy portaudio.h, located in the include/ directory of PortAudio into your project. Note that you will usually need to link with the approriate libraries that you used, such as ALSA and JACK, as well as with librt and libpthread. For example:

65 |
gcc main.c libportaudio.a -lrt -lm -lasound -ljack -pthread -o YOUR_BINARY
66 |

67 | Linux Extensions

68 |

Note that the ALSA PortAudio back-end adds a few extensions to the standard API that you may take advantage of. To use these functions be sure to include the pa_linux_alsa.h file found in the include file in the PortAudio folder. This file contains further documentation on the following functions:

69 |

PaAlsaStreamInfo/PaAlsa_InitializeStreamInfo:: Objects of the !PaAlsaStreamInfo type may be used for the !hostApiSpecificStreamInfo attribute of a !PaStreamParameters object, in order to specify the name of an ALSA device to open directly. Specify the device via !PaAlsaStreamInfo.deviceString, after initializing the object with PaAlsa_InitializeStreamInfo.

70 |

PaAlsa_EnableRealtimeScheduling:: PA ALSA supports real-time scheduling of the audio callback thread (using the FIFO pthread scheduling policy), via the extension PaAlsa_EnableRealtimeScheduling. Call this on the stream before starting it with the enableScheduling parameter set to true or false, to enable or disable this behaviour respectively.

71 |

PaAlsa_GetStreamInputCard:: Use this function to get the ALSA-lib card index of the stream's input device.

72 |

PaAlsa_GetStreamOutputCard:: Use this function to get the ALSA-lib card index of the stream's output device.

73 |

Of particular importance is PaAlsa_EnableRealtimeScheduling, which allows ALSA to run at a high priority to prevent ordinary processes on the system from preempting audio playback. Without this, low latency audio playback will be irregular and will contain frequent drop-outs.

74 |

75 | Linux Debugging

76 |

Eliot Blennerhassett writes:

77 |

On linux build, use e.g. "libtool gdb bin/patest_sine8" to debug that program. This is because on linux bin/patest_sine8 is a libtool shell script that wraps bin/.libs/patest_sine8 and allows it to find the appropriate libraries within the build tree.

78 |
79 | 80 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /Documentation/html/compile_windows_mingw.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PortAudio: Building Portaudio for Windows with MinGW 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 23 | 24 | 25 |
19 |
PortAudio 20 |  2.0 21 |
22 |
26 |
27 | 28 | 29 | 38 |
39 |
40 |
41 |
Building Portaudio for Windows with MinGW
42 |
43 |
44 |

45 | Portaudio for Windows With MinGW

46 |

This document contains old or out-of-date information. Please see a draft of new MinGW information on our Wiki: PortAudio Wiki: Notes about building PortAudio with MinGW

47 |

= MinGW/MSYS =

48 |

From the [http://www.mingw.org MinGW projectpage]:

49 |

MinGW: A collection of freely available and freely distributable Windows specific header files and import libraries, augmenting the GNU Compiler Collection, (GCC), and its associated tools, (GNU binutils). MinGW provides a complete Open Source programming tool set which is suitable for the development of native Windows programs that do not depend on any 3rd-party C runtime DLLs.

50 |

MSYS: A Minimal SYStem providing a POSIX compatible Bourne shell environment, with a small collection of UNIX command line tools. Primarily developed as a means to execute the configure scripts and Makefiles used to build Open Source software, but also useful as a general purpose command line interface to replace Windows cmd.exe.

51 |

MinGW provides a compiler/linker toolchain while MSYS is required to actually run the PortAudio configure script.

52 |

Once MinGW and MSYS are installed (see the [http://www.mingw.org/MinGWiki MinGW-Wiki]) open an MSYS shell and run the famous:

53 |
./configure
54 |
make
55 |
make install
56 |

The above should create a working version though you might want to provide '–prefix=<path-to-install-dir>' to configure.

57 |

'./configure –help' gives details as to what can be tinkered with.

58 |

— Mikael Magnusson

59 |

To update your copy or check out a fresh copy of the source

60 |

[wiki:UsingThePortAudioSvnRepository SVN instructions]

61 |

— Bob !McGwier

62 |

Back to the Tutorial: PortAudio Tutorials

63 |
64 | 65 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /Documentation/html/deprecated.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PortAudio: Deprecated List 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 23 | 24 | 25 |
19 |
PortAudio 20 |  2.0 21 |
22 |
26 |
27 | 28 | 29 | 38 |
39 |
40 |
41 |
Deprecated List
42 |
43 |
44 |
45 |
Global Pa_GetVersionText (void)
46 |
As of 19.5.0, use Pa_GetVersionInfo()->versionText instead.
47 |
48 |
49 | 50 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /Documentation/html/doxygen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DelphiForBroadcasting/portaudio-delphi/de957923e704f1466dbab1ccdcad6906ec6f6901/Documentation/html/doxygen.png -------------------------------------------------------------------------------- /Documentation/html/dynsections.js: -------------------------------------------------------------------------------- 1 | function toggleVisibility(linkObj) 2 | { 3 | var base = $(linkObj).attr('id'); 4 | var summary = $('#'+base+'-summary'); 5 | var content = $('#'+base+'-content'); 6 | var trigger = $('#'+base+'-trigger'); 7 | var src=$(trigger).attr('src'); 8 | if (content.is(':visible')===true) { 9 | content.hide(); 10 | summary.show(); 11 | $(linkObj).addClass('closed').removeClass('opened'); 12 | $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png'); 13 | } else { 14 | content.show(); 15 | summary.hide(); 16 | $(linkObj).removeClass('closed').addClass('opened'); 17 | $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); 18 | } 19 | return false; 20 | } 21 | 22 | function updateStripes() 23 | { 24 | $('table.directory tr'). 25 | removeClass('even').filter(':visible:even').addClass('even'); 26 | } 27 | function toggleLevel(level) 28 | { 29 | $('table.directory tr').each(function(){ 30 | var l = this.id.split('_').length-1; 31 | var i = $('#img'+this.id.substring(3)); 32 | var a = $('#arr'+this.id.substring(3)); 33 | if (l 2 | 3 | 4 | 5 | 6 | PortAudio: Exploring PortAudio 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 23 | 24 | 25 |
19 |
PortAudio 20 |  2.0 21 |
22 |
26 |
27 | 28 | 29 | 38 |
39 |
40 |
41 |
Exploring PortAudio
42 |
43 |
44 |

Now that you have a good idea of how PortAudio works, you can try out the example programs. You'll find them in the examples/ directory in the PortAudio distribution.

45 |

For an example of playing a sine wave, see examples/paex_sine.c.

46 |

For an example of recording and playing back a sound, see examples/paex_record.c.

47 |

I also encourage you to examine the source for the PortAudio libraries. If you have suggestions on ways to improve them, please let us know. If you want to implement PortAudio on a new platform, please let us know as well so we can coordinate people's efforts.

48 |

Previous: Blocking Read/Write Functions | Next: This is the end of the tutorial.

49 |
50 | 51 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /Documentation/html/ftv2blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DelphiForBroadcasting/portaudio-delphi/de957923e704f1466dbab1ccdcad6906ec6f6901/Documentation/html/ftv2blank.png -------------------------------------------------------------------------------- /Documentation/html/ftv2cl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DelphiForBroadcasting/portaudio-delphi/de957923e704f1466dbab1ccdcad6906ec6f6901/Documentation/html/ftv2cl.png -------------------------------------------------------------------------------- /Documentation/html/ftv2doc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DelphiForBroadcasting/portaudio-delphi/de957923e704f1466dbab1ccdcad6906ec6f6901/Documentation/html/ftv2doc.png -------------------------------------------------------------------------------- /Documentation/html/ftv2folderclosed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DelphiForBroadcasting/portaudio-delphi/de957923e704f1466dbab1ccdcad6906ec6f6901/Documentation/html/ftv2folderclosed.png -------------------------------------------------------------------------------- /Documentation/html/ftv2folderopen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DelphiForBroadcasting/portaudio-delphi/de957923e704f1466dbab1ccdcad6906ec6f6901/Documentation/html/ftv2folderopen.png -------------------------------------------------------------------------------- /Documentation/html/ftv2lastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DelphiForBroadcasting/portaudio-delphi/de957923e704f1466dbab1ccdcad6906ec6f6901/Documentation/html/ftv2lastnode.png -------------------------------------------------------------------------------- /Documentation/html/ftv2link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DelphiForBroadcasting/portaudio-delphi/de957923e704f1466dbab1ccdcad6906ec6f6901/Documentation/html/ftv2link.png -------------------------------------------------------------------------------- /Documentation/html/ftv2mlastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DelphiForBroadcasting/portaudio-delphi/de957923e704f1466dbab1ccdcad6906ec6f6901/Documentation/html/ftv2mlastnode.png -------------------------------------------------------------------------------- /Documentation/html/ftv2mnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DelphiForBroadcasting/portaudio-delphi/de957923e704f1466dbab1ccdcad6906ec6f6901/Documentation/html/ftv2mnode.png -------------------------------------------------------------------------------- /Documentation/html/ftv2mo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DelphiForBroadcasting/portaudio-delphi/de957923e704f1466dbab1ccdcad6906ec6f6901/Documentation/html/ftv2mo.png -------------------------------------------------------------------------------- /Documentation/html/ftv2node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DelphiForBroadcasting/portaudio-delphi/de957923e704f1466dbab1ccdcad6906ec6f6901/Documentation/html/ftv2node.png -------------------------------------------------------------------------------- /Documentation/html/ftv2ns.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DelphiForBroadcasting/portaudio-delphi/de957923e704f1466dbab1ccdcad6906ec6f6901/Documentation/html/ftv2ns.png -------------------------------------------------------------------------------- /Documentation/html/ftv2plastnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DelphiForBroadcasting/portaudio-delphi/de957923e704f1466dbab1ccdcad6906ec6f6901/Documentation/html/ftv2plastnode.png -------------------------------------------------------------------------------- /Documentation/html/ftv2pnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DelphiForBroadcasting/portaudio-delphi/de957923e704f1466dbab1ccdcad6906ec6f6901/Documentation/html/ftv2pnode.png -------------------------------------------------------------------------------- /Documentation/html/ftv2splitbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DelphiForBroadcasting/portaudio-delphi/de957923e704f1466dbab1ccdcad6906ec6f6901/Documentation/html/ftv2splitbar.png -------------------------------------------------------------------------------- /Documentation/html/ftv2vertline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DelphiForBroadcasting/portaudio-delphi/de957923e704f1466dbab1ccdcad6906ec6f6901/Documentation/html/ftv2vertline.png -------------------------------------------------------------------------------- /Documentation/html/globals_enum.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PortAudio: Globals 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 23 | 24 | 25 |
19 |
PortAudio 20 |  2.0 21 |
22 |
26 |
27 | 28 | 29 | 38 | 44 | 54 |
55 |
56 |   76 |
77 | 78 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /Documentation/html/globals_eval.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PortAudio: Globals 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 23 | 24 | 25 |
19 |
PortAudio 20 |  2.0 21 |
22 |
26 |
27 | 28 | 29 | 38 | 44 | 54 |
55 |
56 |   88 |
89 | 90 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /Documentation/html/globals_type.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PortAudio: Globals 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 23 | 24 | 25 |
19 |
PortAudio 20 |  2.0 21 |
22 |
26 |
27 | 28 | 29 | 38 | 44 | 54 |
55 |
56 |   124 |
125 | 126 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /Documentation/html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PortAudio: Main Page 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 23 | 24 | 25 |
19 |
PortAudio 20 |  2.0 21 |
22 |
26 |
27 | 28 | 29 | 38 |
39 |
40 |
41 |
PortAudio Documentation
42 |
43 |
44 |

45 | Overview

46 |

PortAudio is a cross-platform, open-source C language library for real-time audio input and output. The library provides functions that allow your software to acquire and output real-time audio streams from your computer's hardware audio interfaces. It is designed to simplify writing cross-platform audio applications, and also to simplify the development of audio software in general by hiding the complexities of dealing directly with each native audio API. PortAudio is used to implement sound recording, editing and mixing applications, software synthesizers, effects processors, music players, internet telephony applications, software defined radios and more. Supported platforms include MS Windows, Mac OS X and Linux. Third-party language bindings make it possible to call PortAudio from other programming languages including Java, C++, C#, Python, PureBasic, FreePascal and Lazarus.

47 |

48 | Start here

49 |
    50 |
  • PortAudio API Overview
    51 | A top-down view of the PortAudio API, its capabilities, functions and data structures
  • 52 |
53 | 57 |
    58 |
  • Examples
    59 | Simple example programs demonstrating PortAudio usage
  • 60 |
61 |
    62 |
  • PortAudio License
    63 | PortAudio is licenced under the MIT Expat open source licence. We make a non-binding request for you to contribute your changes back to the project.
  • 64 |
65 |

66 | API Reference

67 |
    68 |
  • portaudio.h Portable API
    69 | Detailed documentation for each portable API function and data type
  • 70 |
71 | 75 |

76 | Resources

77 | 80 | 84 | 87 |

88 | Developer Resources

89 | 92 | 95 | 98 |

If you're interested in helping out with PortAudio development we're more than happy for you to be involved. Just drop by the PortAudio mailing list and ask how you can help. Or check out the starter tickets.

99 |

100 | Older API Versions

101 |

This documentation covers the current API version: PortAudio V19, API version 2.0. API 2.0 differs in a number of ways from previous versions (most often encountered in PortAudio V18), please consult the enhancement proposals for details of what was added/changed for V19: http://www.portaudio.com/docs/proposals/index.html

102 |
103 | 104 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /Documentation/html/initializing_portaudio.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PortAudio: Initializing PortAudio 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 23 | 24 | 25 |
19 |
PortAudio 20 |  2.0 21 |
22 |
26 |
27 | 28 | 29 | 38 |
39 |
40 |
41 |
Initializing PortAudio
42 |
43 |
44 |

45 | Initializing PortAudio

46 |

Before making any other calls to PortAudio, you 'must' call Pa_Initialize(). This will trigger a scan of available devices which can be queried later. Like most PA functions, it will return a result of type paError. If the result is not paNoError, then an error has occurred.

47 |
err = Pa_Initialize();
48 |
if( err != paNoError ) goto error;
49 |

You can get a text message that explains the error message by passing it to Pa_GetErrorText( err ). For Example:

50 |
printf( "PortAudio error: %s\n", Pa_GetErrorText( err ) );
51 |

It is also important, when you are done with PortAudio, to Terminate it:

52 |
err = Pa_Terminate();
53 |
if( err != paNoError )
54 |
printf( "PortAudio error: %s\n", Pa_GetErrorText( err ) );
55 |

Previous: Writing a Callback Function | Next: Opening a Stream Using Defaults

56 |
57 | 58 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /Documentation/html/modules.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PortAudio: Modules 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 23 | 24 | 25 |
19 |
PortAudio 20 |  2.0 21 |
22 |
26 |
27 | 28 | 29 | 38 |
39 |
40 |
41 |
Modules
42 |
43 |
44 |
Here is a list of all modules:
50 |
51 | 52 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /Documentation/html/nav_f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DelphiForBroadcasting/portaudio-delphi/de957923e704f1466dbab1ccdcad6906ec6f6901/Documentation/html/nav_f.png -------------------------------------------------------------------------------- /Documentation/html/nav_g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DelphiForBroadcasting/portaudio-delphi/de957923e704f1466dbab1ccdcad6906ec6f6901/Documentation/html/nav_g.png -------------------------------------------------------------------------------- /Documentation/html/nav_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DelphiForBroadcasting/portaudio-delphi/de957923e704f1466dbab1ccdcad6906ec6f6901/Documentation/html/nav_h.png -------------------------------------------------------------------------------- /Documentation/html/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DelphiForBroadcasting/portaudio-delphi/de957923e704f1466dbab1ccdcad6906ec6f6901/Documentation/html/open.png -------------------------------------------------------------------------------- /Documentation/html/open_default_stream.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PortAudio: Opening a Stream Using Defaults 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 23 | 24 | 25 |
19 |
PortAudio 20 |  2.0 21 |
22 |
26 |
27 | 28 | 29 | 38 |
39 |
40 |
41 |
Opening a Stream Using Defaults
42 |
43 |
44 |

The next step is to open a stream, which is similar to opening a file. You can specify whether you want audio input and/or output, how many channels, the data format, sample rate, etc. Opening a ''default'' stream means opening the default input and output devices, which saves you the trouble of getting a list of devices and choosing one from the list. (We'll see how to do that later.)

45 |
#define SAMPLE_RATE (44100)
46 |
static paTestData data;
47 |
48 |
.....
49 |
50 |
PaStream *stream;
51 |
PaError err;
52 |
53 |
/* Open an audio I/O stream. */
54 |
err = Pa_OpenDefaultStream( &stream,
55 |
0, /* no input channels */
56 |
2, /* stereo output */
57 |
paFloat32, /* 32 bit floating point output */
58 |
SAMPLE_RATE,
59 |
256, /* frames per buffer, i.e. the number
60 |
of sample frames that PortAudio will
61 |
request from the callback. Many apps
62 |
may want to use
63 |
paFramesPerBufferUnspecified, which
64 |
tells PortAudio to pick the best,
65 |
possibly changing, buffer size.*/
66 |
patestCallback, /* this is your callback function */
67 |
&data ); /*This is a pointer that will be passed to
68 |
your callback*/
69 |
if( err != paNoError ) goto error;
70 |

The data structure and callback are described in Writing a Callback Function.

71 |

The above example opens the stream for writing, which is sufficient for playback. It is also possible to open a stream for reading, to do recording, or both reading and writing, for simultaneous recording and playback or even real-time audio processing. If you plan to do playback and recording at the same time, open only one stream with valid input and output parameters.

72 |

There are some caveats to note about simultaneous read/write:

73 |
    74 |
  • Some platforms can only open a read/write stream using the same device.
  • 75 |
  • Although multiple streams can be opened, it is difficult to synchronize them.
  • 76 |
  • Some platforms don't support opening multiple streams on the same device.
  • 77 |
  • Using multiple streams may not be as well tested as other features.
  • 78 |
  • The PortAudio library calls must be made from the same thread or synchronized by the user.
  • 79 |
80 |

Previous: Initializing PortAudio | Next: Starting, Stopping and Aborting a Stream

81 |
82 | 83 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /Documentation/html/pa__devs_8c.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PortAudio: pa_devs.c File Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 23 | 24 | 25 |
19 |
PortAudio 20 |  2.0 21 |
22 |
26 |
27 | 28 | 29 | 38 | 44 | 48 |
49 |
50 |
51 | Functions
52 |
53 |
54 |
55 |
56 | 57 |

List available devices, including device information. 58 | More...

59 |
#include <stdio.h>
60 | #include <math.h>
61 | #include "portaudio.h"
62 |
63 |

Go to the source code of this file.

64 | 65 | 67 | 69 | 70 |

66 | Functions

68 | int main (void)
 
71 |

Detailed Description

72 |

List available devices, including device information.

73 |
@author Phil Burk http://www.softsynth.com
74 | 
Note
Define PA_USE_ASIO=0 to compile this code on Windows without ASIO support.
75 | 76 |

Definition in file pa_devs.c.

77 |
78 | 79 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /Documentation/html/pa__jack_8h.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PortAudio: pa_jack.h File Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 23 | 24 | 25 |
19 |
PortAudio 20 |  2.0 21 |
22 |
26 |
27 | 28 | 29 | 38 | 44 | 48 |
49 |
50 |
51 | Functions
52 |
53 |
54 |
55 |
56 | 57 |

JACK-specific PortAudio API extension header file. 58 | More...

59 |
#include "portaudio.h"
60 |
61 |

Go to the source code of this file.

62 | 63 | 65 | 66 | 67 | 68 | 69 |

64 | Functions

PaError PaJack_SetClientName (const char *name)
 
PaError PaJack_GetClientName (const char **clientName)
 
70 |

Detailed Description

71 |

JACK-specific PortAudio API extension header file.

72 | 73 |

Definition in file pa_jack.h.

74 |

Function Documentation

75 | 76 |
77 |
78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 |
PaError PaJack_GetClientName (const char ** clientName)
87 |
88 |

Get the JACK client name used by PA JACK.

89 |

The caller is responsible for freeing the returned pointer.

90 | 91 |
92 |
93 | 94 |
95 |
96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 |
PaError PaJack_SetClientName (const char * name)
105 |
106 |

Set the JACK client name.

107 |

During Pa_Initialize, When PA JACK connects as a client of the JACK server, it requests a certain name, which is for instance prepended to port names. By default this name is "PortAudio". The JACK server may append a suffix to the client name, in order to avoid clashes among clients that try to connect with the same name (e.g., different PA JACK clients).

108 |

This function must be called before Pa_Initialize, otherwise it won't have any effect. Note that the string is not copied, but instead referenced directly, so it must not be freed for as long as PA might need it.

109 |
See Also
PaJack_GetClientName
110 | 111 |
112 |
113 |
114 | 115 | 120 | 121 | 122 | -------------------------------------------------------------------------------- /Documentation/html/pa__win__ds_8h.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PortAudio: pa_win_ds.h File Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 23 | 24 | 25 |
19 |
PortAudio 20 |  2.0 21 |
22 |
26 |
27 | 28 | 29 | 38 | 44 | 48 |
49 |
50 |
51 | Data Structures | 52 | Macros | 53 | Typedefs
54 |
55 |
56 |
57 |
58 | 59 |

DirectSound-specific PortAudio API extension header file. 60 | More...

61 |
#include "portaudio.h"
62 | #include "pa_win_waveformat.h"
63 |
64 |

Go to the source code of this file.

65 | 66 | 68 | 69 | 70 |

67 | Data Structures

struct  PaWinDirectSoundStreamInfo
 
71 | 73 | 75 | 76 | 78 | 79 |

72 | Macros

74 | #define paWinDirectSoundUseLowLevelLatencyParameters   (0x01)
 
77 | #define paWinDirectSoundUseChannelMask   (0x04)
 
80 | 82 | 85 | 86 |

81 | Typedefs

83 | typedef struct
84 | PaWinDirectSoundStreamInfo 
PaWinDirectSoundStreamInfo
 
87 |

Detailed Description

88 |

DirectSound-specific PortAudio API extension header file.

89 | 90 |

Definition in file pa_win_ds.h.

91 |
92 | 93 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /Documentation/html/paex__saw_8c.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PortAudio: paex_saw.c File Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 23 | 24 | 25 |
19 |
PortAudio 20 |  2.0 21 |
22 |
26 |
27 | 28 | 29 | 38 | 44 | 48 |
49 |
50 |
51 | Data Structures | 52 | Macros | 53 | Functions
54 |
55 |
56 |
57 |
58 | 59 |

Play a simple (aliasing) sawtooth wave. 60 | More...

61 |
#include <stdio.h>
62 | #include <math.h>
63 | #include "portaudio.h"
64 |
65 |

Go to the source code of this file.

66 | 67 | 69 | 70 | 71 |

68 | Data Structures

struct  paTestData
 
72 | 74 | 76 | 77 | 79 | 80 |

73 | Macros

75 | #define NUM_SECONDS   (4)
 
78 | #define SAMPLE_RATE   (44100)
 
81 | 83 | 85 | 86 |

82 | Functions

84 | int main (void)
 
87 |

Detailed Description

88 |

Play a simple (aliasing) sawtooth wave.

89 |
Author
Phil Burk http://www.softsynth.com
90 | 91 |

Definition in file paex_saw.c.

92 |
93 | 94 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /Documentation/html/paex__write__sine_8c.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PortAudio: paex_write_sine.c File Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 23 | 24 | 25 |
19 |
PortAudio 20 |  2.0 21 |
22 |
26 |
27 | 28 | 29 | 38 | 44 | 48 |
49 |
50 |
51 | Macros | 52 | Functions
53 |
54 |
paex_write_sine.c File Reference
55 |
56 |
57 | 58 |

Play a sine wave for several seconds using the blocking API (Pa_WriteStream()) 59 | More...

60 |
#include <stdio.h>
61 | #include <math.h>
62 | #include "portaudio.h"
63 |
64 |

Go to the source code of this file.

65 | 66 | 68 | 70 | 71 | 73 | 74 | 76 | 77 | 79 | 80 | 82 | 83 |

67 | Macros

69 | #define NUM_SECONDS   (5)
 
72 | #define SAMPLE_RATE   (44100)
 
75 | #define FRAMES_PER_BUFFER   (1024)
 
78 | #define M_PI   (3.14159265)
 
81 | #define TABLE_SIZE   (200)
 
84 | 86 | 88 | 89 |

85 | Functions

87 | int main (void)
 
90 |

Detailed Description

91 |

Play a sine wave for several seconds using the blocking API (Pa_WriteStream())

92 |
@author Ross Bencina <rossb@audiomulch.com>
 93 | 
Author
Phil Burk philb.nosp@m.urk@.nosp@m.softs.nosp@m.ynth.nosp@m..com
94 | 95 |

Definition in file paex_write_sine.c.

96 |
97 | 98 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /Documentation/html/paex__write__sine__nonint_8c.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PortAudio: paex_write_sine_nonint.c File Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 23 | 24 | 25 |
19 |
PortAudio 20 |  2.0 21 |
22 |
26 |
27 | 28 | 29 | 38 | 44 | 48 |
49 |
50 |
51 | Macros | 52 | Functions
53 |
54 |
paex_write_sine_nonint.c File Reference
55 |
56 |
57 | 58 |

Play a non-interleaved sine wave using the blocking API (Pa_WriteStream()) 59 | More...

60 |
#include <stdio.h>
61 | #include <math.h>
62 | #include "portaudio.h"
63 |
64 |

Go to the source code of this file.

65 | 66 | 68 | 70 | 71 | 73 | 74 | 76 | 77 | 79 | 80 | 82 | 83 |

67 | Macros

69 | #define NUM_SECONDS   (5)
 
72 | #define SAMPLE_RATE   (44100)
 
75 | #define FRAMES_PER_BUFFER   (1024)
 
78 | #define M_PI   (3.14159265)
 
81 | #define TABLE_SIZE   (200)
 
84 | 86 | 88 | 89 |

85 | Functions

87 | int main (void)
 
90 |

Detailed Description

91 |

Play a non-interleaved sine wave using the blocking API (Pa_WriteStream())

92 |
@author Ross Bencina <rossb@audiomulch.com>
 93 | 
Author
Phil Burk philb.nosp@m.urk@.nosp@m.softs.nosp@m.ynth.nosp@m..com
94 | 95 |

Definition in file paex_write_sine_nonint.c.

96 |
97 | 98 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /Documentation/html/pages.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PortAudio: Related Pages 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 23 | 24 | 25 |
19 |
PortAudio 20 |  2.0 21 |
22 |
26 |
27 | 28 | 29 | 38 |
39 |
40 |
41 |
Related Pages
42 |
43 |
44 |
Here is a list of all related documentation pages:
67 |
68 | 69 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /Documentation/html/portaudio-external-architecture-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DelphiForBroadcasting/portaudio-delphi/de957923e704f1466dbab1ccdcad6906ec6f6901/Documentation/html/portaudio-external-architecture-diagram.png -------------------------------------------------------------------------------- /Documentation/html/start_stop_abort.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PortAudio: Starting, Stopping and Aborting a Stream 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 23 | 24 | 25 |
19 |
PortAudio 20 |  2.0 21 |
22 |
26 |
27 | 28 | 29 | 38 |
39 |
40 |
41 |
Starting, Stopping and Aborting a Stream
42 |
43 |
44 |

45 | Starting, Stopping and Aborting a Stream

46 |

PortAudio will not start playing back audio until you start the stream. After calling Pa_StartStream(), PortAudio will start calling your callback function to perform the audio processing.

47 |
err = Pa_StartStream( stream );
48 |
if( err != paNoError ) goto error;
49 |

You can communicate with your callback routine through the data structure you passed in on the open call, or through global variables, or using other interprocess communication techniques, but please be aware that your callback function may be called at interrupt time when your foreground process is least expecting it. So avoid sharing complex data structures that are easily corrupted like double linked lists, and avoid using locks such as mutexs as this may cause your callback function to block and therefore drop audio. Such techniques may even cause deadlock on some platforms.

50 |

PortAudio will continue to call your callback and process audio until you stop the stream. This can be done in one of several ways, but, before we do so, we'll want to see that some of our audio gets processed by sleeping for a few seconds. This is easy to do with Pa_Sleep(), which is used by many of the examples in the patests/ directory for exactly this purpose. Note that, for a variety of reasons, you can not rely on this function for accurate scheduling, so your stream may not run for exactly the same amount of time as you expect, but it's good enough for our example.

51 |
/* Sleep for several seconds. */
52 |
Pa_Sleep(NUM_SECONDS*1000);
53 |

Now we need to stop playback. There are several ways to do this, the simplest of which is to call Pa_StopStream():

54 |
err = Pa_StopStream( stream );
55 |
if( err != paNoError ) goto error;
56 |

Pa_StopStream() is designed to make sure that the buffers you've processed in your callback are all played, which may cause some delay. Alternatively, you could call Pa_AbortStream(). On some platforms, aborting the stream is much faster and may cause some data processed by your callback not to be played.

57 |

Another way to stop the stream is to return either paComplete, or paAbort from your callback. paComplete ensures that the last buffer is played whereas paAbort stops the stream as soon as possible. If you stop the stream using this technique, you will need to call Pa_StopStream() before starting the stream again.

58 |

Previous: Opening a Stream Using Defaults | Next: Closing a Stream and Terminating PortAudio

59 |
60 | 61 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /Documentation/html/structBiQuad.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PortAudio: BiQuad Struct Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 23 | 24 | 25 |
19 |
PortAudio 20 |  2.0 21 |
22 |
26 |
27 | 28 | 29 | 38 | 44 |
45 |
46 | 48 |
49 |
BiQuad Struct Reference
50 |
51 |
52 | 53 | 55 | 57 | 58 | 60 | 61 | 63 | 64 | 66 | 67 | 69 | 70 |

54 | Data Fields

56 | float bq_b0
 
59 | float bq_b1
 
62 | float bq_b2
 
65 | float bq_a1
 
68 | float bq_a2
 
71 |

Detailed Description

72 |
73 |

Definition at line 83 of file paex_ocean_shore.c.

74 |

The documentation for this struct was generated from the following file: 77 |
78 | 79 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /Documentation/html/structPaAlsaStreamInfo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PortAudio: PaAlsaStreamInfo Struct Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 23 | 24 | 25 |
19 |
PortAudio 20 |  2.0 21 |
22 |
26 |
27 | 28 | 29 | 38 | 44 |
45 |
46 | 48 |
49 |
PaAlsaStreamInfo Struct Reference
50 |
51 |
52 | 53 | 55 | 57 | 58 | 60 | 61 | 63 | 64 | 66 | 67 |

54 | Data Fields

56 | unsigned long size
 
59 | PaHostApiTypeId hostApiType
 
62 | unsigned long version
 
65 | const char * deviceString
 
68 |

Detailed Description

69 |
70 |

Definition at line 53 of file pa_linux_alsa.h.

71 |

The documentation for this struct was generated from the following file: 74 |
75 | 76 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /Documentation/html/structPaAsioStreamInfo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PortAudio: PaAsioStreamInfo Struct Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 23 | 24 | 25 |
19 |
PortAudio 20 |  2.0 21 |
22 |
26 |
27 | 28 | 29 | 38 | 44 |
45 |
46 | 48 |
49 |
PaAsioStreamInfo Struct Reference
50 |
51 |
52 | 53 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 63 | 64 | 66 | 67 |

54 | Data Fields

unsigned long size
 
PaHostApiTypeId hostApiType
 
unsigned long version
 
62 | unsigned long flags
 
65 | int * channelSelectors
 
68 |

Detailed Description

69 |
70 |

Definition at line 125 of file pa_asio.h.

71 |

Field Documentation

72 | 73 |
74 |
75 | 76 | 77 | 78 | 79 |
PaHostApiTypeId PaAsioStreamInfo::hostApiType
80 |
81 |

paASIO

82 | 83 |

Definition at line 127 of file pa_asio.h.

84 | 85 |
86 |
87 | 88 |
89 |
90 | 91 | 92 | 93 | 94 |
unsigned long PaAsioStreamInfo::size
95 |
96 |

sizeof(PaAsioStreamInfo)

97 | 98 |

Definition at line 126 of file pa_asio.h.

99 | 100 |
101 |
102 | 103 |
104 |
105 | 106 | 107 | 108 | 109 |
unsigned long PaAsioStreamInfo::version
110 |
111 |

1

112 | 113 |

Definition at line 128 of file pa_asio.h.

114 | 115 |
116 |
117 |
The documentation for this struct was generated from the following file: 120 |
121 | 122 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /Documentation/html/structPaHostErrorInfo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PortAudio: PaHostErrorInfo Struct Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 23 | 24 | 25 |
19 |
PortAudio 20 |  2.0 21 |
22 |
26 |
27 | 28 | 29 | 38 | 44 |
45 |
46 | 48 |
49 |
PaHostErrorInfo Struct Reference
50 |
51 |
52 | 53 |

#include <portaudio.h>

54 | 55 | 57 | 58 | 59 | 60 | 61 | 62 | 63 |

56 | Data Fields

PaHostApiTypeId hostApiType
 
long errorCode
 
const char * errorText
 
64 |

Detailed Description

65 |

Structure used to return information about a host error condition.

66 | 67 |

Definition at line 389 of file portaudio.h.

68 |

Field Documentation

69 | 70 |
71 |
72 | 73 | 74 | 75 | 76 |
long PaHostErrorInfo::errorCode
77 |
78 |

the error code returned

79 | 80 |

Definition at line 391 of file portaudio.h.

81 | 82 |
83 |
84 | 85 |
86 |
87 | 88 | 89 | 90 | 91 |
const char* PaHostErrorInfo::errorText
92 |
93 |

a textual description of the error if available, otherwise a zero-length string

94 | 95 |

Definition at line 392 of file portaudio.h.

96 | 97 |
98 |
99 | 100 |
101 |
102 | 103 | 104 | 105 | 106 |
PaHostApiTypeId PaHostErrorInfo::hostApiType
107 |
108 |

the host API which returned the error code

109 | 110 |

Definition at line 390 of file portaudio.h.

111 | 112 |
113 |
114 |
The documentation for this struct was generated from the following file: 117 |
118 | 119 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /Documentation/html/structPaVersionInfo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PortAudio: PaVersionInfo Struct Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 23 | 24 | 25 |
19 |
PortAudio 20 |  2.0 21 |
22 |
26 |
27 | 28 | 29 | 38 | 44 |
45 |
46 | 48 |
49 |
PaVersionInfo Struct Reference
50 |
51 |
52 | 53 |

#include <portaudio.h>

54 | 55 | 57 | 59 | 60 | 62 | 63 | 65 | 66 | 67 | 68 | 69 | 70 |

56 | Data Fields

58 | int versionMajor
 
61 | int versionMinor
 
64 | int versionSubMinor
 
const char * versionControlRevision
 
const char * versionText
 
71 |

Detailed Description

72 |

A structure containing PortAudio API version information.

73 |
See Also
Pa_GetVersionInfo, paMakeVersionNumber
74 |
Version
Available as of 19.5.0.
75 | 76 |

Definition at line 90 of file portaudio.h.

77 |

Field Documentation

78 | 79 |
80 |
81 | 82 | 83 | 84 | 85 |
const char* PaVersionInfo::versionControlRevision
86 |
87 |

This is currently the Git revision hash but may change in the future. The versionControlRevision is updated by running a script before compiling the library. If the update does not occur, this value may refer to an earlier revision.

88 | 89 |

Definition at line 99 of file portaudio.h.

90 | 91 |
92 |
93 | 94 |
95 |
96 | 97 | 98 | 99 | 100 |
const char* PaVersionInfo::versionText
101 |
102 |

Version as a string, for example "PortAudio V19.5.0-devel, revision 1952M"

103 | 104 |

Definition at line 101 of file portaudio.h.

105 | 106 |
107 |
108 |
The documentation for this struct was generated from the following file: 111 |
112 | 113 | 118 | 119 | 120 | -------------------------------------------------------------------------------- /Documentation/html/structPaWDMKSSpecificStreamInfo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PortAudio: PaWDMKSSpecificStreamInfo Struct Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 23 | 24 | 25 |
19 |
PortAudio 20 |  2.0 21 |
22 |
26 |
27 | 28 | 29 | 38 | 44 |
45 |
46 | 48 |
49 |
PaWDMKSSpecificStreamInfo Struct Reference
50 |
51 |
52 | 53 | 55 | 57 | 58 | 60 | 61 |

54 | Data Fields

56 | PaWDMKSDirectionSpecificStreamInfo input
 
59 | PaWDMKSDirectionSpecificStreamInfo output
 
62 |

Detailed Description

63 |
64 |

Definition at line 128 of file pa_win_wdmks.h.

65 |

The documentation for this struct was generated from the following file: 68 |
69 | 70 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /Documentation/html/structPaWasapiJackDescription.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PortAudio: PaWasapiJackDescription Struct Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 23 | 24 | 25 |
19 |
PortAudio 20 |  2.0 21 |
22 |
26 |
27 | 28 | 29 | 38 | 44 |
45 |
46 | 48 |
49 |
PaWasapiJackDescription Struct Reference
50 |
51 |
52 | 53 | 55 | 57 | 58 | 60 | 61 | 63 | 64 | 66 | 67 | 69 | 70 | 72 | 73 | 75 | 76 |

54 | Data Fields

56 | unsigned long channelMapping
 
59 | unsigned long color
 
62 | PaWasapiJackConnectionType connectionType
 
65 | PaWasapiJackGeoLocation geoLocation
 
68 | PaWasapiJackGenLocation genLocation
 
71 | PaWasapiJackPortConnection portConnection
 
74 | unsigned int isConnected
 
77 |

Detailed Description

78 |
79 |

Definition at line 192 of file pa_win_wasapi.h.

80 |

The documentation for this struct was generated from the following file: 83 |
84 | 85 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /Documentation/html/structPaWinMmeDeviceAndChannelCount.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PortAudio: PaWinMmeDeviceAndChannelCount Struct Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 23 | 24 | 25 |
19 |
PortAudio 20 |  2.0 21 |
22 |
26 |
27 | 28 | 29 | 38 | 44 |
45 |
46 | 48 |
49 |
PaWinMmeDeviceAndChannelCount Struct Reference
50 |
51 |
52 | 53 | 55 | 57 | 58 | 60 | 61 |

54 | Data Fields

56 | PaDeviceIndex device
 
59 | int channelCount
 
62 |

Detailed Description

63 |
64 |

Definition at line 76 of file pa_win_wmme.h.

65 |

The documentation for this struct was generated from the following file: 68 |
69 | 70 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /Documentation/html/structPaWinWDMKSDeviceInfo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PortAudio: PaWinWDMKSDeviceInfo Struct Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 23 | 24 | 25 |
19 |
PortAudio 20 |  2.0 21 |
22 |
26 |
27 | 28 | 29 | 38 | 44 |
45 |
46 | 48 |
49 |
PaWinWDMKSDeviceInfo Struct Reference
50 |
51 |
52 | 53 | 55 | 56 | 57 | 58 | 59 | 61 | 62 | 63 | 64 |

54 | Data Fields

wchar_t filterPath [MAX_PATH]
 
wchar_t topologyPath [MAX_PATH]
 
60 | PaWDMKSType streamingType
 
GUID deviceProductGuid
 
65 |

Detailed Description

66 |
67 |

Definition at line 111 of file pa_win_wdmks.h.

68 |

Field Documentation

69 | 70 |
71 |
72 | 73 | 74 | 75 | 76 |
GUID PaWinWDMKSDeviceInfo::deviceProductGuid
77 |
78 |

The product GUID of the device (if supported)

79 | 80 |

Definition at line 115 of file pa_win_wdmks.h.

81 | 82 |
83 |
84 | 85 |
86 |
87 | 88 | 89 | 90 | 91 |
wchar_t PaWinWDMKSDeviceInfo::filterPath[MAX_PATH]
92 |
93 |

KS filter path in Unicode!

94 | 95 |

Definition at line 112 of file pa_win_wdmks.h.

96 | 97 |
98 |
99 | 100 |
101 |
102 | 103 | 104 | 105 | 106 |
wchar_t PaWinWDMKSDeviceInfo::topologyPath[MAX_PATH]
107 |
108 |

Topology filter path in Unicode!

109 | 110 |

Definition at line 113 of file pa_win_wdmks.h.

111 | 112 |
113 |
114 |
The documentation for this struct was generated from the following file: 117 |
118 | 119 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /Documentation/html/structPaWinWaveFormat.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PortAudio: PaWinWaveFormat Struct Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 23 | 24 | 25 |
19 |
PortAudio 20 |  2.0 21 |
22 |
26 |
27 | 28 | 29 | 38 | 44 |
45 |
46 | 48 |
49 |
PaWinWaveFormat Struct Reference
50 |
51 |
52 | 53 | 55 | 57 | 58 | 60 | 61 |

54 | Data Fields

56 | unsigned char fields [PAWIN_SIZEOF_WAVEFORMATEXTENSIBLE]
 
59 | unsigned long extraLongForAlignment
 
62 |

Detailed Description

63 |
64 |

Definition at line 139 of file pa_win_waveformat.h.

65 |

The documentation for this struct was generated from the following file: 68 |
69 | 70 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /Documentation/html/structPinkNoise.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PortAudio: PinkNoise Struct Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 23 | 24 | 25 |
19 |
PortAudio 20 |  2.0 21 |
22 |
26 |
27 | 28 | 29 | 38 | 44 |
45 |
46 | 48 |
49 |
PinkNoise Struct Reference
50 |
51 |
52 | 53 | 55 | 57 | 58 | 60 | 61 | 63 | 64 | 66 | 67 | 69 | 70 |

54 | Data Fields

56 | long pink_Rows [PINK_MAX_RANDOM_ROWS]
 
59 | long pink_RunningSum
 
62 | int pink_Index
 
65 | int pink_IndexMask
 
68 | float pink_Scalar
 
71 |

Detailed Description

72 |
73 |

Definition at line 73 of file paex_ocean_shore.c.

74 |

The documentation for this struct was generated from the following files: 78 |
79 | 80 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /Documentation/html/sync_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DelphiForBroadcasting/portaudio-delphi/de957923e704f1466dbab1ccdcad6906ec6f6901/Documentation/html/sync_off.png -------------------------------------------------------------------------------- /Documentation/html/sync_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DelphiForBroadcasting/portaudio-delphi/de957923e704f1466dbab1ccdcad6906ec6f6901/Documentation/html/sync_on.png -------------------------------------------------------------------------------- /Documentation/html/tab_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DelphiForBroadcasting/portaudio-delphi/de957923e704f1466dbab1ccdcad6906ec6f6901/Documentation/html/tab_a.png -------------------------------------------------------------------------------- /Documentation/html/tab_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DelphiForBroadcasting/portaudio-delphi/de957923e704f1466dbab1ccdcad6906ec6f6901/Documentation/html/tab_b.png -------------------------------------------------------------------------------- /Documentation/html/tab_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DelphiForBroadcasting/portaudio-delphi/de957923e704f1466dbab1ccdcad6906ec6f6901/Documentation/html/tab_h.png -------------------------------------------------------------------------------- /Documentation/html/tab_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DelphiForBroadcasting/portaudio-delphi/de957923e704f1466dbab1ccdcad6906ec6f6901/Documentation/html/tab_s.png -------------------------------------------------------------------------------- /Documentation/html/tabs.css: -------------------------------------------------------------------------------- 1 | .tabs, .tabs2, .tabs3 { 2 | background-image: url('tab_b.png'); 3 | width: 100%; 4 | z-index: 101; 5 | font-size: 13px; 6 | font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; 7 | } 8 | 9 | .tabs2 { 10 | font-size: 10px; 11 | } 12 | .tabs3 { 13 | font-size: 9px; 14 | } 15 | 16 | .tablist { 17 | margin: 0; 18 | padding: 0; 19 | display: table; 20 | } 21 | 22 | .tablist li { 23 | float: left; 24 | display: table-cell; 25 | background-image: url('tab_b.png'); 26 | line-height: 36px; 27 | list-style: none; 28 | } 29 | 30 | .tablist a { 31 | display: block; 32 | padding: 0 20px; 33 | font-weight: bold; 34 | background-image:url('tab_s.png'); 35 | background-repeat:no-repeat; 36 | background-position:right; 37 | color: #283A5D; 38 | text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); 39 | text-decoration: none; 40 | outline: none; 41 | } 42 | 43 | .tabs3 .tablist a { 44 | padding: 0 10px; 45 | } 46 | 47 | .tablist a:hover { 48 | background-image: url('tab_h.png'); 49 | background-repeat:repeat-x; 50 | color: #fff; 51 | text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); 52 | text-decoration: none; 53 | } 54 | 55 | .tablist li.current a { 56 | background-image: url('tab_a.png'); 57 | background-repeat:repeat-x; 58 | color: #fff; 59 | text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); 60 | } 61 | -------------------------------------------------------------------------------- /Documentation/html/terminating_portaudio.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PortAudio: Closing a Stream and Terminating PortAudio 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 23 | 24 | 25 |
19 |
PortAudio 20 |  2.0 21 |
22 |
26 |
27 | 28 | 29 | 38 |
39 |
40 |
41 |
Closing a Stream and Terminating PortAudio
42 |
43 |
44 |

When you are done with a stream, you should close it to free up resources:

45 |
err = Pa_CloseStream( stream );
46 |
if( err != paNoError ) goto error;
47 |

We've already mentioned this in Initializing PortAudio, but in case you forgot, be sure to terminate PortAudio when you are done:

48 |
err = Pa_Terminate( );
49 |
if( err != paNoError ) goto error;
50 |

Previous: Starting, Stopping and Aborting a Stream | Next: Utility Functions

51 |
52 | 53 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /Documentation/html/tutorial_start.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | PortAudio: PortAudio Tutorials 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | 18 | 23 | 24 | 25 |
19 |
PortAudio 20 |  2.0 21 |
22 |
26 |
27 | 28 | 29 | 38 |
39 |
40 |
41 |
PortAudio Tutorials
42 |
43 |
44 |

These tutorials takes you through a hands-on example of using PortAudio to make sound. If you'd prefer to start with a top-down overview of the PortAudio API, check out the PortAudio API Overview.

45 |

46 | Downloading

47 |

First thing you need to do is download the PortAudio source code either as a tarball from the website, or from the Subversion Repository.

48 |

49 | Compiling

50 |

Once you've downloaded PortAudio you'll need to compile it, which of course, depends on your environment:

51 | 68 |

Many platforms with GCC/make can use the simple ./configure && make combination and simply use the resulting libraries in their code.

69 |

70 | Programming with PortAudio

71 |

Below are the steps to writing a PortAudio application using the callback technique:

72 |
    73 |
  • Write a callback function that will be called by PortAudio when audio processing is needed.
  • 74 |
  • Initialize the PA library and open a stream for audio I/O.
  • 75 |
  • Start the stream. Your callback function will be now be called repeatedly by PA in the background.
  • 76 |
  • In your callback you can read audio data from the inputBuffer and/or write data to the outputBuffer.
  • 77 |
  • Stop the stream by returning 1 from your callback, or by calling a stop function.
  • 78 |
  • Close the stream and terminate the library.
  • 79 |
80 |

In addition to this "Callback" architecture, V19 also supports a "Blocking I/O" model which uses read and write calls which may be more familiar to non-audio programmers. Note that at this time, not all APIs support this functionality.

81 |

In this tutorial, we'll show how to use the callback architecture to play a sawtooth wave. Much of the tutorial is taken from the file paex_saw.c, which is part of the PortAudio distribution. When you're done with this tutorial, you'll be armed with the basic knowledge you need to write an audio program. If you need more sample code, look in the "examples" and "test" directory of the PortAudio distribution. Another great source of info is the portaudio.h Doxygen page, which documents the entire V19 API. Also see the page for tips on programming PortAudio on the PortAudio wiki.

82 |

83 | Programming Tutorial Contents

84 | 94 |

If you are upgrading from V18, you may want to look at the Proposed Enhancements to PortAudio, which describes the differences between V18 and V19.

95 |

Once you have a basic understanding of how to use PortAudio, you might be interested in Exploring PortAudio.

96 |

Next: Writing a Callback Function

97 |
98 | 99 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /Examples/pa_devs/Project1.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DelphiForBroadcasting/portaudio-delphi/de957923e704f1466dbab1ccdcad6906ec6f6901/Examples/pa_devs/Project1.res -------------------------------------------------------------------------------- /Examples/paex_basic/Project1.dpr: -------------------------------------------------------------------------------- 1 | program Project1; 2 | 3 | {$APPTYPE CONSOLE} 4 | 5 | {$R *.res} 6 | 7 | uses 8 | System.SysUtils, 9 | portaudio in '..\..\Include\portaudio.pas'; 10 | 11 | var 12 | i : integer; 13 | LPaHostApiCount: integer; 14 | LPaHostApiInfo: PPaHostApiInfo; 15 | LPaError : TPaError; 16 | begin 17 | try 18 | WriteLn('PA version int: ', IntToStr(Pa_GetVersion)); 19 | WriteLn('PA version text: ', Pa_GetVersionText); 20 | 21 | // init PA 22 | LPaError := Pa_Initialize; 23 | try 24 | WriteLn('Doing PA init: ', Pa_GetErrorText(LPaError)); 25 | 26 | // print some system information provided by PA 27 | LPaHostApiCount := Pa_GetHostApiCount; 28 | WriteLn('Host API count (OK if positive): ', IntToStr(LPaHostApiCount)); 29 | WriteLn('Default host API: ', IntToStr(Pa_GetDefaultHostApi)); 30 | 31 | for i := 0 to (LPaHostApiCount-1) do begin 32 | LPaHostApiInfo := Pa_GetHostApiInfo ( i ); 33 | WriteLn('Found host API ', i, ' which is ', UTF8String(LPaHostApiInfo^.name), 34 | ' (devices: ', IntToStr(LPaHostApiInfo^.deviceCount), ')'); 35 | end; 36 | 37 | WriteLn('Default output device: ', IntToStr(Pa_GetDefaultOutputDevice)); 38 | 39 | finally 40 | LPaError := Pa_Terminate; 41 | // end all PA activity 42 | WriteLn('Doing PA termination: ' + Pa_GetErrorText(LPaError)); 43 | end; 44 | 45 | except 46 | on E: Exception do 47 | Writeln(E.ClassName, ': ', E.Message); 48 | end; 49 | readln; 50 | end. 51 | -------------------------------------------------------------------------------- /Examples/paex_basic/Project1.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DelphiForBroadcasting/portaudio-delphi/de957923e704f1466dbab1ccdcad6906ec6f6901/Examples/paex_basic/Project1.res -------------------------------------------------------------------------------- /Examples/paex_saw/Project1.dpr: -------------------------------------------------------------------------------- 1 | (** @file paex_saw.c 2 | @ingroup examples_src 3 | @brief Play a simple (aliasing) sawtooth wave. 4 | @author Phil Burk http://www.softsynth.com 5 | *) 6 | (* 7 | * $Id$ 8 | * 9 | * This program uses the PortAudio Portable Audio Library. 10 | * For more information see: http://www.portaudio.com 11 | * Copyright (c) 1999-2000 Ross Bencina and Phil Burk 12 | * 13 | * Permission is hereby granted, free of charge, to any person obtaining 14 | * a copy of this software and associated documentation files 15 | * (the "Software"), to deal in the Software without restriction, 16 | * including without limitation the rights to use, copy, modify, merge, 17 | * publish, distribute, sublicense, and/or sell copies of the Software, 18 | * and to permit persons to whom the Software is furnished to do so, 19 | * subject to the following conditions: 20 | * 21 | * The above copyright notice and this permission notice shall be 22 | * included in all copies or substantial portions of the Software. 23 | * 24 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 25 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 26 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 27 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 28 | * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 29 | * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 30 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 31 | *) 32 | 33 | (* 34 | * The text above constitutes the entire PortAudio license; however, 35 | * the PortAudio community also makes the following non-binding requests: 36 | * 37 | * Any person wishing to distribute modifications to the Software is 38 | * requested to send the modifications to the original developer so that 39 | * they can be incorporated into the canonical version. It is also 40 | * requested that these non-binding requests be included along with the 41 | * license above. 42 | *) 43 | 44 | program Project1; 45 | 46 | {$APPTYPE CONSOLE} 47 | 48 | {$R *.res} 49 | 50 | uses 51 | System.SysUtils, 52 | System.Math, 53 | portaudio in '..\..\Include\portaudio.pas'; 54 | 55 | const 56 | NUM_SECONDS = 4; 57 | SAMPLE_RATE = 44100; 58 | 59 | 60 | type 61 | PPaTestData = ^TPaTestData; 62 | TPaTestData = record 63 | left_phase : double; 64 | right_phase : double; 65 | end; 66 | 67 | var 68 | LPaStream : PPaStream; 69 | LPaError : TPaError; 70 | Data : TPaTestData; 71 | 72 | (* This routine will be called by the PortAudio engine when audio is needed. 73 | ** It may called at interrupt level on some machines so don't do anything 74 | ** that could mess up the system like calling malloc() or free(). 75 | *) 76 | function PaTestCallback(inputBuffer : pointer; OutputBuffer : pointer; 77 | framesPerBuffer : longword; timeInfo : PPaStreamCallbackTimeInfo; 78 | statusFlags : TPaStreamCallbackFlags; UserData : pointer) : integer; 79 | cdecl; 80 | var 81 | OutBuffer : PDouble; 82 | i : integer; 83 | data : PPaTestData; 84 | begin 85 | OutBuffer := PDouble(OutputBuffer); 86 | data := PPaTestData(UserData); 87 | 88 | // Fill the buffer... 89 | for i := 0 to (FramesPerBuffer-1) do 90 | begin 91 | OutBuffer^ := data^.left_phase; 92 | Inc(OutBuffer); 93 | 94 | OutBuffer^ := data^.right_phase; 95 | Inc(OutBuffer); 96 | 97 | data^.left_phase := data^.left_phase + 0.1; 98 | if (data^.left_phase >= 1.0 ) then data^.left_phase := data^.left_phase - 2.0; 99 | 100 | data^.right_phase := data^.right_phase + 0.3; 101 | if ( data^.right_phase >= 1.0 ) then data^.right_phase := data^.right_phase - 2.0; 102 | end; 103 | 104 | result := paContinue; 105 | end; 106 | 107 | procedure Error; 108 | begin 109 | Pa_Terminate(); 110 | WriteLn('An error occured while using the portaudio Stream'); 111 | WriteLn('Error number: ', LPaError ); 112 | WriteLn('Error message: ', Pa_GetErrorText(LPaError)); 113 | halt; 114 | end; 115 | 116 | 117 | begin 118 | try 119 | WriteLn('PortAudio Test: output sawtooth wave.'); 120 | 121 | Data.left_phase := 0; 122 | Data.right_phase := 0; 123 | 124 | LPaError := Pa_Initialize; 125 | if not LPaError = 0 then Error; 126 | 127 | LPaError := Pa_OpenDefaultStream(LPaStream, 0, 2, paFloat32, SAMPLE_RATE, 256, @PaTestCallback, @Data); 128 | if not LPaError = 0 then Error; 129 | 130 | LPaError := Pa_StartStream(LPaStream); 131 | if not LPaError = 0 then Error; 132 | 133 | Pa_Sleep(NUM_SECONDS * 1000 ); 134 | 135 | LPaError := Pa_StopStream(LPaStream); 136 | if not LPaError = 0 then Error; 137 | 138 | LPaError := Pa_CloseStream(LPaStream); 139 | if not LPaError = 0 then Error; 140 | 141 | Pa_Terminate; 142 | WriteLn('Test finished.'); 143 | except 144 | on E: Exception do 145 | Writeln(E.ClassName, ': ', E.Message); 146 | end; 147 | readln; 148 | end. 149 | -------------------------------------------------------------------------------- /Examples/paex_saw/Project1.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DelphiForBroadcasting/portaudio-delphi/de957923e704f1466dbab1ccdcad6906ec6f6901/Examples/paex_saw/Project1.res -------------------------------------------------------------------------------- /Examples/paex_sine/Project1.dpr: -------------------------------------------------------------------------------- 1 | (** @file paex_sine.c 2 | @ingroup examples_src 3 | @brief Play a sine wave for several seconds. 4 | @author Ross Bencina 5 | @author Phil Burk 6 | *) 7 | (* 8 | * $Id$ 9 | * 10 | * This program uses the PortAudio Portable Audio Library. 11 | * For more information see: http://www.portaudio.com/ 12 | * Copyright (c) 1999-2000 Ross Bencina and Phil Burk 13 | * 14 | * Permission is hereby granted, free of charge, to any person obtaining 15 | * a copy of this software and associated documentation files 16 | * (the "Software"), to deal in the Software without restriction, 17 | * including without limitation the rights to use, copy, modify, merge, 18 | * publish, distribute, sublicense, and/or sell copies of the Software, 19 | * and to permit persons to whom the Software is furnished to do so, 20 | * subject to the following conditions: 21 | * 22 | * The above copyright notice and this permission notice shall be 23 | * included in all copies or substantial portions of the Software. 24 | * 25 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 26 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 27 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 28 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 29 | * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 30 | * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 31 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 32 | *) 33 | 34 | (* 35 | * The text above constitutes the entire PortAudio license; however, 36 | * the PortAudio community also makes the following non-binding requests: 37 | * 38 | * Any person wishing to distribute modifications to the Software is 39 | * requested to send the modifications to the original developer so that 40 | * they can be incorporated into the canonical version. It is also 41 | * requested that these non-binding requests be included along with the 42 | * license above. 43 | *) 44 | 45 | program Project1; 46 | 47 | {$APPTYPE CONSOLE} 48 | 49 | {$R *.res} 50 | 51 | uses 52 | System.SysUtils, 53 | System.Math, 54 | portaudio in '..\..\Include\portaudio.pas'; 55 | 56 | const 57 | NUM_SECONDS = 5; 58 | SAMPLE_RATE = 44100; 59 | FRAMES_PER_BUFFER = 64; 60 | TABLE_SIZE = 200; 61 | 62 | type 63 | PPaTestData = ^TPaTestData; 64 | TPaTestData = record 65 | Sine : array[0..TABLE_SIZE - 1] of Double; 66 | left_phase : integer; 67 | right_phase : integer; 68 | AMessage : MarshaledAstring; 69 | end; 70 | 71 | var 72 | LPaError : TPaError; 73 | 74 | 75 | (* This routine will be called by the PortAudio engine when audio is needed. 76 | ** It may called at interrupt level on some machines so don't do anything 77 | ** that could mess up the system like calling malloc() or free(). 78 | *) 79 | function PaTestCallback(inputBuffer : pointer; OutputBuffer : pointer; 80 | framesPerBuffer : longword; timeInfo : PPaStreamCallbackTimeInfo; 81 | statusFlags : TPaStreamCallbackFlags; UserData : pointer) : integer; 82 | cdecl; 83 | var 84 | OutBuffer : PDouble; 85 | i : longword; 86 | data : PPaTestData; 87 | begin 88 | OutBuffer := PDouble(OutputBuffer); 89 | data := PPaTestData(UserData); 90 | 91 | // Fill the buffer... 92 | for i := 0 to (FramesPerBuffer-1) do 93 | begin 94 | 95 | OutBuffer^ := data^.Sine[data^.left_phase]; 96 | Inc(OutBuffer); 97 | 98 | OutBuffer^ := data^.Sine[data^.right_phase]; 99 | Inc(OutBuffer); 100 | 101 | Inc(data^.left_phase, 1); 102 | if (data^.left_phase >= TABLE_SIZE ) then data^.left_phase := (data^.left_phase - TABLE_SIZE); 103 | 104 | Inc(data^.right_phase, 3); 105 | if ( data^.right_phase >= TABLE_SIZE ) then data^.right_phase := (data^.right_phase - TABLE_SIZE); 106 | end; 107 | 108 | PaTestCallback := paContinue; 109 | end; 110 | 111 | { This is called when playback is finished. 112 | Remember: ALWAYS USE CDECL or your pointers will be messed up! 113 | Pointers to this function must be castable to PPaStreamFinishedCallback: } 114 | procedure StreamFinished( UserData : pointer ); cdecl; 115 | var 116 | data : PPaTestData; 117 | begin 118 | data := PPaTestData(UserData); 119 | WriteLn('Stream Completed: ', UTF8String(data^.AMessage)); 120 | end; 121 | 122 | 123 | procedure Error; 124 | begin 125 | Pa_Terminate(); 126 | WriteLn('An error occured while using the portaudio Stream'); 127 | WriteLn('Error number: ', LPaError ); 128 | WriteLn('Error message: ', Pa_GetErrorText(LPaError)); 129 | halt; 130 | end; 131 | 132 | var 133 | j : integer; 134 | LPaOutputParameters : TPaStreamParameters; 135 | LPaStream : PPaStream; 136 | Data : TPaTestData; 137 | 138 | begin 139 | try 140 | WriteLn('PortAudio Test: Output Sine wave. SR = ', SAMPLE_RATE, ', BufSize = ', FRAMES_PER_BUFFER); 141 | 142 | // Fill a Sine wavetable (Float Data -1 .. +1) 143 | for j := 0 to TABLE_SIZE-1 do begin 144 | Data.Sine[j] := double((Sin((j/TABLE_SIZE) * Pi * 2 ))); 145 | end; 146 | 147 | Data.left_phase := 0; 148 | Data.right_phase := 0; 149 | 150 | LPaError := Pa_Initialize; 151 | if not LPaError = 0 then Error; 152 | 153 | LPaOutputParameters.Device := Pa_GetDefaultOutputDevice; 154 | LPaOutputParameters.ChannelCount := 2; 155 | LPaOutputParameters.SampleFormat := paFloat32; 156 | LPaOutputParameters.SuggestedLatency := (Pa_GetDeviceInfo(LPaOutputParameters.device)^.defaultHighOutputLatency)*1; 157 | LPaOutputParameters.HostApiSpecificStreamInfo := nil; 158 | 159 | WriteLn('Latency ', FloatToStr(Pa_GetDeviceInfo(LPaOutputParameters.device)^.defaultHighOutputLatency)); 160 | 161 | LPaError := Pa_OpenStream(LPaStream, nil, @LPaOutputParameters, SAMPLE_RATE, FRAMES_PER_BUFFER, paClipOff, @PaTestCallback, @Data); 162 | 163 | if not LPaError = 0 then Error; 164 | 165 | Data.AMessage := 'No Message'#0; 166 | 167 | LPaError := Pa_SetStreamFinishedCallback(LPaStream, PPaStreamFinishedCallback(@StreamFinished)); 168 | if not LPaError = 0 then Error; 169 | 170 | LPaError := Pa_StartStream(LPaStream); 171 | if not LPaError = 0 then Error; 172 | 173 | WriteLn('Play for ', NUM_SECONDS, ' seconds.'); 174 | Pa_Sleep( NUM_SECONDS * 1000 ); 175 | 176 | LPaError := Pa_StopStream(LPaStream); 177 | if not LPaError = 0 then Error; 178 | 179 | LPaError := Pa_CloseStream(LPaStream); 180 | if not LPaError = 0 then Error; 181 | 182 | Pa_Terminate; 183 | WriteLn('Test finished.'); 184 | except 185 | on E: Exception do 186 | Writeln(E.ClassName, ': ', E.Message); 187 | end; 188 | readln; 189 | end. 190 | -------------------------------------------------------------------------------- /Examples/paex_sine/Project1.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DelphiForBroadcasting/portaudio-delphi/de957923e704f1466dbab1ccdcad6906ec6f6901/Examples/paex_sine/Project1.res -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # portaudio-delphi 2 | 3 | * Portaudio Library - 19.6.0 (October 30, 2016, git commit 396fe4b6699ae929d3a685b3ef8a7e97396139a4)
4 | * Development environment - Delphi XE10.1
5 | 6 | Ported by: 7 | ``` 8 | Oleksandr Nazaruk (email: mail@freehand.com.ua) 9 | ``` 10 | 11 | Description: 12 | ``` 13 | PortAudio is a free, cross-platform, open-source, audio I/O library. It lets you write simple audio programs in 'C' or C++ that will compile and run on many platforms including Windows, Macintosh OS X, and Unix (OSS/ALSA). It is intended to promote the exchange of audio software between developers on different platforms. Many applications use PortAudio for Audio I/O. 14 | ``` --------------------------------------------------------------------------------