sonos 与广播系统的集成
sonos integration with announcement system
我目前正在研究将广播系统与 sonos 集成的可能性,但尚未找到合理的方法,并开始怀疑目前是否可行。
我最初的方法是让歌曲订阅一个广播电台,该广播电台会不断发送通知。在使用此设置进行测试后,我无法将延迟时间控制在 3 秒以下(这太长了)。
然后我开始研究 sonos API Looking at documentation and the below graph I came to the conclusion that what I was trying to achieve was however possible with sonos.
不过,似乎确实需要付出大量努力才能实现一项服务,我可以将音频直接流式传输到 sonos,因此我希望在继续进行相当昂贵的实现之前,我可以先把一些事情弄清楚。 (时间)
- 直接流式传输时是否可以将音频延迟控制在 3 秒以下?
- 我的理解是否正确,我需要在 sonos 平台上编写一个应用程序来处理我的请求?
- 如果上面的答案是否定的;还有哪些其他选项可用?
最高位,
我们当前的 public API 确实没有很好地设计来满足您的需求。有一些开源项目正在使用逆向工程 API,它们可能对您来说效果更好一些。
只需使用 my library to play a notification.
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)
})
在node/typescript工作并且有很多可能性。
我目前正在研究将广播系统与 sonos 集成的可能性,但尚未找到合理的方法,并开始怀疑目前是否可行。
我最初的方法是让歌曲订阅一个广播电台,该广播电台会不断发送通知。在使用此设置进行测试后,我无法将延迟时间控制在 3 秒以下(这太长了)。
然后我开始研究 sonos API Looking at documentation and the below graph I came to the conclusion that what I was trying to achieve was however possible with sonos.
不过,似乎确实需要付出大量努力才能实现一项服务,我可以将音频直接流式传输到 sonos,因此我希望在继续进行相当昂贵的实现之前,我可以先把一些事情弄清楚。 (时间)
- 直接流式传输时是否可以将音频延迟控制在 3 秒以下?
- 我的理解是否正确,我需要在 sonos 平台上编写一个应用程序来处理我的请求?
- 如果上面的答案是否定的;还有哪些其他选项可用?
最高位,
我们当前的 public API 确实没有很好地设计来满足您的需求。有一些开源项目正在使用逆向工程 API,它们可能对您来说效果更好一些。
只需使用 my library to play a notification.
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)
})
在node/typescript工作并且有很多可能性。