Skip to content

Commit

Permalink
update pa_devs.c example
Browse files Browse the repository at this point in the history
  • Loading branch information
Spacechild1 committed Oct 20, 2024
1 parent 3f617e9 commit 0801268
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions examples/pa_devs.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,11 @@ int main(void)
{ /* Use wide char on windows, so we can show UTF-8 encoded device names */
wchar_t wideName[MAX_PATH];
MultiByteToWideChar(CP_UTF8, 0, deviceInfo->name, -1, wideName, MAX_PATH-1);
#if __USE_MINGW_ANSI_STDIO
wprintf( L"Name = %S\n", wideName );
#else
wprintf( L"Name = %s\n", wideName );
#endif
}
#else
printf( "Name = %s\n", deviceInfo->name );
Expand All @@ -186,6 +190,7 @@ int main(void)
/* ASIO specific latency information */
if( Pa_GetHostApiInfo( deviceInfo->hostApi )->type == paASIO ){
long minLatency, maxLatency, preferredLatency, granularity;
double currentSampleRate;

err = PaAsio_GetAvailableLatencyValues( i,
&minLatency, &maxLatency, &preferredLatency, &granularity );
Expand All @@ -198,6 +203,9 @@ int main(void)
printf( "ASIO buffer granularity = power of 2\n" );
else
printf( "ASIO buffer granularity = %ld\n", granularity );

err = PaAsio_GetSampleRate( i, &currentSampleRate );
printf( "ASIO current sample rate = %8.2f\n", currentSampleRate);
}
#endif /* PA_USE_ASIO */
#endif /* WIN32 */
Expand Down

0 comments on commit 0801268

Please sign in to comment.