mirror of
https://github.com/thestk/stk
synced 2026-04-20 06:26:55 +00:00
Version 4.3.1
This commit is contained in:
committed by
Stephen Sinclair
parent
27d9b79dc7
commit
d199342e86
@@ -32,7 +32,7 @@ void usage(void) {
|
||||
std::cout << " where sr = sample rate,\n";
|
||||
std::cout << " and rate = an optional playback rate.\n";
|
||||
std::cout << " (default = 1.0, can be negative)\n\n";
|
||||
exit(0);
|
||||
exit( 0 );
|
||||
}
|
||||
|
||||
// This tick() function handles sample computation only. It will be
|
||||
@@ -62,7 +62,7 @@ int main(int argc, char *argv[])
|
||||
if ( argc < 3 || argc > 4 ) usage();
|
||||
|
||||
// Set the global sample rate before creating class instances.
|
||||
Stk::setSampleRate( (StkFloat) atof(argv[2]) );
|
||||
Stk::setSampleRate( (StkFloat) atof( argv[2] ) );
|
||||
|
||||
// Initialize our WvIn and RtAudio pointers.
|
||||
RtAudio dac;
|
||||
@@ -72,14 +72,14 @@ int main(int argc, char *argv[])
|
||||
try {
|
||||
input.openFile( argv[1] );
|
||||
}
|
||||
catch (StkError &) {
|
||||
exit(0);
|
||||
catch ( StkError & ) {
|
||||
exit( 1 );
|
||||
}
|
||||
|
||||
// Set input read rate based on the default STK sample rate.
|
||||
double rate = 1.0;
|
||||
rate = input.getFileRate() / Stk::sampleRate();
|
||||
if ( argc == 4 ) rate *= atof(argv[3]);
|
||||
if ( argc == 4 ) rate *= atof( argv[3] );
|
||||
input.setRate( rate );
|
||||
|
||||
input.ignoreSampleRateChange();
|
||||
|
||||
Reference in New Issue
Block a user