Skip to content

Commit

Permalink
Change formats that wasapi exclusive tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Drewol committed Aug 8, 2020
1 parent f71fc3b commit 8bdc046
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions Audio/src/Windows/AudioOutput_WASAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,28 +203,27 @@ class AudioOutput_Impl

int numRates = 5;
long sampleRates[5] = {192000L, 96000L, 88200L, 48000L, 44100L};

int numDepths = 3;
int bitDepths[3] = {32, 24, 16 };

Vector<WAVEFORMATEX> allFormats;
for (size_t f = 0; f < numFormats; f++)
{
for (size_t d = 0; d < numDepths; d++)
WORD bitDepth = 16;
if (formats[f] == WAVE_FORMAT_IEEE_FLOAT)
{
bitDepth = 32;
}
for (size_t r = 0; r < numRates; r++)
{
for (size_t r = 0; r < numRates; r++)
{
long avgBytesPerSec = (bitDepths[d] / 8) * sampleRates[r] * 2;
WAVEFORMATEX newformat;
newformat.wFormatTag = formats[f];
newformat.nChannels = 2;
newformat.nSamplesPerSec = sampleRates[r];
newformat.nAvgBytesPerSec = avgBytesPerSec;
newformat.nBlockAlign = 4;
newformat.wBitsPerSample = bitDepths[d];
newformat.cbSize = 0;
allFormats.Add(newformat);
}
long avgBytesPerSec = (bitDepth / 8) * sampleRates[r] * 2;
WAVEFORMATEX newformat;
newformat.wFormatTag = formats[f];
newformat.nChannels = 2;
newformat.nSamplesPerSec = sampleRates[r];
newformat.nAvgBytesPerSec = avgBytesPerSec;
newformat.nBlockAlign = 4;
newformat.wBitsPerSample = bitDepth;
newformat.cbSize = 0;
allFormats.Add(newformat);
}
}

Expand Down

0 comments on commit 8bdc046

Please sign in to comment.