Version 3.2

This commit is contained in:
Gary Scavone
2013-09-25 14:47:10 +02:00
committed by Stephen Sinclair
parent 4b6500d3de
commit 3f126af4e5
443 changed files with 11772 additions and 8060 deletions

View File

@@ -0,0 +1,60 @@
# Misc Makefile - Global version for Unix systems which have GNU
# Makefile utilities installed. If this Makefile does not work on
# your system, try using the platform specific Makefiles (.sgi,
# .next, and .linux).
OS = $(shell uname)
# You will have to modify this path to correspond to the correct
# location in your system. The following definition corresponds
# to an STK project directory that is a subdirectory of the core
# STK distribution.
STK_PATH = ../../src/
O_FILES = Object.o WvOut.o WvIn.o RtAudio.o \
RtWvIn.o RtWvOut.o ByteSwap.o \
StkError.o WavWvOut.o StrmWvIn.o \
RtDuplex.o StrmWvOut.o WavWvIn.o \
RawWvIn.o
RM = /bin/rm
ifeq ($(OS),Linux) # These are for Linux
INSTR = sineN playN recordN ioN streamInN streamOutN
CC = g++ -O3 -Wall -D__OS_Linux_ # -g -pg -O3
LIBRARY = -lpthread -lm #-lasound
INCLUDE = -I../../include
endif
%.o : $(STK_PATH)%.cpp
$(CC) $(INCLUDE) -c $(<) -o $@
all: $(INSTR)
clean :
rm *.o
rm $(INSTR)
cleanIns :
rm $(INSTR)
strip :
strip $(INSTR)
playN: playN.cpp $(O_FILES)
$(CC) -o playN playN.cpp $(O_FILES) $(LIBRARY) $(INCLUDE)
streamOutN: streamOutN.cpp $(O_FILES)
$(CC) -o streamOutN streamOutN.cpp $(O_FILES) $(LIBRARY) $(INCLUDE)
streamInN: streamInN.cpp $(O_FILES)
$(CC) -o streamInN streamInN.cpp $(O_FILES) $(LIBRARY) $(INCLUDE)
recordN: recordN.cpp $(O_FILES)
$(CC) -o recordN recordN.cpp $(O_FILES) $(LIBRARY) $(INCLUDE)
ioN: ioN.cpp $(O_FILES)
$(CC) -o ioN ioN.cpp $(O_FILES) $(LIBRARY) $(INCLUDE)
sineN: sineN.cpp $(O_FILES)
$(CC) -o sineN sineN.cpp $(O_FILES) $(LIBRARY) $(INCLUDE)

89
projects/examples/examples.dsw Executable file
View File

@@ -0,0 +1,89 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "ioN"=.\ioN.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "playN"=.\playN.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "recordN"=.\recordN.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "sineN"=.\sineN.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "streamInN"=.\streamInN.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "streamOutN"=.\streamOutN.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

99
projects/examples/ioN.cpp Normal file
View File

