@@ -85,10 +85,9 @@ void writeTestAudioFile (int numChannels, int sampleRate, int bitDepth, AudioFil
8585 REQUIRE (OK);
8686
8787 // -----------------------------------------------------------------
88- // for some key bit depths and mono/stereo files, read in the audio file
89- // we just wrote and do a sample-by-sample comparison to confirm we are
90- // writing good files
91- if ((bitDepth == 8 || bitDepth == 16 || bitDepth == 24 ) && numChannels <= 2 )
88+ // read in the audio file we just wrote and do a sample-by-sample
89+ // comparison to confirm we are writing good files
90+ if (numChannels <= 2 )
9291 {
9392 AudioFile<T> audioFileReader;
9493 audioFileReader.load (filePath);
@@ -136,13 +135,38 @@ TEST_SUITE ("Writing Tests")
136135 for (auto & format : audioFormats)
137136 {
138137 auto fmt_str = format == AudioFileFormat::Wave ? " wav" : " aiff" ;
139- std::cerr << sampleRate << " Hz " << bitDepth << " -bit " << channels << " " << fmt_str << " (floating point )" << std::endl;
138+ std::cerr << sampleRate << " Hz " << bitDepth << " -bit " << channels << " " << fmt_str << " (float )" << std::endl;
140139 writeTestAudioFile<float > (channels, sampleRate, bitDepth, format);
141140 }
142141 }
143142 }
144143 }
145144 }
145+
146+ // =============================================================
147+ TEST_CASE (" WritingTest::WriteSineToneToManyFormats::DoublePrecision" )
148+ {
149+ std::vector<int > sampleRates = {22050 , 44100 , 48000 , 96000 };
150+ std::vector<int > bitDepths = {8 , 16 , 24 , 32 };
151+ std::vector<int > numChannels = {1 , 2 , 8 };
152+ std::vector<AudioFileFormat> audioFormats = {AudioFileFormat::Wave, AudioFileFormat::Aiff};
153+
154+ for (auto & sampleRate : sampleRates)
155+ {
156+ for (auto & bitDepth : bitDepths)
157+ {
158+ for (auto & channels : numChannels)
159+ {
160+ for (auto & format : audioFormats)
161+ {
162+ auto fmt_str = format == AudioFileFormat::Wave ? " wav" : " aiff" ;
163+ std::cerr << sampleRate << " Hz " << bitDepth << " -bit " << channels << " " << fmt_str << " (double)" << std::endl;
164+ writeTestAudioFile<double > (channels, sampleRate, bitDepth, format);
165+ }
166+ }
167+ }
168+ }
169+ }
146170
147171 // =============================================================
148172 TEST_CASE (" WritingTest::WriteSineToneToManyFormats::Integer" )
0 commit comments