GithubHelp home page GithubHelp logo

Comments (3)

jishi avatar jishi commented on July 17, 2024

If you append the apikey to your URL, I don't see why voicerss would complain. With that said, you should perhaps consider downloading the mp3 locally, and serve it from the same machine that you run your code with. This has a few advantages:

You can keep the mp3 file for a certain phrase so you don't need to hit voicerss, and it will be served faster on subsequent requests.

You will have full control of the actual request invoked to the TTS api, for setting custom user-agent, header based authentication etc. This gives you some more flexibility

There is no way to control how Sonos will request the mp3 file, and you will be limited to the support they provide. One reason why this might not work for you, is that Sonos will look at the url, or namely the "suffix" of the url to make out what kind of encoding it has. If the url doesn't end in ".mp3", it will not treat it as such. You can mitigate that by locally storing it, or if you proxy the request and spoof a "correct" url.

What I have been doing is calculating a SHA1 hash of the phrase, then fetch and store it with that hash as filename. Then I serve it from a static web server (I usually use "node-static" npm module for it, but express would give the same functionality).

from node-sonos-discovery.

tholu avatar tholu commented on July 17, 2024

Thanks for your detailled answer! voicerss does not complain, but Sonos just doesn't play it. Maybe it's the .mp3 ending. I will try to locally store and serve it again with .mp3 at the end. Do you have the code you use at Github somewhere?

from node-sonos-discovery.

tholu avatar tholu commented on July 17, 2024

And it worked perfectly fine. Thanks!

from node-sonos-discovery.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.