mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-03 07:51:16 -05:00
2c17544f3f
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/WSJT/trunk@1 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
37 lines
809 B
C
37 lines
809 B
C
// #include <stdio.h>
|
|
// #include <math.h>
|
|
#include "portaudio.h"
|
|
|
|
int __stdcall PADEVSUB(int *numdev, int *ndefin, int *ndefout,
|
|
int nchin[], int nchout[])
|
|
{
|
|
int i,j;
|
|
int numDevices;
|
|
const PaDeviceInfo *pdi;
|
|
PaError err;
|
|
|
|
Pa_Initialize();
|
|
numDevices = Pa_CountDevices();
|
|
*numdev=numDevices;
|
|
if( numDevices < 0 ) {
|
|
err = numDevices;
|
|
goto error;
|
|
}
|
|
|
|
for( i=0; i<numDevices; i++ ) {
|
|
pdi = Pa_GetDeviceInfo( i );
|
|
if(i == Pa_GetDefaultInputDeviceID()) *ndefin=i;
|
|
if(i == Pa_GetDefaultOutputDeviceID()) *ndefout=i;
|
|
nchin[i]=pdi->maxInputChannels;
|
|
nchout[i]=pdi->maxOutputChannels;
|
|
printf("Audio device %d: In=%d Out=%d %s\n",i,nchin[i],nchout[i],pdi->name);
|
|
}
|
|
|
|
Pa_Terminate();
|
|
return 0;
|
|
|
|
error:
|
|
Pa_Terminate();
|
|
return err;
|
|
}
|