@@ -0,0 +1,99 @@
/******************************************/
/*
Example program for realtime input/output
by Gary P. Scavone, 2000
This program reads N channels of realtime
audio input for a specified amount of time
and immediately play them back in realtime
(duplex mode). This program also demonstrates
the use of FIFO scheduling priority. To be
run with such priority, the program must be
set suid (chmod +s) and owned by root.
*/
/******************************************/
#include "RtDuplex.h"
#if !defined(__OS_Win_)
#include <sched.h>
#endif
void usage(void) {
/* Error function in case of incorrect command-line
argument specifications
*/
printf("\nuseage: ioN N time \n");
printf(" where N = number of channels,\n");
printf(" and time = the amount of time to record (in seconds).\n\n");
exit(0);
}
int
main(int argc, char *argv[])
{
int i=0;
// minimal command-line checking
if (argc != 3) usage();
int chans = (int) atoi(argv[1]);
float time = atof(argv[2]);
float sample_rate = SRATE;
MY_FLOAT *inSamples;
MY_FLOAT *lastSamples;
// allocate the lastSamples array
lastSamples = (MY_FLOAT *) new MY_FLOAT[chans];
for (i=0; i<chans; i++)
lastSamples[i] = 0.0;
// Define and open the realtime duplex device
RtDuplex *inout;
try {
inout = new RtDuplex(chans, sample_rate);
}
catch (StkError& m) {
m.printMessage();
exit(0);
}
#if !defined(__OS_Win_)
// set schedulling priority to SCHED_FIFO
struct sched_param p;
int min, max, priority;
if (!getuid() || !geteuid()) {
min=sched_get_priority_min(SCHED_FIFO);
max=sched_get_priority_max(SCHED_FIFO);
priority=min+(max-min)/2;
p.sched_priority=priority;
if (sched_setscheduler(0, SCHED_FIFO, &p)==-1) {
fprintf(stderr, "\ncould not activate scheduling with priority %d\n", priority);
}
seteuid(getuid());
}
#endif
// Here's the runtime loop
int j=0;
int samples = (int) (time*SRATE);
while (i<samples) {
inSamples = inout->mtick(lastSamples);
for (int k=0; k<chans; k++)
lastSamples[k] = inSamples[k];
i++;
#if !defined(__OS_Win_)
j++;
if (j>=256) {
sched_yield();
j = 0;
}
#endif
}
// Clean up
delete inout;
delete [] lastSamples;
}

142
projects/examples/ioN.dsp Executable file
View File

@@ -0,0 +1,142 @@
# Microsoft Developer Studio Project File - Name="ioN" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=ioN - 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 "ioN.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 "ioN.mak" CFG="ioN - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "ioN - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "ioN - 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)" == "ioN - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "ioN___Win32_Release"
# PROP BASE Intermediate_Dir "ioN___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 /W3 /GX /O2 /I "..\..\include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__OS_Win_" /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 winmm.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "ioN - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "ioN___Win32_Debug"
# PROP BASE Intermediate_Dir "ioN___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 /W3 /Gm /GX /ZI /Od /I "..\..\include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__OS_Win_" /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 winmm.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "ioN - Win32 Release"
# Name "ioN - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\src\ByteSwap.cpp
# End Source File
# Begin Source File
SOURCE=.\ioN.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Object.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\RtAudio.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\RtDuplex.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\StkError.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\include\ByteSwap.h
# End Source File
# Begin Source File
SOURCE=..\..\include\Object.h
# End Source File
# Begin Source File
SOURCE=..\..\include\RtAudio.h
# End Source File
# Begin Source File
SOURCE=..\..\include\RtDuplex.h
# End Source File
# Begin Source File
SOURCE=..\..\include\StkError.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

View File

@@ -0,0 +1,66 @@
/******************************************/
/*
Example program to play an N channel soundfile
by Gary P. Scavone, 2000
This program is currently written to load
a WAV file and play it in realtime. However,
it is simple to replace the instance of
WavWvIn with any other WvIn subclass.
Likewise, RtWvOut can be replaced with any
other WvOut subclass.
*/
/******************************************/
#include "RtWvOut.h"
#include "WavWvIn.h"
void usage(void) {
/* Error function in case of incorrect command-line
argument specifications
*/
printf("\nuseage: playN N file fs \n");
printf(" where N = number of channels,\n");
printf(" file = the .wav file to play,\n");
printf(" and fs = the sample rate.\n\n");
exit(0);
}
int main(int argc, char *argv[])
{
// minimal command-line checking
if (argc != 4) usage();
int chans = (int) atoi(argv[1]);
// Define and load the SND soundfile
WvIn *input;
try {
input = new WavWvIn((char *)argv[2], "oneshot");
}
catch (StkError& m) {
m.printMessage();
exit(0);
}
// Set playback rate here
input->setRate(atof(argv[3])/SRATE);
// Define and open the realtime output device
WvOut *output;
try {
output = new RtWvOut(chans);
}
catch (StkError& m) {
m.printMessage();
exit(0);
}
// Here's the runtime loop
while (!input->isFinished()) {
output->mtick(input->mtick());
}
// Clean up
delete input;
delete output;
}

