Comments (3)
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.
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.
And it worked perfectly fine. Thanks!
from node-sonos-discovery.
Related Issues (20)
- If local endpoint changes, subscribe will keep failing to reconnect. HOT 6
- HTTPS Support in lib/helpers/request.js HOT 5
- Question about code, half seconds HOT 3
- BTW: Great project!
- UnhandledPromiseRejectWarning HOT 5
- Implement same features in Java/Android app HOT 4
- npm test fails on spotify HOT 2
- Support switch to Line In and TV HOT 6
- No Metadata when browsing SQ:4 HOT 3
- setting incorrect volume HOT 7
- Uncaught (in promise) TypeError: Cannot read property 'baseUrl' of undefined HOT 1
- Request: Soundbar Input Information
- error: sonos.0 TypeError: Cannot read property '$text' of undefined HOT 5
- How to update libary
- Unable to get state of player
- Audio Delay
- What are all the possible state changes? HOT 2
- Spotify: "Wrong" album art when playing from playlist
- GetFavorites does not return all favorites HOT 3
- exception in recalculateGroupVolume HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-sonos-discovery.