Skip to content

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

Open

Description

@emilet16

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?

Activity

  1. daunJung-dev commented on Nov 23, 2021

    @daunJung-dev

    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?

  2. maiguoheng commented on Aug 30, 2022

    @maiguoheng

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

  3. fyt2018 commented on Mar 8, 2024

    @fyt2018

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions