diff data/fileio/test/AudioFileReaderTest.h @ 1605:d83ab62cdc28

Merge from branch bqaudiostream
author Chris Cannam
date Wed, 30 Jan 2019 14:57:12 +0000
parents 6d9881e59cc2
children dbd13eb7dad1
line wrap: on
line diff
--- a/data/fileio/test/AudioFileReaderTest.h	Wed Jan 09 15:24:38 2019 +0000
+++ b/data/fileio/test/AudioFileReaderTest.h	Wed Jan 30 14:57:12 2019 +0000
@@ -98,6 +98,11 @@
                 maxLimit = 0.1;
                 rmsLimit = 0.03;
 
+            } else if (format == "opus") {
+
+                maxLimit = 0.06;
+                rmsLimit = 0.015;
+
             } else if (format == "aac") {
 
                 // Terrible performance for this test, load of spill
@@ -109,6 +114,11 @@
                 maxLimit = 0.2;
                 rmsLimit = 0.1;
 
+            } else if (format == "wma") {
+
+                maxLimit = 0.05;
+                rmsLimit = 0.01;
+
             } else if (format == "mp3") {
 
                 if (resampled && !gapless) {
@@ -148,11 +158,21 @@
                 maxLimit = 0.06;
                 rmsLimit = 0.03;
 
+            } else if (format == "opus") {
+
+                maxLimit = 0.06;
+                rmsLimit = 0.015;
+
             } else if (format == "aac") {
 
-                maxLimit = 0.1;
+                maxLimit = 0.2;
                 rmsLimit = 0.1;
 
+            } else if (format == "wma") {
+
+                maxLimit = 0.05;
+                rmsLimit = 0.01;
+
             } else if (format == "mp3") {
 
                 // all mp3 figures are worse when not normalising
@@ -217,9 +237,35 @@
                     for (bool norm: norms) {
                         for (bool gapless: gaplesses) {
 
-                            if (format != "mp3" && !gapless) {
-                                continue;
+#ifdef Q_OS_WIN
+                            if (format == "aac") {
+                                if (gapless) {
+                                    // Apparently no support for AAC
+                                    // encoder delay compensation in
+                                    // MediaFoundation, so these tests
+                                    // are only available non-gapless
+                                    continue;
+                                }
+                            } else if (format != "mp3") {
+                                if (!gapless) {
+                                    // All other formats but mp3 are
+                                    // intrinsically gapless, so we
+                                    // can skip the non-gapless option
+                                    continue;
+                                }
                             }
+#else
+                            if (format != "mp3") {
+                                if (!gapless) {
+                                    // All other formats but mp3 are
+                                    // intrinsically gapless
+                                    // everywhere except for Windows
+                                    // (see above), so we can skip the
+                                    // non-gapless option
+                                    continue;
+                                }                                    
+                            }
+#endif
                         
                             QString desc = testName
                                 (format, filename, rate, norm, gapless);
@@ -295,7 +341,9 @@
 
         bool perceptual = (extension == "mp3" ||
                            extension == "aac" ||
-                           extension == "m4a");
+                           extension == "m4a" ||
+                           extension == "wma" ||
+                           extension == "opus");
         
         if (perceptual && !gapless) {
             // allow silence at start and end
@@ -372,7 +420,11 @@
             // "something else" otherwise.
             
             if (gapless) {
-                if (format == "aac") {
+                if (format == "aac"
+#ifdef Q_OS_WIN
+                    || (format == "mp3" && (readRate != fileRate))
+#endif
+                    ) {
                     // ouch!
                     if (offset == -1) offset = 0;
                 }