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

Beep not working on Windows10 #38

Open
AL202020 opened this issue Apr 21, 2020 · 0 comments
Open

Beep not working on Windows10 #38

AL202020 opened this issue Apr 21, 2020 · 0 comments

Comments

@AL202020
Copy link

AL202020 commented Apr 21, 2020

Not sure this is an issue for everyone but I found out the beep was not working and the code is not throwing the exception in the finder.js. After checking it and forcing the exception by adding if (err) throw err I found the following...

Error: Couldn't find a suitable audio player
    at Play.play (c:\Temp\delivery-finder\node_modules\play-sound\index.js:34:19)
    at Object.<anonymous> (c:\Temp\delivery-finder\sound.js:4:8)
    at Module._compile (internal/modules/cjs/loader.js:1185:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
    at Module.load (internal/modules/cjs/loader.js:1034:32)
    at Function.Module._load (internal/modules/cjs/loader.js:923:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47

If you want to use the windows default player you have to fix the \node_modules\play-sound\index.js while adding 'powershell' as per updated on the https://github.com/shime/play-sound/pull/33/files :

var fs               = require('fs')
  , findExec         = require('find-exec')
  , spawn            = require('child_process').spawn
  , players          = [
                        'mplayer',
                        'afplay',
                        'mpg123',
                        'mpg321',
                        'play',
                        'omxplayer',
                        'aplay',
                        'cmdmp3',
			'powershell'
                         ]

Additionally you will need to use the full path in delivery-finder\finder.js e.g.:

function beep () {
  player.play('C:\\temp\\delivery-finder\\beep.mp3', function (err) {
    
  })
}

or

function beep () {
  player.play('./beep.mp3', function (err) {
    
  })
}

After that it should work where it will launch the default windows player application and play the sound


Alternatively, another easy option to the changes above mentioned / default windows player is to use the cmdmp3 (https://github.com/jimlawless/cmdmp3) and have installed on the same folder as your finder.js

May mention this on the documentation for windows users ;)

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

1 participant