Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
alexa-voice-service
Advanced tools
Library for interacting with Alexa Voice Service (AVS) in the browser.
Please ping me if you'd like to take over this library since I've been out of the loop with Alexa/AVS. Thanks!
Things you can do with this library:
The audio recorded in this library is mono channel, sampled at 16k Hz, and signed 16 bit PCM encoding which is required by AVS.
https://lab.miguelmota.com/alexa-voice-service
npm install alexa-voice-service
Follow these steps to run demo locally:
git clone git@github.com:miguelmota/alexa-voice-service.js.git
cd alexa-voice-service.js/example/
npm install
npm start
open https://localhost:9745
More info in the example README.
const AVS = require('alexa-voice-service');
const avs = new AVS(options);
Please check out example as noted above.
Most methods return a promise.
AVS(options) - constructor
options:
debug - {boolean} logs to console
clientId - {string} AVS client id found in portal
clientSecret - {string} AVS client secret found in portal. Only needed if using `code` response type.
deviceId - {string} AVS device Id found in portal
deviceSerialNumber - {number} serial number for this device (can be made up)
redirectUri - {string} redirect uri set in portal
avs.login({responseType: 'code, token (default)', newWindow: false}) -> promise(response);
avs.promptUserLogin() -> alias to login();
avs.logout() -> promise();
avs.getTokenFromUrl() -> promise(token);
avs.getCodeFromUrl() -> promise(code);
avs.getTokenFromCode(code) -> promise(response);
avs.getTokenFromRefreshToken(refreshToken) -> promise(token)
avs.refreshToken() -> promise({token, refreshToken})
avs.getToken() -> promise(token)
avs.getRefreshToken() -> promise(refreshToken)
avs.requestMic() -> promise(stream);
avs.connectMediaStream(stream) -> promise;
avs.stopRecording() -> promise;
avs.startRecording() -> promise;
avs.sendAudio(dataView) -> promise(response); - send audio to AVS and get back an object containing response.
The response object is the parsed http message.
avs.audioToBlob(AudioBuffer | DataView) -> promise(blob) - mp3 blob
avs.on(identifier, callback)
identifiers (found under AVS.EventTypes object)
LOG - when a log occurs.
ERROR - when an error occurs.
LOGIN - when user is logged in.
LOGOUT - when user is logged out.
RECORD_START - when recording is started.
RECORD_STOP - when recording is stopped.
TOKEN_SET - when token is set.
REFRESH_TOKEN_SET - when refresh token is set.
TOKEN_INVALID - when token is invalid, usually because it is expired.
example: avs.on(AVS.EventTypes.LOG, callback)
# Player
avs.player.enqueue(dataView|typedArray|arrayBuffer|url) -> promise(arraybuffer) - add an audio source to play queue. Converts input to AudioBuffer.
avs.player.deque() -> promise() - dequeu an audio source to play
avs.player.play() -> promise() - play next source in queue
avs.player.stop() -> promise() - stop playing
avs.player.replay() -> promise() - replay last audio source played
avs.player.pause() -> promise() - pause playing
avs.player.emptyQueue() -> promise() - empty the queue
avs.player.playBlob(blob) -> promise(blob) - play a blob source
avs.player.playAudioBuffer(audioBuffer) -> promise() - play an AudioBuffer source
avs.player.playUrl(url) -> promise(url) - play mp3 url
avs.player.on(identifier, callback)
identifiers (found under AVS.Player.EventTypes object)
LOG - when a debug log occurs
ERROR - when an error occurs
PLAY - when audio source is played
REPLAY - when audio source is replayed
PAUSE - when audio source is paused
STOP - when audio source is stopped playing
ENQUEUE - when an audio source is added to queue
DEQUE - when an audio source is removed from queue
MIT
FAQs
Alexa Voice Service wrapper for the browser.
We found that alexa-voice-service demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.