167
projects/examples/playN.dsp Executable file
View File

@@ -0,0 +1,167 @@
# Microsoft Developer Studio Project File - Name="playN" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=playN - 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 "playN.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 "playN.mak" CFG="playN - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "playN - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "playN - 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)" == "playN - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "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 /W3 /GX /O2 /I "..\..\include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__OS_Win_" /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 winmm.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 dsound.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "playN - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "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 /W3 /Gm /GX /ZI /Od /I "..\..\include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__OS_Win_" /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
# SUBTRACT LINK32 /pdb:none
!ENDIF
# Begin Target
# Name "playN - Win32 Release"
# Name "playN - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\src\ByteSwap.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Object.cpp
# End Source File
# Begin Source File
SOURCE=.\playN.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\RtAudio.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\RtWvOut.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\StkError.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WavWvIn.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WvIn.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WvOut.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\include\ByteSwap.h
# End Source File
# Begin Source File
SOURCE=..\..\include\Object.h
# End Source File
# Begin Source File
SOURCE=..\..\include\RtAudio.h
# End Source File
# Begin Source File
SOURCE=..\..\include\RtWvOut.h
# End Source File
# Begin Source File
SOURCE=..\..\include\StkError.h
# End Source File
# Begin Source File
SOURCE=..\..\include\WavWvIn.h
# End Source File
# Begin Source File
SOURCE=..\..\include\WvIn.h
# End Source File
# Begin Source File
SOURCE=..\..\include\WvOut.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

View File

@@ -0,0 +1,71 @@
/******************************************/
/*
Example program to record N channels of data
by Gary P. Scavone, 2000
This program is currently written to read
from a realtime audio input device and to
write to a WAV output file. However, it
is simple to replace the instance of
RtWvIn with any other WvIn subclass.
Likewise, WavWvOut can be replaced with any
other WvOut subclass.
*/
/******************************************/
#include "RtWvIn.h"
#include "WavWvOut.h"
void usage(void) {
/* Error function in case of incorrect command-line
argument specifications
*/
printf("\nuseage: recordN N file time fs \n");
printf(" where N = number of channels,\n");
printf(" file = the .wav file to create,\n");
printf(" time = the amount of time to record (in seconds),\n");
printf(" and fs = the sample rate.\n\n");
exit(0);
}
int main(int argc, char *argv[])
{
// minimal command-line checking
if (argc != 5) usage();
int chans = (int) atoi(argv[1]);
float sample_rate = atof(argv[4]);
float time = atof(argv[3]);
// Define and open the realtime input device
WvIn *input;
try {
input = new RtWvIn(chans, sample_rate);
}
catch (StkError& m) {
m.printMessage();
exit(0);
}
// Define and open the soundfile for output
WvOut *output;
try {
output = new WavWvOut(argv[2],chans);
}
catch (StkError& m) {
m.printMessage();
exit(0);
}
// Here's the runtime loop
int i=0;
int samples = (int) (time*SRATE);
while (i<samples) {
output->mtick(input->mtick());
i++;
}
// Clean up
delete input;
delete output;
}

166
projects/examples/recordN.dsp Executable file
View File

