npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@sammachin/node-red-alexa-voice-service

v0.1.2

Published

Node-RED nodes for the Alexa Voice Service

Downloads

34

Readme

Node-RED Alexa Voice Service

This node will allow you to interact with the Alexa Voice Service (the same API that powers Echo devices) You send in a short audio clip and get an audio response. This audio can come from alsmost any source either the microphone, reading a local file or be generated using a separate Text to Speech Node.

Inputs

: payload (buffer) : the audio to send to the service. : dialogRequestId (string) : Where the audio is part of an existing dialog the ID from the previous response

Outputs

: payload (object) : the response from the Alexa Voice Service, certain objects will be binary audio buffers. : dialogRequestId (string) : the dialog ID either as was set on the input or a new random string.

AVS responds with a multipart object, the Node will parse this into a single object,

Details

msg.payload should be 16Khz PCM Mono audio, the node will attempt to convert any buffer input using ffmpeg but ideally you should capture in the correct format.

msg.dialogRequestId is used by AVS to assocaite multiple interactions within the same conversation, if you are starting a new dialog this does not need to be set on the input and the node will generate one. For replies it should match the previous response

AVS Endpoint is the avs server nearest to your application, Europe, US and Asia values are pre-set or advanced users can manually set this to another value.

The Access Token should usually be passed in as a parameter on the message object as these have a limited time to live, however you can also hard code it or reference a context object.

Convert Audio Output will set the format on all the response buffer objects to the same format either 22.05Khz Mono MP3 or 16Khz Mono WAV. Sometimes AVS responds with different bit rate samples in the same multipart response

Path to ffmpeg The node will attempt to intstall ffmpeg binaries for common platforms but if this does not work you can manually install for your system and reference the binary path here eg /usr/bib/ffmpeg

References

Amazon oAuth

The examples folder contains flows for obtaining an Access Token via oAuth which you need to pass to the AVS node. In order to use oAuth you need to obtain a set of credentials from Amazon. Make a note of these credentials as you will need to put them into the auth flow nodes. Make sure to record your Product ID, Client ID, and Client Secret.

  • Login at https://developer.amazon.com and go to Alexa then Your Alexa Consoles (top right) then Products.
  • Click Create Product.
  • You are at Product Information page.
    • For the Product ID and Product name use something like alexaweb or whatever you want.
    • For Product Type select Alexa-Enabled Device
    • For Category and Description enter whatever you want
    • All other fields can be filled out how you plan to use your AlexaPi
    • Next
  • You are at Security Profile page.
    • Click Create New Profile.
    • Choose whatever for Security Profile Name and Security Profile Description. Hit Next.
    • Under Web: (assuming you are running Node-RED on localhost port 1880)
      • Allowed Origins - put there http://localhost:1880,
      • Allowed Return URLs put http://localhost:1880/code,
  • You should now be at the devices page
  • Click Update.