Added patest_write_sine_nonint to Makefile.
Check for paNonInterleaved on Mac and return paSampleFormatNotSupported. Fix pa_minlat.c. Linux was complaining about not checking fgets return value.
This commit is contained in:
parent
7d8d647cfa
commit
7aad01a1d3
5 changed files with 49 additions and 25 deletions
|
|
@ -107,6 +107,7 @@ int main( int argc, char **argv )
|
|||
int framesPerBuffer;
|
||||
double sampleRate = 44100.0;
|
||||
char str[256];
|
||||
char *line;
|
||||
|
||||
printf("pa_minlat - Determine minimum latency for your computer.\n");
|
||||
printf(" usage: pa_minlat {userBufferSize}\n");
|
||||
|
|
@ -157,24 +158,34 @@ int main( int argc, char **argv )
|
|||
/* Ask user for a new nlatency. */
|
||||
printf("\nMove windows around to see if the sound glitches.\n");
|
||||
printf("Latency now %d, enter new number of frames, or 'q' to quit: ", outLatency );
|
||||
fgets( str, 256, stdin );
|
||||
{
|
||||
/* Get rid of newline */
|
||||
size_t l = strlen( str ) - 1;
|
||||
if( str[ l ] == '\n')
|
||||
str[ l ] = '\0';
|
||||
}
|
||||
if( str[0] == 'q' ) go = 0;
|
||||
else
|
||||
{
|
||||
outLatency = atol( str );
|
||||
if( outLatency < minLatency )
|
||||
{
|
||||
printf( "Latency below minimum of %d! Set to minimum!!!\n", minLatency );
|
||||
outLatency = minLatency;
|
||||
}
|
||||
}
|
||||
/* Stop sound until ENTER hit. */
|
||||
line = fgets( str, 256, stdin );
|
||||
if( line == NULL )
|
||||
{
|
||||
go = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
/* Get rid of newline */
|
||||
size_t l = strlen( str ) - 1;
|
||||
if( str[ l ] == '\n')
|
||||
str[ l ] = '\0';
|
||||
}
|
||||
|
||||
|
||||
if( str[0] == 'q' ) go = 0;
|
||||
else
|
||||
{
|
||||
outLatency = atol( str );
|
||||
if( outLatency < minLatency )
|
||||
{
|
||||
printf( "Latency below minimum of %d! Set to minimum!!!\n", minLatency );
|
||||
outLatency = minLatency;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
/* Stop sound until ENTER hit. */
|
||||
err = Pa_StopStream( stream );
|
||||
if( err != paNoError ) goto error;
|
||||
err = Pa_CloseStream( stream );
|
||||
|
|
|
|||
Loading…
Reference in a new issue