ms-win-audio-error
Mooneer Salem 2024-04-13 12:09:10 -07:00
parent f9273d5607
commit 40bc9c0ea2
2 changed files with 22 additions and 6 deletions

View File

@ -417,7 +417,7 @@ if(NOT USE_STATIC_PORTAUDIO AND NOT USE_PULSEAUDIO)
message(FATAL_ERROR "portaudio library not found.
On Linux systems try installing:
portaudio-devel (RPM based systems)
libportaudio-dev (DEB based systems)
portaudio19-dev (DEB based systems)
On Windows it's easiest to use the cmake option: USE_STATIC_PORTAUDIO"
)
endif()

View File

@ -178,10 +178,26 @@ std::vector<int> PortAudioEngine::getSupportedSampleRates(wxString deviceName, A
int rateIndex = 0;
while (IAudioEngine::StandardSampleRates[rateIndex] != -1)
{
PaError err = Pa_IsFormatSupported(
PaError err = paFormatIsSupported;
bool isDeviceWithKnownMinimum =
!strcmp(deviceName, "sysdefault") ||
!strcmp(deviceName, "front") ||
!strcmp(deviceName, "surround") ||
!strcmp(deviceName, "samplerate") ||
!strcmp(deviceName, "speexrate") ||
!strcmp(deviceName, "pulse") ||
!strcmp(deviceName, "upmix") ||
!strcmp(deviceName, "vdownmix") ||
!strcmp(deviceName, "dmix") ||
!strcmp(deviceName, "default");
if (!isDeviceWithKnownMinimum)
{
err = Pa_IsFormatSupported(
direction == AUDIO_ENGINE_IN ? &streamParameters : NULL,
direction == AUDIO_ENGINE_OUT ? &streamParameters : NULL,
IAudioEngine::StandardSampleRates[rateIndex]);
}
if (err == paFormatIsSupported)
{