comparison data/fileio/test/AudioFileReaderTest.h @ 1359:1c9bbbb6116a 3.0-integration

Use W64 instead of WAV for decoded files; use Ogg reader in preference to WAV one for Ogg files (WAV reader works, via libsndfile, but doesn't load metadata); fix Ogg reader to use QFile open instead of non-Win32-compatible API; add more encoder tests, audio writer test, midi reader test
author Chris Cannam
date Tue, 10 Jan 2017 10:58:25 +0000
parents 75ad55315db4
children aadfb395e933
comparison
equal deleted inserted replaced
1358:b7be05d57f0a 1359:1c9bbbb6116a
45 AudioFileReaderTest(QString base) { 45 AudioFileReaderTest(QString base) {
46 if (base == "") { 46 if (base == "") {
47 base = "svcore/data/fileio/test"; 47 base = "svcore/data/fileio/test";
48 } 48 }
49 testDirBase = base; 49 testDirBase = base;
50 audioDir = base + "/testfiles"; 50 audioDir = base + "/audio";
51 diffDir = base + "/diffs"; 51 diffDir = base + "/diffs";
52 } 52 }
53 53
54 private: 54 private:
55 const char *strOf(QString s) { 55 const char *strOf(QString s) {
387 diffFile.replace(".", "_"); 387 diffFile.replace(".", "_");
388 diffFile.replace(" ", "_"); 388 diffFile.replace(" ", "_");
389 diffFile += ".wav"; 389 diffFile += ".wav";
390 diffFile = QDir(diffDir).filePath(diffFile); 390 diffFile = QDir(diffDir).filePath(diffFile);
391 WavFileWriter diffWriter(diffFile, readRate, channels, 391 WavFileWriter diffWriter(diffFile, readRate, channels,
392 WavFileWriter::WriteToTarget); //!!! NB WriteToTemporary not working, why? 392 WavFileWriter::WriteToTemporary);
393 QVERIFY(diffWriter.isOK()); 393 QVERIFY(diffWriter.isOK());
394 394
395 vector<vector<float>> diffs(channels); 395 vector<vector<float>> diffs(channels);
396 for (int c = 0; c < channels; ++c) { 396 for (int c = 0; c < channels; ++c) {
397 for (int i = 0; i < refFrames; ++i) { 397 for (int i = 0; i < refFrames; ++i) {