@@ -0,0 +1,166 @@
# Microsoft Developer Studio Project File - Name="recordN" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=recordN - 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 "recordN.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 "recordN.mak" CFG="recordN - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "recordN - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "recordN - 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)" == "recordN - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "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 /W3 /GX /O2 /I "..\..\include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__OS_Win_" /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 winmm.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "recordN - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "recordN___Win32_Debug"
# PROP BASE Intermediate_Dir "recordN___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 /W3 /Gm /GX /ZI /Od /I "..\..\include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__OS_Win_" /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 winmm.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "recordN - Win32 Release"
# Name "recordN - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\src\ByteSwap.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Object.cpp
# End Source File
# Begin Source File
SOURCE=.\recordN.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\RtAudio.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\RtWvIn.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\StkError.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WavWvOut.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WvIn.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WvOut.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\include\ByteSwap.h
# End Source File
# Begin Source File
SOURCE=..\..\include\Object.h
# End Source File
# Begin Source File
SOURCE=..\..\include\RtAudio.h
# End Source File
# Begin Source File
SOURCE=..\..\include\RtWvIn.h
# End Source File
# Begin Source File
SOURCE=..\..\include\StkError.h
# End Source File
# Begin Source File
SOURCE=..\..\include\WavWvOut.h
# End Source File
# Begin Source File
SOURCE=..\..\include\WvIn.h
# End Source File
# Begin Source File
SOURCE=..\..\include\WvOut.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

View File

@@ -0,0 +1,54 @@
# A simple Tcl/Tk example script
# Set initial control values
set pitch 64.0
set press 64.0
set outID "stdout"
# Configure main window
wm title . "A Simple GUI"
wm iconname . "simple"
. config -bg black
# Configure a "note-on" button
frame .noteOn -bg black
button .noteOn.on -text NoteOn -bg grey66 -command { noteOn $pitch $press }
pack .noteOn.on -side left -padx 5
pack .noteOn
# Configure sliders
frame .slider -bg black
scale .slider.pitch -from 0 -to 128 -length 200 \
-command {changePitch } -variable pitch \
-orient horizontal -label "MIDI Note Number" \
-tickinterval 32 -showvalue true -bg grey66
pack .slider.pitch -padx 10 -pady 10
pack .slider -side left
# Bind an X windows "close" event with the Exit routine
bind . <Destroy> +myExit
proc myExit {} {
global pitch outID
puts $outID [format "NoteOff 0.0 1 %f 127" $pitch ]
flush $outID
puts $outID [format "ExitProgram"]
flush $outID
close $outID
exit
}
proc noteOn {pitchVal pressVal} {
global outID
puts $outID [format "NoteOn 0.0 1 %f %f" $pitchVal $pressVal]
flush $outID
}
proc changePitch {value} {
global outID
puts $outID [format "PitchBend 0.0 1 %.3f" $value]
flush $outID
}

View File

@@ -0,0 +1,79 @@
/******************************************/
/*
Example program to write N sine tones to
an N channel soundfile
by Gary P. Scavone, 2000
This program is currently written to write
an N channel WAV file. However, it is
simple to replace the instance of WavWvOut
with any other WvOut subclass.
*/
/******************************************/
#include "WavWvOut.h"
#include "RawWvIn.h"
void usage(void) {
/* Error function in case of incorrect command-line
argument specifications
*/
printf("\nuseage: sineN N file time \n");
printf(" where N = number of channels (sines),\n");
printf(" file = the .wav file to create,\n");
printf(" and time = the amount of time to record (in seconds).\n\n");
exit(0);
}
int
main(int argc, char *argv[])
{
// minimal command-line checking
if (argc != 4) usage();
int chans = (int) atoi(argv[1]);
float time = atof(argv[3]);
int i;
// Define and load the rawwave file(s) ... the path is critical
RawWvIn *oscs[chans];
try {
for (i=0; i<chans; i++)
oscs[i] = new RawWvIn("../../rawwaves/sinewave.raw", "looping");
}
catch (StkError& m) {
m.printMessage();
exit(0);
}
// Set oscillator frequency(ies) here ... somewhat random
float base_freq = 220.0;
for (i=0; i<chans; i++)
oscs[i]->setFreq(base_freq + i*(45.0));
// Define and open the soundfile for output
WvOut *output;
try {
output = new WavWvOut(argv[2],chans);
}
catch (StkError& m) {
m.printMessage();
exit(0);
}
// Here's the runtime loop
i=0;
int samples = (int) (time*SRATE);
MY_FLOAT *outvec = (MY_FLOAT *) new MY_FLOAT[chans];
while (i<samples) {
for (int j=0; j<chans; j++)
outvec[j] = oscs[j]->tick();
output->mtick(outvec);
i++;
}
// Clean up
for (i=0; i<chans; i++)
delete oscs[i];
delete [] outvec;
delete output;
}

