Comments (3)
Leider hat die Yamaha API kein Interface ähnlich text2speech wie es bei Sonos geht. Ideen hatte ich da schon, aber es braucht umfangreiches (reverse)-engineering.
from iobroker.musiccast.
Es geht evtl. doch wenn es einen DLNA Server im Netzwerk gibt. Dann kann man sich durch die Verzeichnisse hangeln und dann eine Datei abspielen. Sehr umständlich, aber geht.
Arbeite gerade an einer simplen Implementierung.
Mir schwebt eher ein Befehl playFile=datei.mp3 vor, aber da sind wir weit entfernt.
from iobroker.musiccast.
Also es geht mit etwas scripting und nodejs8.
Zuvor ist über Browser zu ermitteln welchen Index man jeweils zum erreichen des mp3 benötigt.
Dazu die folgenden Befehle benutzen:
am Anfang dies nur 1x
http://IP/YamahaExtendedControl/v1/main/setInput?input=server&mode=autoplay_disabled
zum Anfang mit index 0 und später mit anderem index, zur Auswahl der nächsten Stufe
http://IP/YamahaExtendedControl/v1/netusb/setListControl?list_id=main&type=select&index=0
zur Anzeige des Verzeichnisses mit dem index, den man gerade gewählt hat
http://IP/YamahaExtendedControl/v1/netusb/getListInfo?input=server&index=0&size=8&lang=de
zum Abspielen des Songs mit dem entsprechenden Index
http://IP/YamahaExtendedControl/v1/netusb/setListControl?list_id=main&type=play&index=0
In meinem Fall ist es 5mal der select Aufruf und dann der Song ->0,0,0,0,0,0
var YamahaYXC = require('yamaha-yxc-nodejs');
yamaha = new YamahaYXC('IP'); //deine IP
var cmd = [0,0,0,0,0,0]; // hier die Abfolge aus dem vorherigen Test eintragen
var file = cmd.pop();
function setDisable() {
return new Promise(resolve => {
yamaha.setInput('server','main','autoplay_disabled').then(function (result) {
if (JSON.parse(result).response_code === 0) {
console.log('disable success ' + result);
resolve();
}
else { console.log('set disable bad '+result); }
resolve();
});
});
}
function listDir(index) {
return new Promise(resolve => {
yamaha.getListInfo('server', index, '8', 'en').then(function (result) {
if (JSON.parse(result).response_code === 0) {
console.log('list dir success '+index + result);
}
else { console.log('listDir bad ' + result); }
resolve();
});
});
}
function changeDir(index){
return new Promise(resolve => {
yamaha.setListControl('main','select',index).then(function(result) {
if (JSON.parse(result).response_code === 0 ){
console.log('dir change success ' +index+ result);
}
else {console.log('dir change bad '+ result);}
resolve();
});
})
}
function playFile(song){
return new Promise(resolve => {
yamaha.setListControl('main','play',song).then(function(result) {
if (JSON.parse(result).response_code === 0 ){
console.log('play file success' + song + result);
resolve();
}
else {console.log('playFile bad' + result);}
resolve();
});
});
}
function backToStart(cmd){
return new Promise(resolve => {
yamaha.setListControl('main','return').then(function(result) {
if (JSON.parse(result).response_code === 0 ){
console.log('rezurn success' + result);
}
else {console.log('return gone bad' + result);}
resolve();
});
});
}
async function playSong() {
await setDisable();
for(item in cmd){
if(item === 0){await listDir(0)}
else{await listDir(cmd[item-1]);}
await changeDir(cmd[item]);
if(item === cmd.length){}
else{await listDir(cmd[item]);}
}
await playFile(file);
}
playSong();
from iobroker.musiccast.
Related Issues (20)
- State Xy has no existing object, this might lead to an error in future versions HOT 20
- Compatibility check to js-controller 4.0
- Crash after update from 0.2.2 to 1.0.1 HOT 4
- Changing input not working on YAS-306 HOT 3
- Musiccast + Alexa "Musiccast Skill" HOT 2
- Adapter crashing when adding MC link source HOT 14
- Update stable to 0.1.x HOT 1
- Update stable version in repo to 0.1.3 HOT 1
- Update stable version in repo from 0.0.8 to 0.1.3 HOT 1
- Cannot read property 'preset' of undefined HOT 3
- ständiger Adapter Neustart bei Nichterreichbarkeit HOT 4
- Spielzeit update obwohl deaktiviert HOT 1
- musiccast startet ständig neu.
- js-controller 3.2.x - has no existing object HOT 18
- Update stable version in repo from 0.1.3 to 0.1.5 HOT 1
- Please formulate your CSS instructions more specifically HOT 2
- Can't set *.max_volume - ist it possible to make it write able? HOT 5
- Compatibility check to js-controller 3.3 and Admin5 React UI
- Compatibility check and testing for Node.js 14 and 16
- Keine Verbindung mehr mit Geräten nach Firmware Update von 2.15 -> 2.16 (ISX und WX 010) HOT 8
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 iobroker.musiccast.