首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >sonos与公告系统的集成

sonos与公告系统的集成
EN

Stack Overflow用户
提问于 2016-08-02 11:12:07
回答 2查看 254关注 0票数 0

我目前正在研究将公告系统集成到sonos中的可能性,但是还没有找到一个合理的方法,并且已经开始怀疑它是否是可能的。

我最初的做法是让歌曲订阅一家电台,该电台将不断发布公告。在用这个设置进行测试之后,我无法得到3秒以下的延迟(这太长了)。

然后,我开始研究sonos API接口,查看文档和下面的图表,我得出的结论是,无论如何,使用sonos可以实现我想要实现的目标。

然而,它确实需要大量的努力来实现一项服务,在此我可以直接将音频流到sonos,所以我希望在进行一个相当昂贵的实现之前,我可以清理一些事情。(时间)

  1. 当直接播放时,是否有可能获得3秒以下的音频延迟?
  2. 我是否正确地认识到,我需要在sonos平台上编写一个应用程序来处理我的请求?
  3. 如果上面的答案是否定的,还有什么其他的选择吗?
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2016-08-06 19:25:38

MSB,

我们当前的公共API实际上不是针对您所要做的设计的。有些开源项目正在开发反向工程API,这些项目可能会对您更好一些。

票数 1
EN

Stack Overflow用户

发布于 2020-10-28 16:50:23

只需使用我的图书馆来实现播放通知

代码语言:javascript
复制
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)
  })

工作在节点/类型记录,并有许多可能性。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38718847

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档