qaac icon indicating copy to clipboard operation
qaac copied to clipboard

Wave64 not supported?

Open levicki opened this issue 6 months ago • 8 comments

This is weird and it might not be your code bug:

d:\TEST>qaac -q 2 -r keep -v 256 test.wav -o test.m4a
qaac 2.84, CoreAudioToolbox 7.10.9.0
ERROR: Not available input file format

Result is the same with 2.85. If it's of any help, iTunes installed is 12.13.7.1, Windows version is 10.0.19044.5965 (all x64).

Wave64 was saved from VirtualDub2 (wasn't even aware that it was not regular WAV at the time):

General
Complete name                            : D:\test.wav
Format                                   : Wave64
File size                                : 2.59 GiB
Duration                                 : 4 h 1 min
Overall bit rate mode                    : Constant
Overall bit rate                         : 1 536 kb/s
FileExtension_Invalid                    : w64

Audio
Format                                   : PCM
Format settings                          : Little / Signed
Codec ID                                 : 1
Duration                                 : 4 h 1 min
Bit rate mode                            : Constant
Bit rate                                 : 1 536 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 kHz
Bit depth                                : 16 bits
Stream size                              : 2.59 GiB (100%)

Tried using -i, no change. Also tried --verbose, got nothing more than that 1 cryptic error line.

Any help on how to workaround this issue would be appreciated.

levicki avatar Jun 14 '25 18:06 levicki

Found a workaround:

ffmpeg -i test.w64 -c:a copy test.wav

I have no idea why VirtualDub2 would save a file with .wav extension as Wave64 without asking and unnecessary in this case (2.59 GB < 4 GB).

levicki avatar Jun 14 '25 18:06 levicki

To load Wave64 files with qaac, libsndfile is required.

nu774 avatar Jun 15 '25 09:06 nu774

To load Wave64 files with qaac, libsndfile is required.

Can you please clarify whether a build of qaac with libsndfile included exists?

levicki avatar Jun 15 '25 22:06 levicki

https://github.com/nu774/qaac/wiki/Installation

nu774 avatar Jun 16 '25 08:06 nu774

https://github.com/nu774/qaac/wiki/Installation

My apololgies for not reading that beforehand.

Could perhaps the error message be improved to say that format is unavailable because of missing dll? If you don't want to consider it then the issue can be closed. Thanks for the help.

levicki avatar Jun 16 '25 09:06 levicki

Could perhaps the error message be improved to say that format is unavailable because of missing dll?

It's not as simple as it seems.

When qaac attempts to load a file, it doesn't make any assumptions about the file format. Instead, it tries all available input modules in sequence until one of them successfully parses the file. Even if one input module fails to read the file, that's usually just a normal indication that the format doesn't match what that module supports, so the error is ignored and the next module is tried. If none of the modules succeed after going through them all, qaac gives up.

As a result, the only thing qaac can determine in the end is the ambiguous fact that “none of its available modules were able to read the file.” The file itself may be in a supported format but corrupted in some way. Or perhaps the format isn't supported by qaac, or maybe the file could have been read if a certain DLL were installed. With the current implementation, there's no way to know the exact reason.

nu774 avatar Jun 16 '25 11:06 nu774

It's not as simple as it seems.

I am well aware of that.

// pseudo-code in C#
string[] modulenames = new string [] { "this.dll", "that.dll", "whatever.dll" };
List<string> failedmodules = new List<string>();
foreach (modulename in modulenames) {
    var dll = loadmodule(modulename);
    if (dll != null) {
        var file = dll.loadfile(filename);
        if (file != null) {
            // use the file
        } else {
            continue; // try next module
        }
    } else {
        failedmodules.add(modulename);
    }
}
if (failedmodules.Length != 0) {
    // print list of modules that failed to load indicating what you couldn't try to open the file with
}

I know that's not ideal, but at least it would point the user towards trying to obtain those modules.

levicki avatar Jun 16 '25 20:06 levicki

In qaac, DLLs like libsndfile are considered optional, meaning that failing to load them does not constitute an error.

The issue arises because, even if the user is fully aware that the file format is Wave64, qaac does not know it. As I have said, it blindly attempts to load the file with each input module, checking whether any succeed without knowing the file format.

Since qaac does not know the file format, it cannot inform the user that "libsndfile is required for Wave64 files".

nu774 avatar Jun 17 '25 00:06 nu774