156
projects/examples/sineN.dsp Executable file
View File

@@ -0,0 +1,156 @@
# Microsoft Developer Studio Project File - Name="sineN" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=sineN - 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 "sineN.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 "sineN.mak" CFG="sineN - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "sineN - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "sineN - 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)" == "sineN - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "sineN___Win32_Release"
# PROP BASE Intermediate_Dir "sineN___Win32_Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir ""
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /I "..\..\include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__OS_Win_" /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 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
!ELSEIF "$(CFG)" == "sineN - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "sineN___Win32_Debug"
# PROP BASE Intermediate_Dir "sineN___Win32_Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir ""
# PROP Intermediate_Dir "Debug"
# 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 /W3 /Gm /GX /ZI /Od /I "..\..\include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__OS_Win_" /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 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
!ENDIF
# Begin Target
# Name "sineN - Win32 Release"
# Name "sineN - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\src\ByteSwap.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Object.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\RawWvIn.cpp
# End Source File
# Begin Source File
SOURCE=.\sineN.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\StkError.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WavWvOut.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WvIn.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WvOut.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\include\ByteSwap.h
# End Source File
# Begin Source File
SOURCE=..\..\include\Object.h
# End Source File
# Begin Source File
SOURCE=..\..\include\RawWvIn.h
# End Source File
# Begin Source File
SOURCE=..\..\include\StkError.h
# End Source File
# Begin Source File
SOURCE=..\..\include\WavWvOut.h
# End Source File
# Begin Source File
SOURCE=..\..\include\WvIn.h
# End Source File
# Begin Source File
SOURCE=..\..\include\WvOut.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

View File

@@ -0,0 +1,73 @@
/******************************************/
/*
Example program to read N channels of audio
data that are streamed over an ethernet
connection.
by Gary P. Scavone, 2000
This program is currently written to play
the input data in realtime. However, it
is simple to replace the instance of
RtWvOut with any other WvOut subclass.
The class StrmWvIn sets up a socket server
and waits for a connection. Thus, this
program needs to be started before the
streaming client. This program will
terminate when the socket connection is
closed.
*/
/******************************************/
#include "Object.h"
#include "StrmWvIn.h"
#include "RtWvOut.h"
void usage(void) {
/* Error function in case of incorrect command-line
argument specifications
*/
printf("\nuseage: streamInN N fs \n");
printf(" where N = number of channels,\n");
printf(" and fs = the sample rate.\n\n");
exit(0);
}
int main(int argc, char *argv[])
{
// minimal command-line checking
if (argc != 3) usage();
int chans = (int) atoi(argv[1]);
WvIn *input;
try {
input = new StrmWvIn(chans);
}
catch (StkError& m) {
m.printMessage();
exit(0);
}
// Set playback rate here
input->setRate(atof(argv[2])/SRATE);
// Define and open the realtime output device
WvOut *output;
try {
output = new RtWvOut(chans);
}
catch (StkError& m) {
m.printMessage();
exit(0);
}
// Here's the runtime loop
while (!input->isFinished()) {
output->mtick(input->mtick());
}
// Clean up
delete input;
delete output;
}

166
projects/examples/streamInN.dsp Executable file
View File

