changeset 1603:6d9881e59cc2 bqaudiostream

WMA test cases
author Chris Cannam
date Wed, 30 Jan 2019 14:30:49 +0000
parents 08a389e96582
children 8aa1447fe27e
files data/fileio/test/AudioFileReaderTest.h data/fileio/test/audio/wma/44100-2.wma data/fileio/test/encodings/Tëmple of Spörks.wma
diffstat 3 files changed, 45 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/data/fileio/test/AudioFileReaderTest.h	Wed Jan 30 11:00:54 2019 +0000
+++ b/data/fileio/test/AudioFileReaderTest.h	Wed Jan 30 14:30:49 2019 +0000
@@ -114,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) {
@@ -160,9 +165,14 @@
 
             } 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
@@ -227,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);
@@ -306,6 +342,7 @@
         bool perceptual = (extension == "mp3" ||
                            extension == "aac" ||
                            extension == "m4a" ||
+                           extension == "wma" ||
                            extension == "opus");
         
         if (perceptual && !gapless) {
@@ -383,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;
                 }
Binary file data/fileio/test/audio/wma/44100-2.wma has changed
Binary file data/fileio/test/encodings/Tëmple of Spörks.wma has changed