添加一些关于midi播放的项目

This commit is contained in:
terryLP
2025-03-24 14:30:56 +08:00
parent e31eb22077
commit 498b4ef13b
699 changed files with 186162 additions and 1 deletions
@@ -0,0 +1,32 @@
include_directories(..)
if (WIN32)
include_directories(../include)
endif (WIN32)
list(GET LIB_TARGETS 0 LIBRTAUDIO)
add_executable(audioprobe audioprobe.cpp)
target_link_libraries(audioprobe ${LIBRTAUDIO} ${LINKLIBS})
add_executable(playsaw playsaw.cpp)
target_link_libraries(playsaw ${LIBRTAUDIO} ${LINKLIBS})
add_executable(playraw playraw.cpp)
target_link_libraries(playraw ${LIBRTAUDIO} ${LINKLIBS})
add_executable(record record.cpp)
target_link_libraries(record ${LIBRTAUDIO} ${LINKLIBS})
add_executable(duplex duplex.cpp)
target_link_libraries(duplex ${LIBRTAUDIO} ${LINKLIBS})
add_executable(apinames apinames.cpp)
target_link_libraries(apinames ${LIBRTAUDIO} ${LINKLIBS})
add_executable(testall testall.cpp)
target_link_libraries(testall ${LIBRTAUDIO} ${LINKLIBS})
add_executable(teststops teststops.cpp)
target_link_libraries(teststops ${LIBRTAUDIO} ${LINKLIBS})
add_test(NAME apinames COMMAND apinames)
@@ -0,0 +1,32 @@
noinst_PROGRAMS = audioprobe playsaw playraw record duplex apinames testall teststops
AM_CXXFLAGS = -Wall -I$(top_srcdir)
audioprobe_SOURCES = audioprobe.cpp
audioprobe_LDADD = $(top_builddir)/librtaudio.la
playsaw_SOURCES = playsaw.cpp
playsaw_LDADD = $(top_builddir)/librtaudio.la
playraw_SOURCES = playraw.cpp
playraw_LDADD = $(top_builddir)/librtaudio.la
record_SOURCES = record.cpp
record_LDADD = $(top_builddir)/librtaudio.la
duplex_SOURCES = duplex.cpp
duplex_LDADD = $(top_builddir)/librtaudio.la
apinames_SOURCES = apinames.cpp
apinames_LDADD = $(top_builddir)/librtaudio.la
testall_SOURCES = testall.cpp
testall_LDADD = $(top_builddir)/librtaudio.la
teststops_SOURCES = teststops.cpp
teststops_LDADD = $(top_builddir)/librtaudio.la
EXTRA_DIST = Windows CMakeLists.txt
TESTS = apinames
@@ -0,0 +1,158 @@
# Microsoft Developer Studio Project File - Name="audioprobe" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=audioprobe - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "audioprobe.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "audioprobe.mak" CFG="audioprobe - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "audioprobe - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "audioprobe - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "audioprobe - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "audioprobe___Win32_Release"
# PROP BASE Intermediate_Dir "audioprobe___Win32_Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir ""
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../" /I "../../include" /D "NDEBUG" /D "__WINDOWS_DS__" /D "__WINDOWS_ASIO__" /D "__WINDOWS_WASAPI__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib dsound.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "audioprobe - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "audioprobe___Win32_Debug"
# PROP BASE Intermediate_Dir "audioprobe___Win32_Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir ""
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../" /I "../../include" /D "_DEBUG" /D "__WINDOWS_DS__" /D "__WINDOWS_ASIO__" /D "__WINDOWS_WASAPI__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib dsound.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "audioprobe - Win32 Release"
# Name "audioprobe - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\include\asio.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\asiodrivers.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\asiolist.cpp
# End Source File
# Begin Source File
SOURCE=..\audioprobe.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\iasiothiscallresolver.cpp
# End Source File
# Begin Source File
SOURCE=..\..\RtAudio.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\include\asio.h
# End Source File
# Begin Source File
SOURCE=..\..\include\asiodrivers.h
# End Source File
# Begin Source File
SOURCE=..\..\include\asiodrvr.h
# End Source File
# Begin Source File
SOURCE=..\..\include\asiolist.h
# End Source File
# Begin Source File
SOURCE=..\..\include\asiosys.h
# End Source File
# Begin Source File
SOURCE=..\..\include\ginclude.h
# End Source File
# Begin Source File
SOURCE=..\..\include\iasiodrv.h
# End Source File
# Begin Source File
SOURCE=..\..\include\iasiothiscallresolver.h
# End Source File
# Begin Source File
SOURCE=..\..\RtAudio.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project
@@ -0,0 +1,158 @@
# Microsoft Developer Studio Project File - Name="duplex" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=duplex - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "duplex.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "duplex.mak" CFG="duplex - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "duplex - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "duplex - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "duplex - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "duplex___Win32_Release"
# PROP BASE Intermediate_Dir "duplex___Win32_Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir ""
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../" /I "../../include" /D "NDEBUG" /D "__WINDOWS_DS__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_ASIO__" /D "__WINDOWS_WASAPI__" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib dsound.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "duplex - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "duplex___Win32_Debug"
# PROP BASE Intermediate_Dir "duplex___Win32_Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir ""
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../" /I "../../include" /D "_DEBUG" /D "__WINDOWS_ASIO__.__WINDOWS_DS__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_ASIO__" /D "__WINDOWS_DS__" /D "__WINDOWS_WASAPI__" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib dsound.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "duplex - Win32 Release"
# Name "duplex - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\include\asio.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\asiodrivers.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\asiolist.cpp
# End Source File
# Begin Source File
SOURCE=..\duplex.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\iasiothiscallresolver.cpp
# End Source File
# Begin Source File
SOURCE=..\..\RtAudio.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\include\asio.h
# End Source File
# Begin Source File
SOURCE=..\..\include\asiodrivers.h
# End Source File
# Begin Source File
SOURCE=..\..\include\asiodrvr.h
# End Source File
# Begin Source File
SOURCE=..\..\include\asiolist.h
# End Source File
# Begin Source File
SOURCE=..\..\include\asiosys.h
# End Source File
# Begin Source File
SOURCE=..\..\include\ginclude.h
# End Source File
# Begin Source File
SOURCE=..\..\include\iasiodrv.h
# End Source File
# Begin Source File
SOURCE=..\..\include\iasiothiscallresolver.h
# End Source File
# Begin Source File
SOURCE=..\..\RtAudio.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project
@@ -0,0 +1,158 @@
# Microsoft Developer Studio Project File - Name="playraw" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=playraw - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "playraw.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "playraw.mak" CFG="playraw - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "playraw - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "playraw - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "playraw - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "playraw___Win32_Release"
# PROP BASE Intermediate_Dir "playraw___Win32_Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir ""
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../" /I "../../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_ASIO__" /D "__WINDOWS_DS__" /D "__WINDOWS_WASAPI__" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib dsound.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "playraw - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "playraw___Win32_Debug"
# PROP BASE Intermediate_Dir "playraw___Win32_Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir ""
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../" /I "../../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_ASIO__" /D "__WINDOWS_DS__" /D "__WINDOWS_WASAPI__" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib dsound.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "playraw - Win32 Release"
# Name "playraw - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\include\asio.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\asiodrivers.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\asiolist.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\iasiothiscallresolver.cpp
# End Source File
# Begin Source File
SOURCE=..\playraw.cpp
# End Source File
# Begin Source File
SOURCE=..\..\RtAudio.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\include\asio.h
# End Source File
# Begin Source File
SOURCE=..\..\include\asiodrivers.h
# End Source File
# Begin Source File
SOURCE=..\..\include\asiodrvr.h
# End Source File
# Begin Source File
SOURCE=..\..\include\asiolist.h
# End Source File
# Begin Source File
SOURCE=..\..\include\asiosys.h
# End Source File
# Begin Source File
SOURCE=..\..\include\ginclude.h
# End Source File
# Begin Source File
SOURCE=..\..\include\iasiodrv.h
# End Source File
# Begin Source File
SOURCE=..\..\include\iasiothiscallresolver.h
# End Source File
# Begin Source File
SOURCE=..\..\RtAudio.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project
@@ -0,0 +1,158 @@
# Microsoft Developer Studio Project File - Name="playsaw" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=playsaw - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "playsaw.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "playsaw.mak" CFG="playsaw - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "playsaw - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "playsaw - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "playsaw - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "playsaw___Win32_Release"
# PROP BASE Intermediate_Dir "playsaw___Win32_Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir ""
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../" /I "../../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_ASIO__" /D "__WINDOWS_DS__" /D "__WINDOWS_WASAPI__" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib dsound.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "playsaw - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "playsaw___Win32_Debug"
# PROP BASE Intermediate_Dir "playsaw___Win32_Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir ""
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../" /I "../../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_ASIO__" /D "__WINDOWS_DS__" /D "__WINDOWS_WASAPI__" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib dsound.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "playsaw - Win32 Release"
# Name "playsaw - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\include\asio.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\asiodrivers.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\asiolist.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\iasiothiscallresolver.cpp
# End Source File
# Begin Source File
SOURCE=..\playsaw.cpp
# End Source File
# Begin Source File
SOURCE=..\..\RtAudio.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\include\asio.h
# End Source File
# Begin Source File
SOURCE=..\..\include\asiodrivers.h
# End Source File
# Begin Source File
SOURCE=..\..\include\asiodrvr.h
# End Source File
# Begin Source File
SOURCE=..\..\include\asiolist.h
# End Source File
# Begin Source File
SOURCE=..\..\include\asiosys.h
# End Source File
# Begin Source File
SOURCE=..\..\include\ginclude.h
# End Source File
# Begin Source File
SOURCE=..\..\include\iasiodrv.h
# End Source File
# Begin Source File
SOURCE=..\..\include\iasiothiscallresolver.h
# End Source File
# Begin Source File
SOURCE=..\..\RtAudio.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project
@@ -0,0 +1,158 @@
# Microsoft Developer Studio Project File - Name="record" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=record - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "record.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "record.mak" CFG="record - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "record - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "record - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "record - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "record___Win32_Release"
# PROP BASE Intermediate_Dir "record___Win32_Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir ""
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../" /I "../../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_ASIO__" /D "__WINDOWS_DS__" /D "__WINDOWS_WASAPI__" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib dsound.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "record - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "record___Win32_Debug"
# PROP BASE Intermediate_Dir "record___Win32_Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir ""
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../" /I "../../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_ASIO__" /D "__WINDOWS_DS__" /D "__WINDOWS_WASAPI__" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib dsound.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "record - Win32 Release"
# Name "record - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\include\asio.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\asiodrivers.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\asiolist.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\iasiothiscallresolver.cpp
# End Source File
# Begin Source File
SOURCE=..\record.cpp
# End Source File
# Begin Source File
SOURCE=..\..\RtAudio.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\include\asio.h
# End Source File
# Begin Source File
SOURCE=..\..\include\asiodrivers.h
# End Source File
# Begin Source File
SOURCE=..\..\include\asiodrvr.h
# End Source File
# Begin Source File
SOURCE=..\..\include\asiolist.h
# End Source File
# Begin Source File
SOURCE=..\..\include\asiosys.h
# End Source File
# Begin Source File
SOURCE=..\..\include\ginclude.h
# End Source File
# Begin Source File
SOURCE=..\..\include\iasiodrv.h
# End Source File
# Begin Source File
SOURCE=..\..\include\iasiothiscallresolver.h
# End Source File
# Begin Source File
SOURCE=..\..\RtAudio.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project
@@ -0,0 +1,101 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "audioprobe"=.\audioprobe.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "duplex"=.\duplex.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "playraw"=.\playraw.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "playsaw"=.\playsaw.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "record"=.\record.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "testall"=.\testall.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "teststops"=.\teststops.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################
@@ -0,0 +1,158 @@
# Microsoft Developer Studio Project File - Name="testall" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=testall - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "testall.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "testall.mak" CFG="testall - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "testall - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "testall - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "testall - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "testall___Win32_Release"
# PROP BASE Intermediate_Dir "testall___Win32_Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir ""
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../" /I "../../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_ASIO__" /D "__WINDOWS_DS__" /D "__WINDOWS_WASAPI__" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib dsound.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "testall - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "testall___Win32_Debug"
# PROP BASE Intermediate_Dir "testall___Win32_Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir ""
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../" /I "../../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_ASIO__" /D "__WINDOWS_DS__" /D "__WINDOWS_WASAPI__" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib dsound.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "testall - Win32 Release"
# Name "testall - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\include\asio.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\asiodrivers.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\asiolist.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\iasiothiscallresolver.cpp
# End Source File
# Begin Source File
SOURCE=..\..\RtAudio.cpp
# End Source File
# Begin Source File
SOURCE=..\testall.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\include\asio.h
# End Source File
# Begin Source File
SOURCE=..\..\include\asiodrivers.h
# End Source File
# Begin Source File
SOURCE=..\..\include\asiodrvr.h
# End Source File
# Begin Source File
SOURCE=..\..\include\asiolist.h
# End Source File
# Begin Source File
SOURCE=..\..\include\asiosys.h
# End Source File
# Begin Source File
SOURCE=..\..\include\ginclude.h
# End Source File
# Begin Source File
SOURCE=..\..\include\iasiodrv.h
# End Source File
# Begin Source File
SOURCE=..\..\include\iasiothiscallresolver.h
# End Source File
# Begin Source File
SOURCE=..\..\RtAudio.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project
@@ -0,0 +1,158 @@
# Microsoft Developer Studio Project File - Name="teststops" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=teststops - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "teststops.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "teststops.mak" CFG="teststops - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "teststops - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "teststops - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "teststops - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "teststops___Win32_Release"
# PROP BASE Intermediate_Dir "teststops___Win32_Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir ""
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../" /I "../../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_ASIO__" /D "__WINDOWS_DS__" /D "__WINDOWS_WASAPI__" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib dsound.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "teststops - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "teststops___Win32_Debug"
# PROP BASE Intermediate_Dir "teststops___Win32_Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir ""
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../" /I "../../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_ASIO__" /D "__WINDOWS_DS__" /D "__WINDOWS_WASAPI__" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib dsound.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "teststops - Win32 Release"
# Name "teststops - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\include\asio.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\asiodrivers.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\asiolist.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\iasiothiscallresolver.cpp
# End Source File
# Begin Source File
SOURCE=..\..\RtAudio.cpp
# End Source File
# Begin Source File
SOURCE=..\teststops.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\include\asio.h
# End Source File
# Begin Source File
SOURCE=..\..\include\asiodrivers.h
# End Source File
# Begin Source File
SOURCE=..\..\include\asiodrvr.h
# End Source File
# Begin Source File
SOURCE=..\..\include\asiolist.h
# End Source File
# Begin Source File
SOURCE=..\..\include\asiosys.h
# End Source File
# Begin Source File
SOURCE=..\..\include\ginclude.h
# End Source File
# Begin Source File
SOURCE=..\..\include\iasiodrv.h
# End Source File
# Begin Source File
SOURCE=..\..\include\iasiothiscallresolver.h
# End Source File
# Begin Source File
SOURCE=..\..\RtAudio.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project
@@ -0,0 +1,157 @@
/******************************************/
/*
apinames.cpp
by Jean Pierre Cimalando, 2018.
This program tests parts of RtAudio related
to API names, the conversion from name to API
and vice-versa.
*/
/******************************************/
#include "RtAudio.h"
#include <cctype>
#include <cstdlib>
#include <iostream>
int test_cpp() {
std::vector<RtAudio::Api> apis;
RtAudio::getCompiledApi( apis );
// ensure the known APIs return valid names
std::cout << "API names by identifier (C++):\n";
for ( size_t i = 0; i < apis.size() ; ++i ) {
const std::string name = RtAudio::getApiName(apis[i]);
if (name.empty()) {
std::cout << "Invalid name for API " << (int)apis[i] << "\n";
exit(1);
}
const std::string displayName = RtAudio::getApiDisplayName(apis[i]);
if (displayName.empty()) {
std::cout << "Invalid display name for API " << (int)apis[i] << "\n";
exit(1);
}
std::cout << "* " << (int)apis[i] << " '" << name << "': '" << displayName << "'\n";
}
// ensure unknown APIs return the empty string
{
const std::string name = RtAudio::getApiName((RtAudio::Api)-1);
if (!name.empty()) {
std::cout << "Bad string for invalid API '" << name << "'\n";
exit(1);
}
const std::string displayName = RtAudio::getApiDisplayName((RtAudio::Api)-1);
if (displayName!="Unknown") {
std::cout << "Bad display string for invalid API '" << displayName << "'\n";
exit(1);
}
}
// try getting API identifier by name
std::cout << "API identifiers by name (C++):\n";
for ( size_t i = 0; i < apis.size() ; ++i ) {
std::string name = RtAudio::getApiName(apis[i]);
if ( RtAudio::getCompiledApiByName(name) != apis[i] ) {
std::cout << "Bad identifier for API '" << name << "'\n";
exit( 1 );
}
std::cout << "* '" << name << "': " << (int)apis[i] << "\n";
for ( size_t j = 0; j < name.size(); ++j )
name[j] = (j & 1) ? toupper(name[j]) : tolower(name[j]);
RtAudio::Api api = RtAudio::getCompiledApiByName(name);
if ( api != RtAudio::UNSPECIFIED ) {
std::cout << "Identifier " << (int)api << " for invalid API '" << name << "'\n";
exit( 1 );
}
}
// try getting an API identifier by unknown name
{
RtAudio::Api api;
api = RtAudio::getCompiledApiByName("");
if ( api != RtAudio::UNSPECIFIED ) {
std::cout << "Bad identifier for unknown API name\n";
exit( 1 );
}
}
return 0;
}
#include "rtaudio_c.h"
int test_c() {
const rtaudio_api_t *apis = rtaudio_compiled_api();
// ensure the known APIs return valid names
std::cout << "API names by identifier (C):\n";
for ( size_t i = 0; apis[i] != RTAUDIO_API_UNSPECIFIED; ++i) {
const std::string name = rtaudio_api_name(apis[i]);
if (name.empty()) {
std::cout << "Invalid name for API " << (int)apis[i] << "\n";
exit(1);
}
const std::string displayName = rtaudio_api_display_name(apis[i]);
if (displayName.empty()) {
std::cout << "Invalid display name for API " << (int)apis[i] << "\n";
exit(1);
}
std::cout << "* " << (int)apis[i] << " '" << name << "': '" << displayName << "'\n";
}
// ensure unknown APIs return the empty string
{
const char *s = rtaudio_api_name((rtaudio_api_t)-1);
const std::string name(s?s:"");
if (!name.empty()) {
std::cout << "Bad string for invalid API '" << name << "'\n";
exit(1);
}
s = rtaudio_api_display_name((rtaudio_api_t)-1);
const std::string displayName(s?s:"");
if (displayName!="Unknown") {
std::cout << "Bad display string for invalid API '" << displayName << "'\n";
exit(1);
}
}
// try getting API identifier by name
std::cout << "API identifiers by name (C):\n";
for ( size_t i = 0; apis[i] != RTAUDIO_API_UNSPECIFIED ; ++i ) {
const char *s = rtaudio_api_name(apis[i]);
std::string name(s?s:"");
if ( rtaudio_compiled_api_by_name(name.c_str()) != apis[i] ) {
std::cout << "Bad identifier for API '" << name << "'\n";
exit( 1 );
}
std::cout << "* '" << name << "': " << (int)apis[i] << "\n";
for ( size_t j = 0; j < name.size(); ++j )
name[j] = (j & 1) ? toupper(name[j]) : tolower(name[j]);
rtaudio_api_t api = rtaudio_compiled_api_by_name(name.c_str());
if ( api != RTAUDIO_API_UNSPECIFIED ) {
std::cout << "Identifier " << (int)api << " for invalid API '" << name << "'\n";
exit( 1 );
}
}
// try getting an API identifier by unknown name
{
rtaudio_api_t api;
api = rtaudio_compiled_api_by_name("");
if ( api != RTAUDIO_API_UNSPECIFIED ) {
std::cout << "Bad identifier for unknown API name\n";
exit( 1 );
}
}
return 0;
}
int main()
{
test_cpp();
test_c();
}
@@ -0,0 +1,104 @@
/******************************************/
/*
audioprobe.cpp
by Gary P. Scavone, 2001
Probe audio system and prints device info.
*/
/******************************************/
#include "RtAudio.h"
#include <iostream>
#include <map>
std::vector< RtAudio::Api > listApis()
{
std::vector< RtAudio::Api > apis;
RtAudio :: getCompiledApi( apis );
std::cout << "\nCompiled APIs:\n";
for ( size_t i=0; i<apis.size(); i++ )
std::cout << i << ". " << RtAudio::getApiDisplayName(apis[i])
<< " (" << RtAudio::getApiName(apis[i]) << ")" << std::endl;
return apis;
}
void listDevices(RtAudio::Api api)
{
RtAudio audio(api);
RtAudio::DeviceInfo info;
std::cout << "\nAPI: " << RtAudio::getApiDisplayName(audio.getCurrentApi()) << std::endl;
unsigned int devices = audio.getDeviceCount();
std::cout << "\nFound " << devices << " device(s) ...\n";
for (unsigned int i=0; i<devices; i++) {
info = audio.getDeviceInfo(i);
std::cout << "\nDevice Name = " << info.name << '\n';
std::cout << "Device ID = " << i << '\n';
if ( info.probed == false )
std::cout << "Probe Status = UNsuccessful\n";
else {
std::cout << "Probe Status = Successful\n";
std::cout << "Output Channels = " << info.outputChannels << '\n';
std::cout << "Input Channels = " << info.inputChannels << '\n';
std::cout << "Duplex Channels = " << info.duplexChannels << '\n';
if ( info.isDefaultOutput ) std::cout << "This is the default output device.\n";
else std::cout << "This is NOT the default output device.\n";
if ( info.isDefaultInput ) std::cout << "This is the default input device.\n";
else std::cout << "This is NOT the default input device.\n";
if ( info.nativeFormats == 0 )
std::cout << "No natively supported data formats(?)!";
else {
std::cout << "Natively supported data formats:\n";
if ( info.nativeFormats & RTAUDIO_SINT8 )
std::cout << " 8-bit int\n";
if ( info.nativeFormats & RTAUDIO_SINT16 )
std::cout << " 16-bit int\n";
if ( info.nativeFormats & RTAUDIO_SINT24 )
std::cout << " 24-bit int\n";
if ( info.nativeFormats & RTAUDIO_SINT32 )
std::cout << " 32-bit int\n";
if ( info.nativeFormats & RTAUDIO_FLOAT32 )
std::cout << " 32-bit float\n";
if ( info.nativeFormats & RTAUDIO_FLOAT64 )
std::cout << " 64-bit float\n";
}
if ( info.sampleRates.size() < 1 )
std::cout << "No supported sample rates found!";
else {
std::cout << "Supported sample rates = ";
for (unsigned int j=0; j<info.sampleRates.size(); j++)
std::cout << info.sampleRates[j] << " ";
}
std::cout << std::endl;
if ( info.preferredSampleRate == 0 )
std::cout << "No preferred sample rate found!" << std::endl;
else
std::cout << "Preferred sample rate = " << info.preferredSampleRate << std::endl;
}
}
}
int main(int argc, char *argv[])
{
std::cout << "\nRtAudio Version " << RtAudio::getVersion() << std::endl;
std::vector< RtAudio::Api > apis = listApis();
for ( size_t api=0; api < apis.size(); api++ )
{
errno = 0;
char *s;
if (argc < 2
|| apis[api] == RtAudio::getCompiledApiByName(argv[1])
|| (api == std::strtoul(argv[1], &s, 10) && argv[1] != s && !errno))
listDevices(apis[api]);
}
std::cout << std::endl;
return 0;
}
@@ -0,0 +1,139 @@
/******************************************/
/*
duplex.cpp
by Gary P. Scavone, 2006-2007.
This program opens a duplex stream and passes
input directly through to the output.
*/
/******************************************/
#include "RtAudio.h"
#include <iostream>
#include <cstdlib>
#include <cstring>
/*
typedef char MY_TYPE;
#define FORMAT RTAUDIO_SINT8
*/
typedef signed short MY_TYPE;
#define FORMAT RTAUDIO_SINT16
/*
typedef S24 MY_TYPE;
#define FORMAT RTAUDIO_SINT24
typedef signed long MY_TYPE;
#define FORMAT RTAUDIO_SINT32
typedef float MY_TYPE;
#define FORMAT RTAUDIO_FLOAT32
typedef double MY_TYPE;
#define FORMAT RTAUDIO_FLOAT64
*/
void usage( void ) {
// Error function in case of incorrect command-line
// argument specifications
std::cout << "\nuseage: duplex N fs <iDevice> <oDevice> <iChannelOffset> <oChannelOffset>\n";
std::cout << " where N = number of channels,\n";
std::cout << " fs = the sample rate,\n";
std::cout << " iDevice = optional input device to use (default = 0),\n";
std::cout << " oDevice = optional output device to use (default = 0),\n";
std::cout << " iChannelOffset = an optional input channel offset (default = 0),\n";
std::cout << " and oChannelOffset = optional output channel offset (default = 0).\n\n";
exit( 0 );
}
int inout( void *outputBuffer, void *inputBuffer, unsigned int /*nBufferFrames*/,
double /*streamTime*/, RtAudioStreamStatus status, void *data )
{
// Since the number of input and output channels is equal, we can do
// a simple buffer copy operation here.
if ( status ) std::cout << "Stream over/underflow detected." << std::endl;
unsigned int *bytes = (unsigned int *) data;
memcpy( outputBuffer, inputBuffer, *bytes );
return 0;
}
int main( int argc, char *argv[] )
{
unsigned int channels, fs, bufferBytes, oDevice = 0, iDevice = 0, iOffset = 0, oOffset = 0;
// Minimal command-line checking
if (argc < 3 || argc > 7 ) usage();
RtAudio adac;
if ( adac.getDeviceCount() < 1 ) {
std::cout << "\nNo audio devices found!\n";
exit( 1 );
}
channels = (unsigned int) atoi(argv[1]);
fs = (unsigned int) atoi(argv[2]);
if ( argc > 3 )
iDevice = (unsigned int) atoi(argv[3]);
if ( argc > 4 )
oDevice = (unsigned int) atoi(argv[4]);
if ( argc > 5 )
iOffset = (unsigned int) atoi(argv[5]);
if ( argc > 6 )
oOffset = (unsigned int) atoi(argv[6]);
// Let RtAudio print messages to stderr.
adac.showWarnings( true );
// Set the same number of channels for both input and output.
unsigned int bufferFrames = 512;
RtAudio::StreamParameters iParams, oParams;
iParams.deviceId = iDevice;
iParams.nChannels = channels;
iParams.firstChannel = iOffset;
oParams.deviceId = oDevice;
oParams.nChannels = channels;
oParams.firstChannel = oOffset;
if ( iDevice == 0 )
iParams.deviceId = adac.getDefaultInputDevice();
if ( oDevice == 0 )
oParams.deviceId = adac.getDefaultOutputDevice();
RtAudio::StreamOptions options;
//options.flags |= RTAUDIO_NONINTERLEAVED;
try {
adac.openStream( &oParams, &iParams, FORMAT, fs, &bufferFrames, &inout, (void *)&bufferBytes, &options );
}
catch ( RtAudioError& e ) {
std::cout << '\n' << e.getMessage() << '\n' << std::endl;
exit( 1 );
}
// Test RtAudio functionality for reporting latency.
std::cout << "\nStream latency = " << adac.getStreamLatency() << " frames" << std::endl;
bufferBytes = bufferFrames * channels * sizeof( MY_TYPE );
try {
adac.startStream();
char input;
std::cout << "\nRunning ... press <enter> to quit (buffer frames = " << bufferFrames << ").\n";
std::cin.get(input);
// Stop the stream.
adac.stopStream();
}
catch ( RtAudioError& e ) {
std::cout << '\n' << e.getMessage() << '\n' << std::endl;
goto cleanup;
}
cleanup:
if ( adac.isStreamOpen() ) adac.closeStream();
return 0;
}
@@ -0,0 +1,10 @@
apinames = executable('apinames', 'apinames.cpp', dependencies: rtaudio_dep)
test('API names', apinames)
audioprobe = executable('audioprobe', 'audioprobe.cpp', dependencies: rtaudio_dep)
duplex = executable('duplex', 'duplex.cpp', dependencies: rtaudio_dep)
playraw = executable('playraw', 'playraw.cpp', dependencies: rtaudio_dep)
playsaw = executable('playsaw', 'playsaw.cpp', dependencies: rtaudio_dep)
record = executable('record', 'record.cpp', dependencies: rtaudio_dep)
testall = executable('testall', 'testall.cpp', dependencies: rtaudio_dep)
teststops = executable('teststops', 'teststops.cpp', dependencies: rtaudio_dep)
@@ -0,0 +1,152 @@
/******************************************/
/*
playraw.cpp
by Gary P. Scavone, 2007
Play a specified raw file. It is necessary
that the file be of the same data format as
defined below.
*/
/******************************************/
#include "RtAudio.h"
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <stdio.h>
/*
typedef char MY_TYPE;
#define FORMAT RTAUDIO_SINT8
#define SCALE 127.0
*/
typedef signed short MY_TYPE;
#define FORMAT RTAUDIO_SINT16
#define SCALE 32767.0
/*
typedef S24 MY_TYPE;
#define FORMAT RTAUDIO_SINT24
#define SCALE 8388607.0
typedef signed int MY_TYPE;
#define FORMAT RTAUDIO_SINT32
#define SCALE 2147483647.0
typedef float MY_TYPE;
#define FORMAT RTAUDIO_FLOAT32
#define SCALE 1.0;
typedef double MY_TYPE;
#define FORMAT RTAUDIO_FLOAT64
#define SCALE 1.0;
*/
// Platform-dependent sleep routines.
#if defined( WIN32 )
#include <windows.h>
#define SLEEP( milliseconds ) Sleep( (DWORD) milliseconds )
#else // Unix variants
#include <unistd.h>
#define SLEEP( milliseconds ) usleep( (unsigned long) (milliseconds * 1000.0) )
#endif
void usage( void ) {
// Error function in case of incorrect command-line
// argument specifications
std::cout << "\nuseage: playraw N fs file <device> <channelOffset>\n";
std::cout << " where N = number of channels,\n";
std::cout << " fs = the sample rate, \n";
std::cout << " file = the raw file to play,\n";
std::cout << " device = optional device to use (default = 0),\n";
std::cout << " and channelOffset = an optional channel offset on the device (default = 0).\n\n";
exit( 0 );
}
struct OutputData {
FILE *fd;
unsigned int channels;
};
// Interleaved buffers
int output( void *outputBuffer, void * /*inputBuffer*/, unsigned int nBufferFrames,
double /*streamTime*/, RtAudioStreamStatus /*status*/, void *data )
{
OutputData *oData = (OutputData*) data;
// In general, it's not a good idea to do file input in the audio
// callback function but I'm doing it here because I don't know the
// length of the file we are reading.
unsigned int count = fread( outputBuffer, oData->channels * sizeof( MY_TYPE ), nBufferFrames, oData->fd);
if ( count < nBufferFrames ) {
unsigned int bytes = (nBufferFrames - count) * oData->channels * sizeof( MY_TYPE );
unsigned int startByte = count * oData->channels * sizeof( MY_TYPE );
memset( (char *)(outputBuffer)+startByte, 0, bytes );
return 1;
}
return 0;
}
int main( int argc, char *argv[] )
{
unsigned int channels, fs, bufferFrames, device = 0, offset = 0;
char *file;
// minimal command-line checking
if ( argc < 4 || argc > 6 ) usage();
RtAudio dac;
if ( dac.getDeviceCount() < 1 ) {
std::cout << "\nNo audio devices found!\n";
exit( 0 );
}
channels = (unsigned int) atoi( argv[1]) ;
fs = (unsigned int) atoi( argv[2] );
file = argv[3];
if ( argc > 4 )
device = (unsigned int) atoi( argv[4] );
if ( argc > 5 )
offset = (unsigned int) atoi( argv[5] );
OutputData data;
data.fd = fopen( file, "rb" );
if ( !data.fd ) {
std::cout << "Unable to find or open file!\n";
exit( 1 );
}
// Set our stream parameters for output only.
bufferFrames = 512;
RtAudio::StreamParameters oParams;
oParams.deviceId = device;
oParams.nChannels = channels;
oParams.firstChannel = offset;
if ( device == 0 )
oParams.deviceId = dac.getDefaultOutputDevice();
data.channels = channels;
try {
dac.openStream( &oParams, NULL, FORMAT, fs, &bufferFrames, &output, (void *)&data );
dac.startStream();
}
catch ( RtAudioError& e ) {
std::cout << '\n' << e.getMessage() << '\n' << std::endl;
goto cleanup;
}
std::cout << "\nPlaying raw file " << file << " (buffer frames = " << bufferFrames << ")." << std::endl;
while ( 1 ) {
SLEEP( 100 ); // wake every 100 ms to check if we're done
if ( dac.isStreamRunning() == false ) break;
}
cleanup:
fclose( data.fd );
dac.closeStream();
return 0;
}
@@ -0,0 +1,217 @@
/******************************************/
/*
playsaw.cpp
by Gary P. Scavone, 2006
This program will output sawtooth waveforms
of different frequencies on each channel.
*/
/******************************************/
#include "RtAudio.h"
#include <iostream>
#include <cstdlib>
/*
typedef char MY_TYPE;
#define FORMAT RTAUDIO_SINT8
#define SCALE 127.0
*/
typedef signed short MY_TYPE;
#define FORMAT RTAUDIO_SINT16
#define SCALE 32767.0
/*
typedef S24 MY_TYPE;
#define FORMAT RTAUDIO_SINT24
#define SCALE 8388607.0
typedef signed long MY_TYPE;
#define FORMAT RTAUDIO_SINT32
#define SCALE 2147483647.0
typedef float MY_TYPE;
#define FORMAT RTAUDIO_FLOAT32
#define SCALE 1.0
typedef double MY_TYPE;
#define FORMAT RTAUDIO_FLOAT64
#define SCALE 1.0
*/
// Platform-dependent sleep routines.
#if defined( WIN32 )
#include <windows.h>
#define SLEEP( milliseconds ) Sleep( (DWORD) milliseconds )
#else // Unix variants
#include <unistd.h>
#define SLEEP( milliseconds ) usleep( (unsigned long) (milliseconds * 1000.0) )
#endif
#define BASE_RATE 0.005
#define TIME 1.0
void usage( void ) {
// Error function in case of incorrect command-line
// argument specifications
std::cout << "\nuseage: playsaw N fs <device> <channelOffset> <time>\n";
std::cout << " where N = number of channels,\n";
std::cout << " fs = the sample rate,\n";
std::cout << " device = optional device to use (default = 0),\n";
std::cout << " channelOffset = an optional channel offset on the device (default = 0),\n";
std::cout << " and time = an optional time duration in seconds (default = no limit).\n\n";
exit( 0 );
}
void errorCallback( RtAudioError::Type type, const std::string &errorText )
{
// This example error handling function does exactly the same thing
// as the embedded RtAudio::error() function.
std::cout << "in errorCallback" << std::endl;
if ( type == RtAudioError::WARNING )
std::cerr << '\n' << errorText << "\n\n";
else if ( type != RtAudioError::WARNING )
throw( RtAudioError( errorText, type ) );
}
unsigned int channels;
RtAudio::StreamOptions options;
unsigned int frameCounter = 0;
bool checkCount = false;
unsigned int nFrames = 0;
const unsigned int callbackReturnValue = 1;
//#define USE_INTERLEAVED
#if defined( USE_INTERLEAVED )
// Interleaved buffers
int saw( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames,
double streamTime, RtAudioStreamStatus status, void *data )
{
unsigned int i, j;
extern unsigned int channels;
MY_TYPE *buffer = (MY_TYPE *) outputBuffer;
double *lastValues = (double *) data;
if ( status )
std::cout << "Stream underflow detected!" << std::endl;
for ( i=0; i<nBufferFrames; i++ ) {
for ( j=0; j<channels; j++ ) {
*buffer++ = (MY_TYPE) (lastValues[j] * SCALE * 0.5);
lastValues[j] += BASE_RATE * (j+1+(j*0.1));
if ( lastValues[j] >= 1.0 ) lastValues[j] -= 2.0;
}
}
frameCounter += nBufferFrames;
if ( checkCount && ( frameCounter >= nFrames ) ) return callbackReturnValue;
return 0;
}
#else // Use non-interleaved buffers
int saw( void *outputBuffer, void * /*inputBuffer*/, unsigned int nBufferFrames,
double /*streamTime*/, RtAudioStreamStatus status, void *data )
{
unsigned int i, j;
extern unsigned int channels;
MY_TYPE *buffer = (MY_TYPE *) outputBuffer;
double *lastValues = (double *) data;
if ( status )
std::cout << "Stream underflow detected!" << std::endl;
double increment;
for ( j=0; j<channels; j++ ) {
increment = BASE_RATE * (j+1+(j*0.1));
for ( i=0; i<nBufferFrames; i++ ) {
*buffer++ = (MY_TYPE) (lastValues[j] * SCALE * 0.5);
lastValues[j] += increment;
if ( lastValues[j] >= 1.0 ) lastValues[j] -= 2.0;
}
}
frameCounter += nBufferFrames;
if ( checkCount && ( frameCounter >= nFrames ) ) return callbackReturnValue;
return 0;
}
#endif
int main( int argc, char *argv[] )
{
unsigned int bufferFrames, fs, device = 0, offset = 0;
// minimal command-line checking
if (argc < 3 || argc > 6 ) usage();
RtAudio dac;
if ( dac.getDeviceCount() < 1 ) {
std::cout << "\nNo audio devices found!\n";
exit( 1 );
}
channels = (unsigned int) atoi( argv[1] );
fs = (unsigned int) atoi( argv[2] );
if ( argc > 3 )
device = (unsigned int) atoi( argv[3] );
if ( argc > 4 )
offset = (unsigned int) atoi( argv[4] );
if ( argc > 5 )
nFrames = (unsigned int) (fs * atof( argv[5] ));
if ( nFrames > 0 ) checkCount = true;
double *data = (double *) calloc( channels, sizeof( double ) );
// Let RtAudio print messages to stderr.
dac.showWarnings( true );
// Set our stream parameters for output only.
bufferFrames = 512;
RtAudio::StreamParameters oParams;
oParams.deviceId = device;
oParams.nChannels = channels;
oParams.firstChannel = offset;
if ( device == 0 )
oParams.deviceId = dac.getDefaultOutputDevice();
options.flags = RTAUDIO_HOG_DEVICE;
options.flags |= RTAUDIO_SCHEDULE_REALTIME;
#if !defined( USE_INTERLEAVED )
options.flags |= RTAUDIO_NONINTERLEAVED;
#endif
try {
dac.openStream( &oParams, NULL, FORMAT, fs, &bufferFrames, &saw, (void *)data, &options, &errorCallback );
dac.startStream();
}
catch ( RtAudioError& e ) {
e.printMessage();
goto cleanup;
}
if ( checkCount ) {
while ( dac.isStreamRunning() == true ) SLEEP( 100 );
}
else {
char input;
//std::cout << "Stream latency = " << dac.getStreamLatency() << "\n" << std::endl;
std::cout << "\nPlaying ... press <enter> to quit (buffer size = " << bufferFrames << ").\n";
std::cin.get( input );
try {
// Stop the stream
dac.stopStream();
}
catch ( RtAudioError& e ) {
e.printMessage();
}
}
cleanup:
if ( dac.isStreamOpen() ) dac.closeStream();
free( data );
return 0;
}
@@ -0,0 +1,174 @@
/******************************************/
/*
record.cpp
by Gary P. Scavone, 2007
This program records audio from a device and writes it to a
header-less binary file. Use the 'playraw', with the same
parameters and format settings, to playback the audio.
*/
/******************************************/
#include "RtAudio.h"
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <stdio.h>
/*
typedef char MY_TYPE;
#define FORMAT RTAUDIO_SINT8
*/
typedef signed short MY_TYPE;
#define FORMAT RTAUDIO_SINT16
/*
typedef S24 MY_TYPE;
#define FORMAT RTAUDIO_SINT24
typedef signed long MY_TYPE;
#define FORMAT RTAUDIO_SINT32
typedef float MY_TYPE;
#define FORMAT RTAUDIO_FLOAT32
typedef double MY_TYPE;
#define FORMAT RTAUDIO_FLOAT64
*/
// Platform-dependent sleep routines.
#if defined( WIN32 )
#include <windows.h>
#define SLEEP( milliseconds ) Sleep( (DWORD) milliseconds )
#else // Unix variants
#include <unistd.h>
#define SLEEP( milliseconds ) usleep( (unsigned long) (milliseconds * 1000.0) )
#endif
void usage( void ) {
// Error function in case of incorrect command-line
// argument specifications
std::cout << "\nuseage: record N fs <duration> <device> <channelOffset>\n";
std::cout << " where N = number of channels,\n";
std::cout << " fs = the sample rate,\n";
std::cout << " duration = optional time in seconds to record (default = 2.0),\n";
std::cout << " device = optional device to use (default = 0),\n";
std::cout << " and channelOffset = an optional channel offset on the device (default = 0).\n\n";
exit( 0 );
}
struct InputData {
MY_TYPE* buffer;
unsigned long bufferBytes;
unsigned long totalFrames;
unsigned long frameCounter;
unsigned int channels;
};
// Interleaved buffers
int input( void * /*outputBuffer*/, void *inputBuffer, unsigned int nBufferFrames,
double /*streamTime*/, RtAudioStreamStatus /*status*/, void *data )
{
InputData *iData = (InputData *) data;
// Simply copy the data to our allocated buffer.
unsigned int frames = nBufferFrames;
if ( iData->frameCounter + nBufferFrames > iData->totalFrames ) {
frames = iData->totalFrames - iData->frameCounter;
iData->bufferBytes = frames * iData->channels * sizeof( MY_TYPE );
}
unsigned long offset = iData->frameCounter * iData->channels;
memcpy( iData->buffer+offset, inputBuffer, iData->bufferBytes );
iData->frameCounter += frames;
if ( iData->frameCounter >= iData->totalFrames ) return 2;
return 0;
}
int main( int argc, char *argv[] )
{
unsigned int channels, fs, bufferFrames, device = 0, offset = 0;
double time = 2.0;
FILE *fd;
// minimal command-line checking
if ( argc < 3 || argc > 6 ) usage();
RtAudio adc;
if ( adc.getDeviceCount() < 1 ) {
std::cout << "\nNo audio devices found!\n";
exit( 1 );
}
channels = (unsigned int) atoi( argv[1] );
fs = (unsigned int) atoi( argv[2] );
if ( argc > 3 )
time = (double) atof( argv[3] );
if ( argc > 4 )
device = (unsigned int) atoi( argv[4] );
if ( argc > 5 )
offset = (unsigned int) atoi( argv[5] );
// Let RtAudio print messages to stderr.
adc.showWarnings( true );
// Set our stream parameters for input only.
bufferFrames = 512;
RtAudio::StreamParameters iParams;
if ( device == 0 )
iParams.deviceId = adc.getDefaultInputDevice();
else
iParams.deviceId = device;
iParams.nChannels = channels;
iParams.firstChannel = offset;
InputData data;
data.buffer = 0;
try {
adc.openStream( NULL, &iParams, FORMAT, fs, &bufferFrames, &input, (void *)&data );
}
catch ( RtAudioError& e ) {
std::cout << '\n' << e.getMessage() << '\n' << std::endl;
goto cleanup;
}
data.bufferBytes = bufferFrames * channels * sizeof( MY_TYPE );
data.totalFrames = (unsigned long) (fs * time);
data.frameCounter = 0;
data.channels = channels;
unsigned long totalBytes;
totalBytes = data.totalFrames * channels * sizeof( MY_TYPE );
// Allocate the entire data buffer before starting stream.
data.buffer = (MY_TYPE*) malloc( totalBytes );
if ( data.buffer == 0 ) {
std::cout << "Memory allocation error ... quitting!\n";
goto cleanup;
}
try {
adc.startStream();
}
catch ( RtAudioError& e ) {
std::cout << '\n' << e.getMessage() << '\n' << std::endl;
goto cleanup;
}
std::cout << "\nRecording for " << time << " seconds ... writing file 'record.raw' (buffer frames = " << bufferFrames << ")." << std::endl;
while ( adc.isStreamRunning() ) {
SLEEP( 100 ); // wake every 100 ms to check if we're done
}
// Now write the entire data to the file.
fd = fopen( "record.raw", "wb" );
fwrite( data.buffer, sizeof( MY_TYPE ), data.totalFrames * channels, fd );
fclose( fd );
cleanup:
if ( adc.isStreamOpen() ) adc.closeStream();
if ( data.buffer ) free( data.buffer );
return 0;
}
@@ -0,0 +1,233 @@
/******************************************/
/*
testall.cpp
by Gary P. Scavone, 2007-2008
This program will make a variety of calls
to extensively test RtAudio functionality.
*/
/******************************************/
#include "RtAudio.h"
#include <iostream>
#include <cstdlib>
#include <cstring>
#define BASE_RATE 0.005
#define TIME 1.0
void usage( void ) {
// Error function in case of incorrect command-line
// argument specifications
std::cout << "\nuseage: testall N fs <iDevice> <oDevice> <iChannelOffset> <oChannelOffset>\n";
std::cout << " where N = number of channels,\n";
std::cout << " fs = the sample rate,\n";
std::cout << " iDevice = optional input device to use (default = 0),\n";
std::cout << " oDevice = optional output device to use (default = 0),\n";
std::cout << " iChannelOffset = an optional input channel offset (default = 0),\n";
std::cout << " and oChannelOffset = optional output channel offset (default = 0).\n\n";
exit( 0 );
}
unsigned int channels;
// Interleaved buffers
int sawi( void *outputBuffer, void * /*inputBuffer*/, unsigned int nBufferFrames,
double /*streamTime*/, RtAudioStreamStatus status, void *data )
{
unsigned int i, j;
extern unsigned int channels;
double *buffer = (double *) outputBuffer;
double *lastValues = (double *) data;
if ( status )
std::cout << "Stream underflow detected!" << std::endl;
for ( i=0; i<nBufferFrames; i++ ) {
for ( j=0; j<channels; j++ ) {
*buffer++ = (double) lastValues[j];
lastValues[j] += BASE_RATE * (j+1+(j*0.1));
if ( lastValues[j] >= 1.0 ) lastValues[j] -= 2.0;
}
}
return 0;
}
// Non-interleaved buffers
int sawni( void *outputBuffer, void * /*inputBuffer*/, unsigned int nBufferFrames,
double /*streamTime*/, RtAudioStreamStatus status, void *data )
{
unsigned int i, j;
extern unsigned int channels;
double *buffer = (double *) outputBuffer;
double *lastValues = (double *) data;
if ( status )
std::cout << "Stream underflow detected!" << std::endl;
double increment;
for ( j=0; j<channels; j++ ) {
increment = BASE_RATE * (j+1+(j*0.1));
for ( i=0; i<nBufferFrames; i++ ) {
*buffer++ = (double) lastValues[j];
lastValues[j] += increment;
if ( lastValues[j] >= 1.0 ) lastValues[j] -= 2.0;
}
}
return 0;
}
int inout( void *outputBuffer, void *inputBuffer, unsigned int /*nBufferFrames*/,
double /*streamTime*/, RtAudioStreamStatus status, void *data )
{
// Since the number of input and output channels is equal, we can do
// a simple buffer copy operation here.
if ( status ) std::cout << "Stream over/underflow detected." << std::endl;
unsigned int *bytes = (unsigned int *) data;
memcpy( outputBuffer, inputBuffer, *bytes );
return 0;
}
int main( int argc, char *argv[] )
{
unsigned int bufferFrames, fs, oDevice = 0, iDevice = 0, iOffset = 0, oOffset = 0;
char input;
// minimal command-line checking
if (argc < 3 || argc > 7 ) usage();
RtAudio dac;
if ( dac.getDeviceCount() < 1 ) {
std::cout << "\nNo audio devices found!\n";
exit( 1 );
}
channels = (unsigned int) atoi( argv[1] );
fs = (unsigned int) atoi( argv[2] );
if ( argc > 3 )
iDevice = (unsigned int) atoi( argv[3] );
if ( argc > 4 )
oDevice = (unsigned int) atoi(argv[4]);
if ( argc > 5 )
iOffset = (unsigned int) atoi(argv[5]);
if ( argc > 6 )
oOffset = (unsigned int) atoi(argv[6]);
double *data = (double *) calloc( channels, sizeof( double ) );
// Let RtAudio print messages to stderr.
dac.showWarnings( true );
// Set our stream parameters for output only.
bufferFrames = 512;
RtAudio::StreamParameters oParams, iParams;
oParams.deviceId = oDevice;
oParams.nChannels = channels;
oParams.firstChannel = oOffset;
if ( oDevice == 0 )
oParams.deviceId = dac.getDefaultOutputDevice();
RtAudio::StreamOptions options;
options.flags = RTAUDIO_HOG_DEVICE;
try {
dac.openStream( &oParams, NULL, RTAUDIO_FLOAT64, fs, &bufferFrames, &sawi, (void *)data, &options );
std::cout << "\nStream latency = " << dac.getStreamLatency() << std::endl;
// Start the stream
dac.startStream();
std::cout << "\nPlaying ... press <enter> to stop.\n";
std::cin.get( input );
// Stop the stream
dac.stopStream();
// Restart again
std::cout << "Press <enter> to restart.\n";
std::cin.get( input );
dac.startStream();
// Test abort function
std::cout << "Playing again ... press <enter> to abort.\n";
std::cin.get( input );
dac.abortStream();
// Restart another time
std::cout << "Press <enter> to restart again.\n";
std::cin.get( input );
dac.startStream();
std::cout << "Playing again ... press <enter> to close the stream.\n";
std::cin.get( input );
}
catch ( RtAudioError& e ) {
e.printMessage();
goto cleanup;
}
if ( dac.isStreamOpen() ) dac.closeStream();
// Test non-interleaved functionality
options.flags = RTAUDIO_NONINTERLEAVED;
try {
dac.openStream( &oParams, NULL, RTAUDIO_FLOAT64, fs, &bufferFrames, &sawni, (void *)data, &options );
std::cout << "Press <enter> to start non-interleaved playback.\n";
std::cin.get( input );
// Start the stream
dac.startStream();
std::cout << "\nPlaying ... press <enter> to stop.\n";
std::cin.get( input );
}
catch ( RtAudioError& e ) {
e.printMessage();
goto cleanup;
}
if ( dac.isStreamOpen() ) dac.closeStream();
// Now open a duplex stream.
unsigned int bufferBytes;
iParams.deviceId = iDevice;
iParams.nChannels = channels;
iParams.firstChannel = iOffset;
if ( iDevice == 0 )
iParams.deviceId = dac.getDefaultInputDevice();
options.flags = RTAUDIO_NONINTERLEAVED;
try {
dac.openStream( &oParams, &iParams, RTAUDIO_SINT32, fs, &bufferFrames, &inout, (void *)&bufferBytes, &options );
bufferBytes = bufferFrames * channels * 4;
std::cout << "Press <enter> to start duplex operation.\n";
std::cin.get( input );
// Start the stream
dac.startStream();
std::cout << "\nRunning ... press <enter> to stop.\n";
std::cin.get( input );
// Stop the stream
dac.stopStream();
std::cout << "\nStopped ... press <enter> to restart.\n";
std::cin.get( input );
// Restart the stream
dac.startStream();
std::cout << "\nRunning ... press <enter> to stop.\n";
std::cin.get( input );
}
catch ( RtAudioError& e ) {
e.printMessage();
}
cleanup:
if ( dac.isStreamOpen() ) dac.closeStream();
free( data );
return 0;
}
@@ -0,0 +1,271 @@
/******************************************/
/*
teststop.cpp
by Gary P. Scavone, 2011
This program starts and stops an RtAudio
stream many times in succession and in
different ways to to test its functionality.
*/
/******************************************/
#include "RtAudio.h"
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#define PULSE_RATE 0.01 // seconds
#define RUNTIME 0.4 // seconds
#define PAUSETIME 0.1 // seconds
#define REPETITIONS 10
// Platform-dependent sleep routines.
#if defined( WIN32 )
#include <windows.h>
#define SLEEP( milliseconds ) Sleep( (DWORD) milliseconds )
#else // Unix variants
#include <unistd.h>
#define SLEEP( milliseconds ) usleep( (unsigned long) (milliseconds * 1000.0) )
#endif
void usage( void ) {
// Error function in case of incorrect command-line
// argument specifications
std::cout << "\nuseage: teststops N fs <iDevice> <oDevice> <iChannelOffset> <oChannelOffset>\n";
std::cout << " where N = number of channels,\n";
std::cout << " fs = the sample rate,\n";
std::cout << " iDevice = optional input device to use (default = 0),\n";
std::cout << " oDevice = optional output device to use (default = 0),\n";
std::cout << " iChannelOffset = an optional input channel offset (default = 0),\n";
std::cout << " and oChannelOffset = optional output channel offset (default = 0).\n\n";
exit( 0 );
}
struct MyData {
unsigned int channels;
unsigned int pulseCount;
unsigned int frameCounter;
unsigned int nFrames;
unsigned int returnValue;
};
// Interleaved buffers
int pulse( void *outputBuffer, void * /*inputBuffer*/, unsigned int nBufferFrames,
double /*streamTime*/, RtAudioStreamStatus status, void *mydata )
{
// Write out a pulse signal and ignore the input buffer.
unsigned int i, j;
float sample;
float *buffer = (float *) outputBuffer;
MyData *data = (MyData *) mydata;
if ( status ) std::cout << "Stream over/underflow detected!" << std::endl;
for ( i=0; i<nBufferFrames; i++ ) {
if ( data->frameCounter % data->pulseCount == 0 ) sample = 0.9f;
else sample = 0.0;
for ( j=0; j<data->channels; j++ )
*buffer++ = sample;
data->frameCounter++;
}
if ( data->frameCounter >= data->nFrames )
return data->returnValue;
else
return 0;
}
int main( int argc, char *argv[] )
{
unsigned int bufferFrames, fs, oDevice = 0, iDevice = 0, iOffset = 0, oOffset = 0;
unsigned int runtime, pausetime;
char input;
// minimal command-line checking
if (argc < 3 || argc > 7 ) usage();
RtAudio *adc = new RtAudio();
if ( adc->getDeviceCount() < 1 ) {
std::cout << "\nNo audio devices found!\n";
exit( 1 );
}
MyData mydata;
mydata.channels = (unsigned int) atoi( argv[1] );
fs = (unsigned int) atoi( argv[2] );
if ( argc > 3 )
iDevice = (unsigned int) atoi( argv[3] );
if ( argc > 4 )
oDevice = (unsigned int) atoi(argv[4]);
if ( argc > 5 )
iOffset = (unsigned int) atoi(argv[5]);
if ( argc > 6 )
oOffset = (unsigned int) atoi(argv[6]);
// Let RtAudio print messages to stderr.
adc->showWarnings( true );
runtime = static_cast<unsigned int>(RUNTIME * 1000);
pausetime = static_cast<unsigned int>(PAUSETIME * 1000);
// Set our stream parameters for a duplex stream.
bufferFrames = 512;
RtAudio::StreamParameters oParams, iParams;
oParams.deviceId = oDevice;
oParams.nChannels = mydata.channels;
oParams.firstChannel = oOffset;
iParams.deviceId = iDevice;
iParams.nChannels = mydata.channels;
iParams.firstChannel = iOffset;
if ( iDevice == 0 )
iParams.deviceId = adc->getDefaultInputDevice();
if ( oDevice == 0 )
oParams.deviceId = adc->getDefaultOutputDevice();
// First, test external stopStream() calls.
mydata.pulseCount = static_cast<unsigned int>(PULSE_RATE * fs);
mydata.nFrames = 50 * fs;
mydata.returnValue = 0;
try {
adc->openStream( &oParams, &iParams, RTAUDIO_SINT32, fs, &bufferFrames, &pulse, (void *)&mydata );
std::cout << "Press <enter> to start test.\n";
std::cin.get( input );
for (int i=0; i<REPETITIONS; i++ ) {
mydata.frameCounter = 0;
adc->startStream();
std::cout << "Stream started ... ";
SLEEP( runtime );
adc->stopStream();
std::cout << "stream externally stopped.\n";
SLEEP( pausetime );
}
}
catch ( RtAudioError& e ) {
e.printMessage();
goto cleanup;
}
adc->closeStream();
// Next, test internal stopStream() calls.
mydata.nFrames = (unsigned int) (RUNTIME * fs);
mydata.returnValue = 1;
try {
adc->openStream( &oParams, &iParams, RTAUDIO_SINT32, fs, &bufferFrames, &pulse, (void *)&mydata );
std::cin.clear();
fflush(stdin);
std::cout << "\nPress <enter> to continue test.\n";
std::cin.get( input );
for (int i=0; i<REPETITIONS; i++ ) {
mydata.frameCounter = 0;
adc->startStream();
std::cout << "Stream started ... ";
while ( adc->isStreamRunning() ) SLEEP( 5 );
std::cout << "stream stopped via callback return value = 1.\n";
SLEEP( pausetime );
}
}
catch ( RtAudioError& e ) {
e.printMessage();
goto cleanup;
}
adc->closeStream();
// Test internal abortStream() calls.
mydata.returnValue = 2;
try {
adc->openStream( &oParams, &iParams, RTAUDIO_SINT32, fs, &bufferFrames, &pulse, (void *)&mydata );
std::cin.clear();
fflush(stdin);
std::cout << "\nPress <enter> to continue test.\n";
std::cin.get( input );
for (int i=0; i<REPETITIONS; i++ ) {
mydata.frameCounter = 0;
adc->startStream();
std::cout << "Stream started ... ";
while ( adc->isStreamRunning() ) SLEEP( 5 );
std::cout << "stream aborted via callback return value = 2.\n";
SLEEP( pausetime );
}
}
catch ( RtAudioError& e ) {
e.printMessage();
goto cleanup;
}
adc->closeStream();
// Test consecutive stream re-opening.
mydata.returnValue = 0;
mydata.nFrames = 50 * fs;
try {
std::cin.clear();
fflush(stdin);
std::cout << "\nPress <enter> to continue test.\n";
std::cin.get( input );
for (int i=0; i<REPETITIONS; i++ ) {
adc->openStream( &oParams, &iParams, RTAUDIO_SINT32, fs, &bufferFrames, &pulse, (void *)&mydata );
mydata.frameCounter = 0;
adc->startStream();
std::cout << "New stream started ... ";
SLEEP( runtime );
adc->stopStream();
adc->closeStream();
std::cout << "stream stopped externally and closed.\n";
SLEEP( pausetime );
}
}
catch ( RtAudioError& e ) {
e.printMessage();
goto cleanup;
}
delete adc;
adc = 0;
// Test consecutive RtAudio creating and deletion.
try {
std::cin.clear();
fflush(stdin);
std::cout << "\nPress <enter> to continue test.\n";
std::cin.get( input );
for (int i=0; i<REPETITIONS; i++ ) {
adc = new RtAudio();
adc->openStream( &oParams, &iParams, RTAUDIO_SINT32, fs, &bufferFrames, &pulse, (void *)&mydata );
mydata.frameCounter = 0;
adc->startStream();
std::cout << "New instance and stream started ... ";
SLEEP( runtime );
adc->stopStream();
adc->closeStream();
delete adc;
adc = 0;
std::cout << "stream stopped and instance deleted.\n";
SLEEP( pausetime );
}
}
catch ( RtAudioError& e ) {
e.printMessage();
goto cleanup;
}
cleanup:
if ( adc && adc->isStreamOpen() ) adc->closeStream();
if ( adc ) delete adc;
return 0;
}