我目前正在研究将公告系统集成到sonos中的可能性,但是还没有找到一个合理的方法,并且已经开始怀疑它是否是可能的。
我最初的做法是让歌曲订阅一家电台,该电台将不断发布公告。在用这个设置进行测试之后,我无法得到3秒以下的延迟(这太长了)。
然后,我开始研究sonos API接口,查看文档和下面的图表,我得出的结论是,无论如何,使用sonos可以实现我想要实现的目标。

然而,它确实需要大量的努力来实现一项服务,在此我可以直接将音频流到sonos,所以我希望在进行一个相当昂贵的实现之前,我可以清理一些事情。(时间)
发布于 2016-08-06 19:25:38
MSB,
我们当前的公共API实际上不是针对您所要做的设计的。有些开源项目正在开发反向工程API,这些项目可能会对您更好一些。
发布于 2020-10-28 16:50:23
const SonosDevice = require('@svrooij/sonos').SonosDevice
const sonos = new SonosDevice(process.env.SONOS_HOST || '192.168.96.56')
sonos.PlayNotification({
trackUri: 'https://cdn.smartersoft-group.com/various/pull-bell-short.mp3', // Can be any uri sonos understands
// trackUri: 'https://cdn.smartersoft-group.com/various/someone-at-the-door.mp3', // Cached text-to-speech file.
onlyWhenPlaying: false, // make sure that it only plays when you're listening to music. So it won't play when you're sleeping.
timeout: 10, // If the events don't work (to see when it stops playing) or if you turned on a stream, it will revert back after this amount of seconds.
volume: 15, // Set the volume for the notification (and revert back afterwards)
delayMs: 700 // Pause between commands in ms, (when sonos fails to play sort notification sounds).
})
.then(played => {
console.log('Played notification %o', played)
})工作在节点/类型记录,并有许多可能性。
https://stackoverflow.com/questions/38718847
复制相似问题