Updated PitShift to use a single delay line and updated effects.cpp for new RtAudio API.

This commit is contained in:
garyscavone
2023-08-04 10:14:26 -04:00
parent 8b29e0ea6d
commit 7f97ab5f71
3 changed files with 15 additions and 30 deletions

View File

@@ -228,7 +228,7 @@ int main( int argc, char *argv[] )
// If you want to change the default sample rate (set in Stk.h), do
// it before instantiating any objects! If the sample rate is
// specified in the command line, it will override this setting.
Stk::setSampleRate( 44100.0 );
Stk::setSampleRate( 48000.0 );
// Parse the command-line arguments.
unsigned int port = 2001;
@@ -253,11 +253,8 @@ int main( int argc, char *argv[] )
iparameters.deviceId = adac.getDefaultInputDevice();
iparameters.nChannels = 1;
unsigned int bufferFrames = RT_BUFFER_SIZE;
try {
adac.openStream( &oparameters, &iparameters, format, (unsigned int)Stk::sampleRate(), &bufferFrames, &tick, (void *)&data );
}
catch ( RtAudioError& error ) {
error.printMessage();
if ( adac.openStream( &oparameters, &iparameters, format, (unsigned int)Stk::sampleRate(), &bufferFrames, &tick, (void *)&data ) ) {
std::cout << adac.getErrorText() << std::endl;
goto cleanup;
}
@@ -267,11 +264,8 @@ int main( int argc, char *argv[] )
(void) signal( SIGINT, finish );
// If realtime output, set our callback function and start the dac.
try {
adac.startStream();
}
catch ( RtAudioError &error ) {
error.printMessage();
if ( adac.startStream() ) {
std::cout << adac.getErrorText() << std::endl;
goto cleanup;
}
@@ -282,12 +276,7 @@ int main( int argc, char *argv[] )
}
// Shut down the output stream.
try {
adac.closeStream();
}
catch ( RtAudioError& error ) {
error.printMessage();
}
adac.closeStream();
cleanup: