mirror of
https://github.com/cookiengineer/audacity
synced 2025-09-18 17:10:55 +02:00
Leland's fix for range bounds with Windows Direct Sound
This commit is contained in:
parent
0056b56c24
commit
6ffc5aca16
@ -1932,6 +1932,11 @@ wxArrayLong AudioIO::GetSupportedPlaybackRates(int devIndex, double rate)
|
|||||||
return supported;
|
return supported;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// LLL: Remove when a proper method of determining actual supported
|
||||||
|
// DirectSound rate is devised.
|
||||||
|
const PaHostApiInfo* hostInfo = Pa_GetHostApiInfo(devInfo->hostApi);
|
||||||
|
bool isDirectSound = (hostInfo && hostInfo->type == paDirectSound);
|
||||||
|
|
||||||
PaStreamParameters pars;
|
PaStreamParameters pars;
|
||||||
|
|
||||||
pars.device = devIndex;
|
pars.device = devIndex;
|
||||||
@ -1942,12 +1947,18 @@ wxArrayLong AudioIO::GetSupportedPlaybackRates(int devIndex, double rate)
|
|||||||
|
|
||||||
for (i = 0; i < NumRatesToTry; i++)
|
for (i = 0; i < NumRatesToTry; i++)
|
||||||
{
|
{
|
||||||
|
// LLL: Remove when a proper method of determining actual supported
|
||||||
|
// DirectSound rate is devised.
|
||||||
|
if (!(isDirectSound && RatesToTry[i] > 200000))
|
||||||
if (Pa_IsFormatSupported(NULL, &pars, RatesToTry[i]) == 0)
|
if (Pa_IsFormatSupported(NULL, &pars, RatesToTry[i]) == 0)
|
||||||
supported.Add(RatesToTry[i]);
|
supported.Add(RatesToTry[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (irate != 0 && supported.Index(irate) == wxNOT_FOUND)
|
if (irate != 0 && supported.Index(irate) == wxNOT_FOUND)
|
||||||
{
|
{
|
||||||
|
// LLL: Remove when a proper method of determining actual supported
|
||||||
|
// DirectSound rate is devised.
|
||||||
|
if (!(isDirectSound && RatesToTry[i] > 200000))
|
||||||
if (Pa_IsFormatSupported(NULL, &pars, irate) == 0)
|
if (Pa_IsFormatSupported(NULL, &pars, irate) == 0)
|
||||||
supported.Add(irate);
|
supported.Add(irate);
|
||||||
}
|
}
|
||||||
@ -1987,6 +1998,11 @@ wxArrayLong AudioIO::GetSupportedCaptureRates(int devIndex, double rate)
|
|||||||
gPrefs->Read(wxT("/AudioIO/LatencyDuration"), &latencyDuration);
|
gPrefs->Read(wxT("/AudioIO/LatencyDuration"), &latencyDuration);
|
||||||
gPrefs->Read(wxT("/AudioIO/RecordChannels"), &recordChannels);
|
gPrefs->Read(wxT("/AudioIO/RecordChannels"), &recordChannels);
|
||||||
|
|
||||||
|
// LLL: Remove when a proper method of determining actual supported
|
||||||
|
// DirectSound rate is devised.
|
||||||
|
const PaHostApiInfo* hostInfo = Pa_GetHostApiInfo(devInfo->hostApi);
|
||||||
|
bool isDirectSound = (hostInfo && hostInfo->type == paDirectSound);
|
||||||
|
|
||||||
PaStreamParameters pars;
|
PaStreamParameters pars;
|
||||||
|
|
||||||
pars.device = devIndex;
|
pars.device = devIndex;
|
||||||
@ -1997,12 +2013,18 @@ wxArrayLong AudioIO::GetSupportedCaptureRates(int devIndex, double rate)
|
|||||||
|
|
||||||
for (i = 0; i < NumRatesToTry; i++)
|
for (i = 0; i < NumRatesToTry; i++)
|
||||||
{
|
{
|
||||||
|
// LLL: Remove when a proper method of determining actual supported
|
||||||
|
// DirectSound rate is devised.
|
||||||
|
if (!(isDirectSound && RatesToTry[i] > 200000))
|
||||||
if (Pa_IsFormatSupported(&pars, NULL, RatesToTry[i]) == 0)
|
if (Pa_IsFormatSupported(&pars, NULL, RatesToTry[i]) == 0)
|
||||||
supported.Add(RatesToTry[i]);
|
supported.Add(RatesToTry[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (irate != 0 && supported.Index(irate) == wxNOT_FOUND)
|
if (irate != 0 && supported.Index(irate) == wxNOT_FOUND)
|
||||||
{
|
{
|
||||||
|
// LLL: Remove when a proper method of determining actual supported
|
||||||
|
// DirectSound rate is devised.
|
||||||
|
if (!(isDirectSound && RatesToTry[i] > 200000))
|
||||||
if (Pa_IsFormatSupported(&pars, NULL, irate) == 0)
|
if (Pa_IsFormatSupported(&pars, NULL, irate) == 0)
|
||||||
supported.Add(irate);
|
supported.Add(irate);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user