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

Sound player issue #116

Closed
jdkennedy45 opened this issue Sep 20, 2020 · 31 comments
Closed

Sound player issue #116

jdkennedy45 opened this issue Sep 20, 2020 · 31 comments

Comments

@jdkennedy45
Copy link

jdkennedy45 commented Sep 20, 2020

$ npm start

nvidia-snatcher@1.4.0 start C:\Users\Jake\Documents\nvidia-snatcher
npm run build && node build/index.js

nvidia-snatcher@1.4.0 build C:\Users\Jake\Documents\nvidia-snatcher
rimraf ./build && tsc

INFO: Could not find files for the given pattern(s).
INFO: Could not find files for the given pattern(s).
INFO: Could not find files for the given pattern(s).
INFO: Could not find files for the given pattern(s).
INFO: Could not find files for the given pattern(s).
INFO: Could not find files for the given pattern(s).
INFO: Could not find files for the given pattern(s).
INFO: Could not find files for the given pattern(s).
[2:06:40 PM] info :: ✖ [amazon] still out of stock: pny xlr8
[2:06:41 PM] info :: ✖ [newegg] still out of stock: asus tuf
....

Hi I'm just confused on what this means. It prints it out every time I start the program. But the program seems to operate normally after..?

@jef
Copy link
Owner

jef commented Sep 20, 2020

Not sure what's going on here. Can you post your .env?

@m1se
Copy link

m1se commented Sep 20, 2020

Maybe its related to the naming of the .env file?

@jdkennedy45
Copy link
Author

jdkennedy45 commented Sep 20, 2020

DISCORD_NOTIFY_GROUP="@here"
DISCORD_WEB_HOOK="XXXXXXXXXXXXX"
EMAIL_USERNAME="XXXXXXXXXXXXXXXXXX"
EMAIL_PASSWORD="XXXXXXXXXXXXXXX"
HEADLESS="true"
LOG_LEVEL="info"
OPEN_BROWSER="true"
PAGE_TIMEOUT="30000"
PHONE_NUMBER="XXXXXXXXXXXXXXX"
PHONE_CARRIER="sprint"
PLAY_SOUND="C:\Users\Jake\Downloads\swiftly.mp3"
PUSHOVER_TOKEN="XXXXXXXXXXXXXX"
PUSHOVER_USER="XXXXXXXXXXXXXXX"
RATE_LIMIT_TIMEOUT="5000"
SHOW_ONLY_BRANDS="evga,zotac,aorus,asus,msi,gigabyte,pny"
SLACK_CHANNEL="SlackChannelName"
SLACK_TOKEN="slack-token"
STORES="bestbuy,bandh,nvidia,amazon,asus,evga,newegg"
SCREENSHOT="true"
TELEGRAM_ACCESS_TOKEN=""
TELEGRAM_CHAT_ID="1234"

Here is a pic of my folder structure with the .env
https://puu.sh/GuEME/66b0d5787f.png

@jef
Copy link
Owner

jef commented Sep 20, 2020

I don't think so. I removed my .env and also changed the name, no problems there.

@jef
Copy link
Owner

jef commented Sep 20, 2020

C:\Users\Jake\Downloads\swiftly.mp3 is more than likely you're problem. I would put that swiftly.mp3 file into the root of the nvidia-snatcher and change that variable to PLAY_SOUND=switfly.mp3.

@jdkennedy45
Copy link
Author

Changed that but didn't help anything.
I noticed on npm install I get a warning. Is this impacting it?

npm WARN eslint-import-resolver-webpack@0.12.2 requires a peer of webpack@>=1.11.0 but none is installed. You must install peer dependencies yourself.

@CrazyGiant
Copy link

I just tried to set it up today, getting the same issue. It does start to check stores after the INFO lines, but it only checks for evga cards?

@m1se
Copy link

m1se commented Sep 20, 2020

I just tried to set it up today, getting the same issue. It does start to check stores after the INFO lines, but it only checks for evga cards?

You need to edit the .env variable SHOW_ONLY_BRANDS, to include other brands, i.e msi, asus,evga or can leave it blank for it to report any card.

@jdkennedy45
Copy link
Author

My program seems to operate normally after the PATTERN INFO pop-ups. But I was just worried I configured something wrong.

@chuakc92
Copy link

I'm getting the same. But it is still checking for stock after the fact.

@jef
Copy link
Owner

jef commented Sep 20, 2020

https://imgur.com/a/iMxezEh

@chuakc92 based off your screenshot, I would remove the SLACK and TELEGRAM related variables as setting those to junk values could throw errors.

@chuakc92
Copy link

chuakc92 commented Sep 20, 2020

Responding to @kylekelso's question:
the mplayer still in a zip file. Do you have it elsewhere?

I didn't unzip it because I was unsure if it helps.

@kylekelso
Copy link

kylekelso commented Sep 20, 2020

@chuakc92 - It's what is used to play the file. The sound file is played through the command line interface so needs something like mplayer to play the sound.

Just leave the exe in the same path where the zip file is.

@chuakc92
Copy link

chuakc92 commented Sep 20, 2020

I removed Slack and Telegram variables and now I'm getting
playing sound
error playing sound: Error: Couldn't find a suitable audio player

@chuakc92
Copy link

