Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loudness doesn't works with "electron ." #22

Open
emilet16 opened this issue Jan 20, 2021 · 3 comments
Open

Loudness doesn't works with "electron ." #22

emilet16 opened this issue Jan 20, 2021 · 3 comments

Comments

@emilet16
Copy link

Loudness is a really nice lib. When I build it with "node .", it works well but if I build it using "electron ." (because I'm using it to make my app), it does nothing. How can I fix this?

@daunJung-dev
Copy link

It is same to me.
I build app by electron-builder with asar: "true" option. so, I extracted .exe file from this library by using afterPackHook

exports.default = async function (context) {
  var fs = require("fs");
  var path = require("path");
  var origin = path.join(
    context.appOutDir,
    "resources/app.asar.unpacked/node_modules/mwl-loudness/impl/windows/adjust_get_current_system_volume_vista_plus.exe"
  );
  var destiny = path.join(
    context.appOutDir,
    "resources/app.asar.unpacked/adjust_get_current_system_volume_vista_plus.exe"
  );
  fs.promises.copyFile(origin, destiny, console.log);
};

package.json

"build": {
   ...,
    "asar": true,
    "afterPack": "./afterPackHook.js",
  },

but it can't find file when released.
Is there any option to be replaced or fixed?

@maiguoheng
Copy link

I have the same problem when use in electron. To fix it ,i use myw-loudness instead and it works.

@fyt2018
Copy link

fyt2018 commented Mar 8, 2024

I have the same problem when use in electron.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants