60 static void PrintSupportedStandardSampleRates(
64 static double standardSampleRates[] = {
65 8000.0, 9600.0, 11025.0, 12000.0, 16000.0, 22050.0, 24000.0, 32000.0,
66 44100.0, 48000.0, 88200.0, 96000.0, 192000.0, -1
72 for( i=0; standardSampleRates[i] > 0; i++ )
79 printf(
"\t%8.2f", standardSampleRates[i] );
82 else if( printCount == 4 )
84 printf(
",\n\t%8.2f", standardSampleRates[i] );
89 printf(
", %8.2f", standardSampleRates[i] );
104 int i, numDevices, defaultDisplayed;
111 if( err != paNoError )
113 printf(
"ERROR: Pa_Initialize returned 0x%x\n", err );
123 printf(
"ERROR: Pa_GetDeviceCount returned 0x%x\n", numDevices );
128 printf(
"Number of devices = %d\n", numDevices );
129 for( i=0; i<numDevices; i++ )
132 printf(
"--------------------------------------- device #%d\n", i );
135 defaultDisplayed = 0;
138 printf(
"[ Default Input" );
139 defaultDisplayed = 1;
144 printf(
"[ Default %s Input", hostInfo->
name );
145 defaultDisplayed = 1;
150 printf( (defaultDisplayed ?
"," :
"[") );
151 printf(
" Default Output" );
152 defaultDisplayed = 1;
157 printf( (defaultDisplayed ?
"," :
"[") );
158 printf(
" Default %s Output", hostInfo->
name );
159 defaultDisplayed = 1;
162 if( defaultDisplayed )
168 wchar_t wideName[MAX_PATH];
169 MultiByteToWideChar(CP_UTF8, 0, deviceInfo->
name, -1, wideName, MAX_PATH-1);
170 wprintf( L
"Name = %s\n", wideName );
173 printf(
"Name = %s\n", deviceInfo->
name );
176 printf(
"Max inputs = %d", deviceInfo->maxInputChannels );
177 printf(
", Max outputs = %d\n", deviceInfo->maxOutputChannels );
180 printf(
"Default low output latency = %8.4f\n", deviceInfo->defaultLowOutputLatency );
182 printf(
"Default high output latency = %8.4f\n", deviceInfo->defaultHighOutputLatency );
188 long minLatency, maxLatency, preferredLatency, granularity;
191 &minLatency, &maxLatency, &preferredLatency, &granularity );
193 printf(
"ASIO minimum buffer size = %ld\n", minLatency );
194 printf(
"ASIO maximum buffer size = %ld\n", maxLatency );
195 printf(
"ASIO preferred buffer size = %ld\n", preferredLatency );
197 if( granularity == -1 )
198 printf(
"ASIO buffer granularity = power of 2\n" );
200 printf(
"ASIO buffer granularity = %ld\n", granularity );
205 printf(
"Default sample rate = %8.2f\n", deviceInfo->defaultSampleRate );
208 inputParameters.
device = i;
209 inputParameters.
channelCount = deviceInfo->maxInputChannels;
214 outputParameters.
device = i;
215 outputParameters.
channelCount = deviceInfo->maxOutputChannels;
222 printf(
"Supported standard sample rates\n for half-duplex 16 bit %d channel input = \n",
224 PrintSupportedStandardSampleRates( &inputParameters, NULL );
229 printf(
"Supported standard sample rates\n for half-duplex 16 bit %d channel output = \n",
231 PrintSupportedStandardSampleRates( NULL, &outputParameters );
236 printf(
"Supported standard sample rates\n for full-duplex 16 bit %d channel input, %d channel output = \n",
238 PrintSupportedStandardSampleRates( &inputParameters, &outputParameters );
244 printf(
"----------------------------------------------\n");
249 fprintf( stderr,
"Error number: %d\n", err );
PaError Pa_Initialize(void)
#define PaAsio_GetAvailableLatencyValues
PaTime defaultHighInputLatency
PaDeviceIndex Pa_GetDefaultInputDevice(void)
PaDeviceIndex Pa_GetDeviceCount(void)
ASIO-specific PortAudio API extension header file.
PaError Pa_IsFormatSupported(const PaStreamParameters *inputParameters, const PaStreamParameters *outputParameters, double sampleRate)
PaTime defaultLowInputLatency
void * hostApiSpecificStreamInfo
The portable PortAudio API.
PaDeviceIndex defaultInputDevice
PaSampleFormat sampleFormat
PaDeviceIndex defaultOutputDevice
const PaHostApiInfo * Pa_GetHostApiInfo(PaHostApiIndex hostApi)
const PaDeviceInfo * Pa_GetDeviceInfo(PaDeviceIndex device)
PaDeviceIndex Pa_GetDefaultOutputDevice(void)
#define paFormatIsSupported
const char * Pa_GetErrorText(PaError errorCode)
const PaVersionInfo * Pa_GetVersionInfo(void)
PaError Pa_Terminate(void)