melchor629 / node-flac-bindings

Nodejs bindings to libFLAC
ISC License
17 stars 1 forks source link

Can't instantiate flac.FileDecoder #14

Closed tobq closed 4 years ago

tobq commented 4 years ago
        this._dec = new flac.Decoder();
                    ^
TypeError: flac.Decoder is not a constructor
    at new FlacFileDecoder (node_modules\flac-bindings\lib\decoder.js:187:21)

Packages:

    "typescript": "^3.9.5",
    "flac-bindings": "^2.2.0",
melchor629 commented 4 years ago

Hi, did you ensured the FLAC library is on the path? You can also load libFLAC manually with flac.load('path/to/the/libFLAC.dll')

tobq commented 4 years ago

@melchor629 I have the official flac binaries in my path. Where do I find this libFLAC dll you refer to?

melchor629 commented 4 years ago

This node package uses the library flac.dll (or libflac.dll) only, not the executables. Look if the DLL is between the executables, if not look for it on google (a quick look I found this page that has a download for libFLAC.dll).

melchor629 commented 4 years ago

try the latest version 2.4.0, it should not require the libflac.dll anymore

tobq commented 4 years ago

try the latest version 2.4.0, it should not require the libflac.dll anymore

Are you making it use the flac executable now? I think that would be smart. I did something similar.

melchor629 commented 4 years ago

Nop, it now includes libflac.dll inside the prebuilt library so it does not require any external libflac.dll (which is way faster than calling flac.exe all the time).

In case you are in a platform with no precompiled library, it will download the sources of flac and compile them alongside this package.

tobq commented 4 years ago

Interesting, I've never played with the node-C++ stuff myself

melchor629 commented 4 years ago

There are a lot of tricks someone can do with C/C++ and the right build files.

On the other hand, with the latest update, are you able to properly use the library? If so, feel free to close the issue :)

melchor629 commented 4 years ago

Closing due to inactivity