use audic for sound playing

main
Ibraheem Saleh 10 months ago
parent 7bb2f4c062
commit b128d382e4

@ -1,7 +1,6 @@
import fetch from 'node-fetch';
import Aplay from 'node-aplay';
import { playAudioFile } from 'audic';
const url = 'https://www.bestbuy.com/gateway/graphql';
@ -60,10 +59,6 @@ let lines = 0;
let found = false;
let winningResult = null;
function playAlarm() {
new Aplay('alarm.wav').play();
}
async function fetchGraphQL(zip, store, query) {
const body = {
query,
@ -105,7 +100,7 @@ async function pollStore(zip, store) {
if (buttonState !== "SOLD_OUT") {
found = true;
winningResult = { skuId, zip, store, buttonState, data };
playAlarm()
await playAudioFile('./alarm.wav');
return winningResult;
}
} else {

2548
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -11,7 +11,7 @@
"license": "ISC",
"description": "",
"dependencies": {
"node-aplay": "^1.0.3",
"audic": "^3.0.2",
"node-fetch": "^3.3.2"
}
}

Loading…
Cancel
Save