├── CMakeLists.txt ├── LICENSE ├── Makefile.am ├── README.md ├── RtAudio.cpp ├── RtAudio.h ├── autogen.sh ├── cmake └── RtAudioConfigUninstall.cmake.in ├── configure.ac ├── contrib ├── go │ └── rtaudio │ │ ├── rtaudio.go │ │ ├── rtaudio_stub.cpp │ │ ├── rtaudio_stub.h │ │ └── rtaudio_test.go └── python │ └── pyrtaudio │ ├── PyRtAudioTest.py │ ├── readme │ ├── rtaudiomodule.cpp │ └── setup.py ├── doc ├── Doxyfile.in ├── Makefile.am ├── doxygen │ ├── acknowledge.txt │ ├── apinotes.txt │ ├── compiling.txt │ ├── duplex.txt │ ├── error.txt │ ├── footer.html │ ├── header.html │ ├── license.txt │ ├── multi.txt │ ├── playback.txt │ ├── probe.txt │ ├── recording.txt │ ├── settings.txt │ └── tutorial.txt ├── images │ ├── ccrma.gif │ ├── mcgill.gif │ └── meson.build ├── meson.build └── release.txt ├── include ├── asio.cpp ├── asio.h ├── asiodrivers.cpp ├── asiodrivers.h ├── asiodrvr.h ├── asioinfo.txt ├── asiolist.cpp ├── asiolist.h ├── asiosys.h ├── dsound.h ├── functiondiscoverykeys_devpkey.h ├── ginclude.h ├── iasiodrv.h ├── iasiothiscallresolver.cpp ├── iasiothiscallresolver.h └── soundcard.h ├── install.txt ├── m4 └── ax_cxx_compile_stdcxx.m4 ├── meson.build ├── meson_options.txt ├── rtaudio.pc.in ├── rtaudio_c.cpp ├── rtaudio_c.h └── tests ├── CMakeLists.txt ├── Debug └── .placeholder ├── Makefile.am ├── Release └── .placeholder ├── Windows ├── Debug │ └── .placeholder ├── Release │ └── .placeholder ├── audioprobe.dsp ├── duplex.dsp ├── playraw.dsp ├── playsaw.dsp ├── record.dsp ├── rtaudio.dsw ├── testall.dsp └── teststops.dsp ├── apinames.cpp ├── audioprobe.cpp ├── duplex.cpp ├── meson.build ├── playraw.cpp ├── playsaw.cpp ├── record.cpp ├── testall.cpp └── teststops.cpp /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | RtAudio: a set of realtime audio i/o C++ classes 3 | Copyright (c) 2001-2023 Gary P. Scavone 4 | 5 | Permission is hereby granted, free of charge, to any person 6 | obtaining a copy of this software and associated documentation files 7 | (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, 9 | publish, distribute, sublicense, and/or sell copies of the Software, 10 | and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | Any person wishing to distribute modifications to the Software is 17 | asked to send the modifications to the original developer so that 18 | they can be incorporated into the canonical version. This is, 19 | however, not a binding provision of this license. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 22 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 24 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 25 | ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 26 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 27 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = . tests 2 | if MAKE_DOC 3 | SUBDIRS += doc 4 | endif 5 | 6 | AM_CXXFLAGS = @visibility@ 7 | 8 | lib_LTLIBRARIES = %D%/librtaudio.la 9 | %C%_librtaudio_la_CXXFLAGS = -DRTAUDIO_EXPORT 10 | %C%_librtaudio_la_LDFLAGS = -no-undefined -export-dynamic -version-info @SO_VERSION@ 11 | %C%_librtaudio_la_SOURCES = \ 12 | %D%/RtAudio.cpp \ 13 | %D%/rtaudio_c.cpp 14 | 15 | if ASIO 16 | %C%_librtaudio_la_SOURCES += \ 17 | include/asio.cpp \ 18 | include/asiodrivers.cpp \ 19 | include/asiolist.cpp \ 20 | include/iasiothiscallresolver.cpp 21 | 22 | # due to warning in asiolist.cpp 23 | %C%_librtaudio_la_CXXFLAGS += -Wno-error=unused-but-set-variable 24 | endif 25 | 26 | rtaudio_incdir = $(includedir)/rtaudio 27 | rtaudio_inc_HEADERS = \ 28 | %D%/RtAudio.h \ 29 | %D%/rtaudio_c.h 30 | 31 | pkgconfigdatadir = $(libdir)/pkgconfig 32 | pkgconfigdata_DATA = rtaudio.pc 33 | 34 | EXTRA_DIST = autogen.sh README.md install.txt contrib include cmake CMakeLists.txt 35 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # RtAudio 2 | 3 |  4 | 5 | A set of C++ classes that provide a common API for realtime audio input/output across Linux (native ALSA, JACK, PulseAudio and OSS), Macintosh OS X (CoreAudio and JACK), and Windows (DirectSound, ASIO and WASAPI) operating systems. 6 | 7 | By Gary P. Scavone, 2001-2023 (and many other developers!) 8 | 9 | This distribution of RtAudio contains the following: 10 | 11 | - doc: RtAudio documentation (see doc/html/index.html) 12 | - tests: example RtAudio programs 13 | - include: header and source files necessary for ASIO, DS & OSS compilation 14 | - tests/Windows: Visual C++ .net test program workspace and projects 15 | 16 | ## Overview 17 | 18 | RtAudio is a set of C++ classes that provides a common API (Application Programming Interface) for realtime audio input/output across Linux (native ALSA, JACK, PulseAudio and OSS), Macintosh OS X and Windows (DirectSound, ASIO and WASAPI) operating systems. RtAudio significantly simplifies the process of interacting with computer audio hardware. It was designed with the following objectives: 19 | 20 | - object-oriented C++ design 21 | - simple, common API across all supported platforms 22 | - only one source and one header file for easy inclusion in programming projects 23 | - allow simultaneous multi-api support 24 | - support dynamic connection of devices 25 | - provide extensive audio device parameter control 26 | - allow audio device capability probing 27 | - automatic internal conversion for data format, channel number compensation, (de)interleaving, and byte-swapping 28 | 29 | RtAudio incorporates the concept of audio streams, which represent audio output (playback) and/or input (recording). Available audio devices and their capabilities can be enumerated and then specified when opening a stream. Where applicable, multiple API support can be compiled and a particular API specified when creating an RtAudio instance. See the \ref apinotes section for information specific to each of the supported audio APIs. 30 | 31 | ## Building 32 | 33 | Several build systems are available. These are: 34 | 35 | - autotools (`./autogen.sh; make` from git, or `./configure; make` from tarball release) 36 | - CMake (`mkdir build; cd build; ../cmake; make`) 37 | - meson (`meson build; cd build; ninja`) 38 | - vcpkg (`./bootstrap-vcpkg.sh; ./vcpkg integrate install; ./vcpkg install rtaudio`) 39 | 40 | See `install.txt` for more instructions about how to select the audio backend API. By 41 | default all detected APIs will be enabled. 42 | 43 | We recommend using the autotools-based build for packaging purposes. Please note that 44 | RtAudio is designed as a single `.cpp` and `.h` file so that it is easy to copy directly 45 | into a project. In that case you need to define the appropriate flags for the desired 46 | backend APIs. 47 | 48 | ## FAQ 49 | 50 | ### Why does audio only come to one ear when I choose 1-channel output? 51 | 52 | RtAudio doesn't automatically turn 1-channel output into stereo output with copied values to two channels, since there may be cases when a user truly wants 1-channel behaviour. If you want monophonic data to be projected to stereo output, open a 2-channel stream and copy the data to both channels in your audio stream callback. 53 | 54 | ## Further Reading 55 | 56 | For complete documentation on RtAudio, see the doc directory of the distribution or surf to http://www.music.mcgill.ca/~gary/rtaudio/. 57 | 58 | 59 | ## Legal and ethical: 60 | 61 | The RtAudio license is similar to the MIT License. Please see [LICENSE](LICENSE). 62 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Run this to generate all the initial makefiles, etc. 3 | 4 | srcdir=`dirname $0` 5 | test -z "$srcdir" && srcdir=. 6 | 7 | DIE=0 8 | 9 | if test -z "$*"; then 10 | echo "**Warning**: I am going to run \`configure' with arguments for" 11 | echo "developer/maintainer mode. If you wish to pass extra arguments," 12 | echo "(such as --prefix), please specify them on the \`$0'" 13 | echo "command line." 14 | echo "If you wish to run configure yourself, please specify --no-configure." 15 | echo 16 | fi 17 | 18 | (test -f $srcdir/configure.ac) || { 19 | echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" 20 | echo " top-level package directory" 21 | exit 1 22 | } 23 | 24 | # Make some directories required by automake, if they don't exist 25 | if ! [ -d config ]; then mkdir -v config; fi 26 | if ! [ -d m4 ]; then mkdir -v m4; fi 27 | 28 | if ! autoreconf --version /dev/null 2>&1 29 | then 30 | 31 | (autoconf --version) < /dev/null > /dev/null 2>&1 || { 32 | echo 33 | echo "**Error**: You must have \`autoconf' installed." 34 | echo "Download the appropriate package for your distribution," 35 | echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" 36 | DIE=1 37 | } 38 | 39 | (grep "^LT_INIT" $srcdir/configure.ac >/dev/null) && { 40 | (libtoolize --version) < /dev/null > /dev/null 2>&1 \ 41 | && LIBTOOLIZE=libtoolize || { 42 | (glibtoolize --version) < /dev/null > /dev/null 2>&1 \ 43 | && LIBTOOLIZE=glibtoolize || { 44 | echo 45 | echo "**Error**: You must have \`libtool' installed." 46 | echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/" 47 | DIE=1 48 | } 49 | } 50 | } 51 | 52 | (automake --version) < /dev/null > /dev/null 2>&1 || { 53 | echo 54 | echo "**Error**: You must have \`automake' installed." 55 | echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/" 56 | DIE=1 57 | NO_AUTOMAKE=yes 58 | } 59 | 60 | 61 | # if no automake, don't bother testing for aclocal 62 | test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || { 63 | echo 64 | echo "**Error**: Missing \`aclocal'. The version of \`automake'" 65 | echo "installed doesn't appear recent enough." 66 | echo "You can get automake from ftp://ftp.gnu.org/pub/gnu/" 67 | DIE=1 68 | } 69 | 70 | if test "$DIE" -eq 1; then 71 | exit 1 72 | fi 73 | 74 | case $CC in 75 | xlc ) 76 | am_opt=--include-deps;; 77 | esac 78 | 79 | echo "Running aclocal $aclocalinclude ..." 80 | aclocal $ACLOCAL_FLAGS || exit 1 81 | echo "Running $LIBTOOLIZE ..." 82 | $LIBTOOLIZE || exit 1 83 | echo "Running automake --gnu $am_opt ..." 84 | automake --add-missing --gnu $am_opt || exit 1 85 | echo "Running autoconf ..." 86 | autoconf || exit 1 87 | 88 | else # autoreconf instead 89 | 90 | echo "Running autoreconf --verbose --install ..." 91 | autoreconf --verbose --install || exit 1 92 | 93 | fi 94 | 95 | if ( echo "$@" | grep -q -e "--no-configure" ); then 96 | NOCONFIGURE=1 97 | fi 98 | 99 | conf_flags="--enable-maintainer-mode --enable-debug --disable-silent-rules" 100 | 101 | if test x$NOCONFIGURE = x; then 102 | echo Running $srcdir/configure $conf_flags "$@" ... 103 | $srcdir/configure $conf_flags "$@" \ 104 | && echo Now type \`make\' to compile. || exit 1 105 | else 106 | echo Skipping configure process. 107 | fi 108 | -------------------------------------------------------------------------------- /cmake/RtAudioConfigUninstall.cmake.in: -------------------------------------------------------------------------------- 1 | if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 2 | message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"") 3 | endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 4 | 5 | file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) 6 | string(REGEX REPLACE "\n" ";" files "${files}") 7 | foreach(file ${files}) 8 | message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") 9 | if(EXISTS "$ENV{DESTDIR}${file}") 10 | exec_program( 11 | "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 12 | OUTPUT_VARIABLE rm_out 13 | RETURN_VALUE rm_retval 14 | ) 15 | if(NOT "${rm_retval}" STREQUAL 0) 16 | message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") 17 | endif(NOT "${rm_retval}" STREQUAL 0) 18 | else(EXISTS "$ENV{DESTDIR}${file}") 19 | message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") 20 | endif(EXISTS "$ENV{DESTDIR}${file}") 21 | endforeach(file) 22 | -------------------------------------------------------------------------------- /contrib/go/rtaudio/rtaudio_stub.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../RtAudio.h" 2 | 3 | #include "../../../RtAudio.cpp" 4 | #include "../../../rtaudio_c.cpp" 5 | -------------------------------------------------------------------------------- /contrib/go/rtaudio/rtaudio_stub.h: -------------------------------------------------------------------------------- 1 | #include "../../../rtaudio_c.h" 2 | -------------------------------------------------------------------------------- /contrib/go/rtaudio/rtaudio_test.go: -------------------------------------------------------------------------------- 1 | package rtaudio 2 | 3 | import ( 4 | "log" 5 | "math" 6 | "time" 7 | ) 8 | 9 | func ExampleCompiledAPI() { 10 | log.Println("RtAudio version: ", Version()) 11 | for _, api := range CompiledAPI() { 12 | log.Println("Compiled API: ", api) 13 | } 14 | } 15 | 16 | func ExampleRtAudio_Devices() { 17 | audio, err := Create(APIUnspecified) 18 | if err != nil { 19 | log.Fatal(err) 20 | } 21 | defer audio.Destroy() 22 | devices, err := audio.Devices() 23 | if err != nil { 24 | log.Fatal(err) 25 | } 26 | for _, d := range devices { 27 | log.Printf("Audio device: %#v\n", d) 28 | } 29 | } 30 | 31 | func ExampleRtAudio_Open() { 32 | const ( 33 | sampleRate = 44100 34 | bufSz = 512 35 | freq = 440.0 36 | ) 37 | phase := 0.0 38 | audio, err := Create(APIUnspecified) 39 | if err != nil { 40 | log.Fatal(err) 41 | } 42 | defer audio.Destroy() 43 | 44 | params := StreamParams{ 45 | DeviceID: uint(audio.DefaultOutputDevice()), 46 | NumChannels: 2, 47 | FirstChannel: 0, 48 | } 49 | options := StreamOptions{ 50 | Flags: FlagsAlsaUseDefault, 51 | } 52 | cb := func(out, in Buffer, dur time.Duration, status StreamStatus) int { 53 | samples := out.Float32() 54 | for i := 0; i < len(samples)/2; i++ { 55 | sample := float32(math.Sin(2 * math.Pi * phase)) 56 | phase += freq / sampleRate 57 | 58 | samples[i*2] = sample 59 | samples[i*2+1] = sample 60 | } 61 | return 0 62 | } 63 | err = audio.Open(¶ms, nil, FormatFloat32, sampleRate, bufSz, cb, &options) 64 | if err != nil { 65 | log.Fatal(err) 66 | } 67 | defer audio.Close() 68 | audio.Start() 69 | defer audio.Stop() 70 | time.Sleep(3 * time.Second) 71 | } 72 | -------------------------------------------------------------------------------- /contrib/python/pyrtaudio/PyRtAudioTest.py: -------------------------------------------------------------------------------- 1 | 2 | from __future__ import print_function 3 | import threading 4 | import rtaudio as rt 5 | 6 | from math import cos 7 | 8 | import struct 9 | 10 | 11 | class audio_generator: 12 | def __init__(self): 13 | self.idx = -1 14 | self.freq = 440. 15 | def __call__(self): 16 | self.idx += 1 17 | if self.idx%48000 == 0: 18 | self.freq *= 2**(1/12.) 19 | return 0.5*cos(2.*3.1416*self.freq*self.idx/48000.) 20 | 21 | 22 | class callback: 23 | def __init__(self, gen): 24 | self.gen = gen 25 | self.i = 0 26 | def __call__(self,playback, capture): 27 | [struct.pack_into("f", playback, 4*o, self.gen()) for o in range(256)] 28 | self.i = self.i + 256 29 | if self.i > 48000*10: 30 | print('.') 31 | return 1 32 | 33 | try: 34 | # if we have numpy, replace the above class 35 | import numpy as np 36 | class callback: 37 | def __init__(self, gen): 38 | print('Using Numpy.') 39 | self.freq = 440. 40 | t = np.arange(256, dtype=np.float32) / 48000.0 41 | self.phase = 2*np.pi*t 42 | self.inc = 2*np.pi*256/48000 43 | self.k = 0 44 | def __call__(self, playback, capture): 45 | # Calculate sinusoid using numpy vector operation, as 46 | # opposed to per-sample computations in the generator 47 | # above that must be collected and packed one at a time. 48 | self.k += 256 49 | if self.k > 48000: 50 | self.freq *= 2**(1/12.) 51 | self.k = 0 52 | self.phase += self.inc 53 | samples = 0.5*np.cos(self.phase * self.freq) 54 | 55 | # Ensure result is the right size! 56 | assert samples.shape[0] == 256 57 | assert samples.dtype == np.float32 58 | 59 | # Use numpy array view to do a once-copy into memoryview 60 | # (ie. we only do a single byte-wise copy of the final 61 | # result into 'playback') 62 | usamples = samples.view(dtype=np.uint8) 63 | playback_array = np.array(playback, copy=False) 64 | np.copyto(playback_array, usamples) 65 | except ModuleNotFoundError: 66 | print('Numpy not available, using struct.') 67 | 68 | dac = rt.RtAudio() 69 | 70 | n = dac.getDeviceCount() 71 | print('Number of devices available: ', n) 72 | 73 | for i in range(n): 74 | try: 75 | print(dac.getDeviceInfo(i)) 76 | except rt.RtError as e: 77 | print(e) 78 | 79 | 80 | print('Default output device: ', dac.getDefaultOutputDevice()) 81 | print('Default input device: ', dac.getDefaultInputDevice()) 82 | 83 | print('is stream open: ', dac.isStreamOpen()) 84 | print('is stream running: ', dac.isStreamRunning()) 85 | 86 | oParams = {'deviceId': 0, 'nChannels': 1, 'firstChannel': 0} 87 | iParams = {'deviceId': 0, 'nChannels': 1, 'firstChannel': 0} 88 | 89 | try: 90 | dac.openStream(oParams,oParams,48000,256,callback(audio_generator()) ) 91 | except rt.RtError as e: 92 | print(e) 93 | else: 94 | dac.startStream() 95 | 96 | import time 97 | print('latency: ', dac.getStreamLatency()) 98 | 99 | while (dac.isStreamRunning()): 100 | time.sleep(0.1) 101 | 102 | print(dac.getStreamTime()) 103 | 104 | dac.stopStream() 105 | dac.abortStream() 106 | dac.closeStream() 107 | -------------------------------------------------------------------------------- /contrib/python/pyrtaudio/readme: -------------------------------------------------------------------------------- 1 | PyRtAudio - a python wrapper around RtAudio that allows to perform audio i/o operations in real-time from the python language. 2 | 3 | By Antoine Lefebvre, 2011 4 | 5 | This software is in the development stage. Do not expect compatibility 6 | with future versions. Comments, suggestions, new features, bug fixes, 7 | etc. are welcome. 8 | 9 | 10 | This distribution of PyRtAudio contains the following: 11 | 12 | - rtaudiomodule.cpp: the python wrapper code 13 | - setup.py: a setup script use to compile and install PyRtAudio 14 | - examples: a single PyRtAudioTest.py script 15 | 16 | INSTALLATION 17 | 18 | The compilation and installation of the PyRtAudio module is handled by 19 | the python Distribution Utilities ("Distutils"). Provided that your 20 | system has a C++ compiler and is properly configure, the following 21 | command should be sufficient: 22 | 23 | >> python setup.py install 24 | 25 | Please refer to the distutils documentation for installation problems: http://docs.python.org/distutils/index.html 26 | 27 | LEGAL AND ETHICAL: 28 | 29 | The PyRtAudio license is the same as the RtAudio license: 30 | 31 | PyRtAudio: a python wrapper around RtAudio 32 | Copyright (c)2011 Antoine Lefebvre 33 | 34 | Permission is hereby granted, free of charge, to any person 35 | obtaining a copy of this software and associated documentation files 36 | (the "Software"), to deal in the Software without restriction, 37 | including without limitation the rights to use, copy, modify, merge, 38 | publish, distribute, sublicense, and/or sell copies of the Software, 39 | and to permit persons to whom the Software is furnished to do so, 40 | subject to the following conditions: 41 | 42 | The above copyright notice and this permission notice shall be 43 | included in all copies or substantial portions of the Software. 44 | 45 | Any person wishing to distribute modifications to the Software is 46 | asked to send the modifications to the original developer so that 47 | they can be incorporated into the canonical version. This is, 48 | however, not a binding provision of this license. 49 | 50 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 51 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 52 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 53 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 54 | ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 55 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 56 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 57 | 58 | -------------------------------------------------------------------------------- /contrib/python/pyrtaudio/setup.py: -------------------------------------------------------------------------------- 1 | #!/bin/env python 2 | 3 | import os 4 | from distutils.core import setup, Extension 5 | 6 | if hasattr(os, 'uname'): 7 | OSNAME = os.uname()[0] 8 | else: 9 | OSNAME = 'Windows' 10 | 11 | 12 | define_macros = [] 13 | libraries = [] 14 | extra_link_args = [] 15 | extra_compile_args = ['-I../../../'] 16 | sources = ['rtaudiomodule.cpp', '../../../RtAudio.cpp'] 17 | 18 | 19 | if OSNAME == 'Linux': 20 | define_macros=[("__LINUX_ALSA__", ''), 21 | ('__LINUX_JACK__', '')] 22 | libraries = ['asound', 'jack', 'pthread'] 23 | 24 | elif OSNAME == 'Darwin': 25 | define_macros = [('__MACOSX_CORE__', '')] 26 | libraries = ['pthread', 'stdc++'] 27 | extra_link_args = ['-framework', 'CoreAudio'] 28 | 29 | elif OSNAME == 'Windows': 30 | define_macros = [('__WINDOWS_DS__', None), 31 | ('__WINDOWS_ASIO__', None), 32 | ('__LITTLE_ENDIAN__',None), 33 | ('WIN32',None)] 34 | libraries = ['winmm', 'dsound', 'Advapi32','Ole32','User32'] 35 | sources += ['../../../include/asio.cpp', 36 | '../../../include/asiodrivers.cpp', 37 | '../../../include/asiolist.cpp', 38 | '../../../include/iasiothiscallresolver.cpp'] 39 | extra_compile_args.append('-I../../../include/') 40 | extra_compile_args.append('-EHsc') 41 | 42 | 43 | audio = Extension('rtaudio', 44 | sources=sources, 45 | libraries=libraries, 46 | define_macros=define_macros, 47 | extra_compile_args = extra_compile_args, 48 | extra_link_args = extra_link_args, 49 | ) 50 | 51 | 52 | setup(name = 'rtaudio', 53 | version = '0.1', 54 | description = 'Python RtAudio interface', 55 | ext_modules = [audio]) 56 | 57 | -------------------------------------------------------------------------------- /doc/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | MAINTAINERCLEANFILES=Makefile.in 3 | 4 | CLEANFILES=doxygen-build.stamp 5 | 6 | DOX=Doxyfile 7 | 8 | EXTRA_DIST=html 9 | 10 | INSTIMAGES=html/doxygen.png 11 | 12 | DOC_STAMPS=doxygen-build.stamp 13 | 14 | DOC_DIR=$(HTML_DIR) 15 | 16 | all-local: doxygen-build.stamp 17 | 18 | doxygen-build.stamp: $(DOX) $(top_srcdir)/RtAudio.h 19 | @echo '*** Running doxygen ***' 20 | $(DOXYGEN) $(DOX) 21 | touch doxygen-build.stamp 22 | 23 | clean-local: 24 | rm -f *~ *.bak $(DOC_STAMPS) || true 25 | if test -d html; then rm -fr html; fi 26 | if test -d latex; then rm -fr latex; fi 27 | if test -d man; then rm -fr man; fi 28 | 29 | distclean-local: clean 30 | rm -f *.stamp || true 31 | if test -d html; then rm -rf html; fi 32 | 33 | html-local: $(DOC_STAMPS) 34 | -------------------------------------------------------------------------------- /doc/doxygen/acknowledge.txt: -------------------------------------------------------------------------------- 1 | /*! \page acknowledge Acknowledgements 2 | 3 | Many thanks to the following people for providing bug fixes and improvements: 4 |
11 | 12 |
OS: | 15 |Audio API: | 16 |C++ Class: | 17 |Preprocessor Definition: | 18 |Library or Framework: | 19 |Example Compiler Statement: | 20 |
Linux | 23 |ALSA | 24 |RtApiAlsa | 25 |__LINUX_ALSA__ | 26 |asound, pthread | 27 |g++ -Wall -D__LINUX_ALSA__ -o audioprobe audioprobe.cpp RtAudio.cpp -lasound -lpthread | 28 |
Linux | 31 |PulseAudio | 32 |RtApiPulse | 33 |__LINUX_PULSE__ | 34 |pthread | 35 |g++ -Wall -D__LINUX_PULSE__ -o audioprobe audioprobe.cpp RtAudio.cpp -lpthread -lpulse-simple -lpulse | 36 |
Linux | 39 |OSS | 40 |RtApiOss | 41 |__LINUX_OSS__ | 42 |pthread | 43 |g++ -Wall -D__LINUX_OSS__ -o audioprobe audioprobe.cpp RtAudio.cpp -lpthread | 44 |
Linux or Macintosh OS-X | 47 |Jack Audio Server | 48 |RtApiJack | 49 |__UNIX_JACK__ | 50 |jack, pthread | 51 |g++ -Wall -D__UNIX_JACK__ -o audioprobe audioprobe.cpp RtAudio.cpp $(pkg-config --cflags --libs jack) -lpthread | 52 |
Macintosh OS-X | 56 |CoreAudio | 57 |RtApiCore | 58 |__MACOSX_CORE__ | 59 |pthread, CoreAudio | 60 |g++ -Wall -D__MACOSX_CORE__ -o audioprobe audioprobe.cpp RtAudio.cpp -framework CoreAudio -framework CoreFoundation -lpthread | 61 |
Windows | 64 |DirectSound | 65 |RtApiDs | 66 |__WINDOWS_DS__ | 67 |dsound.lib (ver. 5.0 or higher), multithreaded | 68 |MinGW: g++ -Wall -D__WINDOWS_DS__ -o audioprobe audioprobe.cpp RtAudio.cpp -lole32 -lwinmm -ldsound | 69 |
Windows | 72 |ASIO | 73 |RtApiAsio | 74 |__WINDOWS_ASIO__ | 75 |various ASIO header and source files | 76 |MinGW: g++ -Wall -D__WINDOWS_ASIO__ -Iinclude -o audioprobe audioprobe.cpp RtAudio.cpp asio.cpp asiolist.cpp asiodrivers.cpp iasiothiscallresolver.cpp -lole32 | 77 |
Windows | 80 |WASAPI | 81 |RtApiWasapi | 82 |__WINDOWS_WASAPI__ | 83 |MinGW: FunctionDiscoveryKeys_devpkey.h, lksuser, lmfplat, lmfuuid, lwmcodecdspuuid, lwinmm, lole32 | 84 |MinGW: g++ -Wall -D__WINDOWS_WASAPI__ -Iinclude -o audioprobe audioprobe.cpp RtAudio.cpp -lole32 -lwinmm -lksuser -lmfplat -lmfuuid -lwmcodecdspuuid | 85 |
88 |
89 | The example compiler statements above could be used to compile the audioprobe.cpp example file, assuming that audioprobe.cpp, RtAudio.h, RtAudio.cpp and any other necessary files all exist in the same directory or the include directory.
90 |
91 |
92 | */
93 |
--------------------------------------------------------------------------------
/doc/doxygen/duplex.txt:
--------------------------------------------------------------------------------
1 | /*! \page duplex Duplex Mode
2 |
3 | Finally, it is easy to use RtAudio for simultaneous audio input/output, or duplex operation. In this example, we simply pass the input data back to the output.
4 |
5 | \code
6 | #include "RtAudio.h"
7 | #include
2 |
3 |
6 |
7 |
5 |
4 | ©2001-2023 Gary P. Scavone, McGill University. All Rights Reserved.
Maintained by Gary P. Scavone.