@kylekelso Okay, let me go ahead and install it

@vp-regular
Copy link
Contributor

Per the play-sound documentation:

https://github.com/shime/play-sound

players – List of available audio players to check. Default:
mplayer
afplay
mpg123
mpg321
play
omxplayer
aplay
cmdmp3

Windows (at least 10) doesn't ship with any of these by default. If installing mplayer solves @chuakc92's issue, then looks like we'll need to find some sort of simpler solution for this.

@chuakc92
Copy link

I decided to give mpg123 a go instead of mplayer and placed all the files inside the root folder and it finally worked.

@chuakc92
Copy link

As an added note, after adding mpg123 to my root folder, my INFO: Could not find files for the given pattern(s). has decreased from 8 iterations to 2

@kylekelso
Copy link

@chuakc92 it's because mpg123 is 3rd on the list that @vp-cshow showed. The 2 that show errors are because mplayer and afplay don't exist for you and stops checking when mpg123 is found.

@vp-regular
Copy link
Contributor

vp-regular commented Sep 20, 2020

@kylekelso

Correct. The player has a setting to explicitly define what player to use, so if we distribute this with a player included, we can get rid of the log lines entirely.

It probably wasn't showing for jef because macOS ships with mplayer, @jef can you confirm once you get a chance?


Edit: Confirmed with a friend that mplayer doesn't come w/ macOS by default; I wonder...

@jef
Copy link
Owner

jef commented Sep 20, 2020

I can try some testing when I get back on my macOS and see what we need to do.

@jef
Copy link
Owner

jef commented Sep 20, 2020

Nope, not problems on macOS... I just pulled latest.

I also don't have mplayer

❯ where mplayer
mplayer not found

I do have afplay, though. Probably thats it. And Alpine Linux (other rig I use), probably had some dependency down the line.

Using afplay notification.mp3 worked.

@vp-regular
Copy link
Contributor

Any ideas then? First two ideas that I can think of are either redistribute a copy of one of the sound playing programs play-sound supports (probably not the cleanest idea...) or just open a youtube video instead (seems redundant since we're opening a page anyway).

@jef
Copy link
Owner

jef commented Sep 21, 2020

Well... Let me try on the windows computer and go from there.

@jef jef changed the title Pattern info, is this not an error? Sound player issue Sep 21, 2020
@kevhardy
Copy link

If you add additional player options to the play-sound library you can customize it to open any program you want as long as it can open via the command line. VLC does work through the command line but will require to you add it to your PATH to make it work anywhere. Here is a guide on how to add it to your path on Windows.

Once it's in your PATH, it should work find when you pass in that player to your play-sound library when you initialize is like so:

const player = playerLib({ player: 'vlc' });

This has worked for me so far, however it's not a very elegant solution considering you have to manually add the program of your choice to your PATH. This should work with windows media player as well but I have not tried it.

@scyto
Copy link

scyto commented Sep 21, 2020

Ok, here is what i see - there is one INFO: Could not find files for the given pattern(s). for each player I think.

If one copies cmdmp3win.exe to the root of the folder AND renames to cmdmp3.exe then you will go from having 8 errors to 7 errors - i don't know if this means the sound will play!

Maybe feature request is to say what player is being looked for and if no player is installed say no player installed. I have no idea how to code so cant contribute to doing that, sorry.

Link to player i got FWIW https://lawlessguy.wordpress.com/2015/06/27/update-to-a-command-line-mp3-player-for-windows/

@scyto
Copy link

scyto commented Sep 21, 2020

more info:

  • lack of any player executable generates 8 of these messages
  • if just an exe called mplayer.exe is present no errors are generated
  • if just an exe called omxplayer.exe is present only 5 of these errors are generated
  • if just an exe called cmdmp3.exe is present only 7 of these errors are generated

note the only one of these that is a real player was cmdmp3.exe - the rest were fake files.
i have no idea what this means, just more info as requested

@scyto
Copy link

scyto commented Sep 21, 2020

ok possible fix

download mplayer from here and either add to your path variables or extract contents into the root of you project http://mplayerwin.sourceforge.net/downloads.html

this was from shime/play-sound#39

no idea if it works, no idea how to force a test; i have both mplayer and cmdmp3 in root of my project now and all INFO messages have disappeared.

@jef jef closed this as completed Sep 21, 2020
@jef jef pinned this issue Sep 22, 2020
@jef jef unpinned this issue Sep 22, 2020
@Cturner44
Copy link

I decided to give mpg123 a go instead of mplayer and placed all the files inside the root folder and it finally worked.

i did this and i'm still getting error playing sound: Error: Couldn't find a suitable audio player

unzipped and extracted the mpg123 folder to the root nvidia-snatcher folder.

@MGraefe
Copy link

MGraefe commented Oct 23, 2020

ok possible fix

download mplayer from here and either add to your path variables or extract contents into the root of you project http://mplayerwin.sourceforge.net/downloads.html

For me just pasting the single mplayer.exe file into the root folder of nvidia-snatcher was enough, no need to copy all contents of the mplayer zip file.

@c-sarmiento
Copy link

For all those who have issues with audio notification on Windows, follow the instructions found here: https://github.com/jef/streetmerchant/wiki/Installation:-Windows#audio-notifications

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