@@ -0,0 +1,166 @@
# Microsoft Developer Studio Project File - Name="streamInN" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=streamInN - 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 "streamInN.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 "streamInN.mak" CFG="streamInN - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "streamInN - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "streamInN - 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)" == "streamInN - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "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 "..\..\include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__OS_Win_" /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 winmm.lib Wsock32.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "streamInN - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "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 "..\..\include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__OS_Win_" /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 winmm.lib Wsock32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "streamInN - Win32 Release"
# Name "streamInN - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\src\ByteSwap.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Object.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\RtAudio.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\RtWvOut.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\StkError.cpp
# End Source File
# Begin Source File
SOURCE=.\streamInN.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\StrmWvIn.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WvIn.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WvOut.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\include\ByteSwap.h
# End Source File
# Begin Source File
SOURCE=..\..\include\Object.h
# End Source File
# Begin Source File
SOURCE=..\..\include\RtAudio.h
# End Source File
# Begin Source File
SOURCE=..\..\include\RtWvOut.h
# End Source File
# Begin Source File
SOURCE=..\..\include\StkError.h
# End Source File
# Begin Source File
SOURCE=..\..\include\StrmWvIn.h
# End Source File
# Begin Source File
SOURCE=..\..\include\WvIn.h
# End Source File
# Begin Source File
SOURCE=..\..\include\WvOut.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

View File

@@ -0,0 +1,73 @@
/******************************************/
/*
Example program to output N channels of audio
data over an ethernet socket connection.
by Gary P. Scavone, 2000
This program is currently written to load
a WAV file for streaming. However, it is
simple to replace the instance of WavWvIn
with any other WvIn subclass.
The class StrmWvOut first attempts to
establish a socket connection to a socket
server running on port 2005. Thus, this
program needs to be started after the
streaming server.
*/
/******************************************/
#include "WavWvIn.h"
#include "StrmWvOut.h"
void usage(void) {
/* Error function in case of incorrect command-line
argument specifications
*/
printf("\nuseage: streamOutN N file host fs \n");
printf(" where N = number of channels,\n");
printf(" file = the .wav file to load,\n");
printf(" host = the hostname of the receiving app,\n");
printf(" and fs = the sample rate.\n\n");
exit(0);
}
int main(int argc, char *argv[])
{
// minimal command-line checking
if (argc != 5) usage();
int chans = (int) atoi(argv[1]);
// Define and load the SND soundfile
WvIn *input;
try {
input = new WavWvIn((char *)argv[2], "oneshot");
}
catch (StkError& m) {
m.printMessage();
exit(0);
}
// Set playback rate here
input->setRate(atof(argv[4])/SRATE);
// Define and open the realtime output device
WvOut *output;
try {
output = new StrmWvOut(2005, (char *)argv[3], chans);
}
catch (StkError& m) {
m.printMessage();
exit(0);
}
// Here's the runtime loop
while (!input->isFinished()) {
output->mtick(input->mtick());
}
// Clean up
delete input;
delete output;
}

158
projects/examples/streamOutN.dsp Executable file
View File

@@ -0,0 +1,158 @@
# Microsoft Developer Studio Project File - Name="streamOutN" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=streamOutN - 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 "streamOutN.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 "streamOutN.mak" CFG="streamOutN - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "streamOutN - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "streamOutN - 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)" == "streamOutN - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "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 /W3 /GX /O2 /I "..\..\include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__OS_Win_" /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 Wsock32.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "streamOutN - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "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 /W3 /Gm /GX /ZI /Od /I "..\..\include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__OS_Win_" /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 Wsock32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "streamOutN - Win32 Release"
# Name "streamOutN - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\src\ByteSwap.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\Object.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\StkError.cpp
# End Source File
# Begin Source File
SOURCE=.\streamOutN.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\StrmWvOut.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WavWvIn.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WvIn.cpp
# End Source File
# Begin Source File
SOURCE=..\..\src\WvOut.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\include\ByteSwap.h
# End Source File
# Begin Source File
SOURCE=..\..\include\Object.h
# End Source File
# Begin Source File
SOURCE=..\..\include\StkError.h
# End Source File
# Begin Source File
SOURCE=..\..\include\StrmWvOut.h
# End Source File
# Begin Source File
SOURCE=..\..\include\WavWvIn.h
# End Source File
# Begin Source File
SOURCE=..\..\include\WvIn.h
# End Source File
# Begin Source File
SOURCE=..\..\include\WvOut.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