安圣二开设备说明


网络音频命令

<p>[TOC]</p> <table> <thead> <tr> <th>4G喇叭</th> <th>4G开关</th> <th>WiFi喇叭</th> <th>WiFi开关</th> </tr> </thead> <tbody> <tr> <td>&lt;font color=&quot;red&quot;&gt;<strong>&amp;times;</strong>&lt;/font&gt;</td> <td>&lt;font color=&quot;red&quot;&gt;<strong>&amp;times;</strong>&lt;/font&gt;</td> <td>&lt;font color=&quot;green&quot;&gt;<strong>&amp;radic;</strong>&lt;/font&gt;</td> <td>&lt;font color=&quot;red&quot;&gt;<strong>&amp;times;</strong>&lt;/font&gt;</td> </tr> </tbody> </table> <p>支持此功能的设备类型:&lt;font color=&quot;green&quot;&gt;<strong>&amp;radic;</strong>&lt;/font&gt;-支持 &lt;font color=&quot;red&quot;&gt;<strong>&amp;times;</strong>&lt;/font&gt;-不支持</p> <h2>添加网络音频播放(playUrl)</h2> <p><strong>简要描述</strong> 添加网络音频播放。 <strong>注意:暂时只支持http链接。且播放音乐码率建议在128kpbs以下,太高播放不流畅。只支持MP3、WAV格式</strong></p> <p><strong>命令参数</strong></p> <table> <thead> <tr> <th>参数名</th> <th>必须</th> <th>类型</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td>method</td> <td>是</td> <td>string</td> <td>playUrl</td> </tr> <tr> <td>url</td> <td>是</td> <td>string</td> <td>网络音频文件url</td> </tr> <tr> <td>vol</td> <td>否</td> <td>int</td> <td>播放音量,0~100</td> </tr> <tr> <td>repeat</td> <td>否</td> <td>int</td> <td>重复次数</td> </tr> <tr> <td>firstPlay</td> <td>否</td> <td>bool</td> <td>是否优先播放,<code>true</code>-是;<code>false</code>-否</td> </tr> <tr> <td>frameId</td> <td>否</td> <td>string</td> <td>帧ID</td> </tr> </tbody> </table> <p><strong>命令示例</strong></p> <pre><code>{ &amp;quot;method&amp;quot;: &amp;quot;playUrl&amp;quot;, &amp;quot;url&amp;quot;: &amp;quot;http://pic.ibaotu.com/00/26/88/888piC8N888piC6xy.mp3&amp;quot;, &amp;quot;vol&amp;quot;: 50, &amp;quot;repeat&amp;quot;: 1, &amp;quot;firstPlay&amp;quot;: false, &amp;quot;frameId&amp;quot;: &amp;quot;1745396239780&amp;quot; }</code></pre> <p><strong>应答参数说明</strong></p> <table> <thead> <tr> <th>参数名</th> <th>类型</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td>method</td> <td>string</td> <td>playUrl</td> </tr> <tr> <td>result</td> <td>string</td> <td>返回结果。ok-成功;其他-具体失败原因</td> </tr> <tr> <td>imei</td> <td>string</td> <td>设备imei</td> </tr> <tr> <td>frameId</td> <td>string</td> <td>同命令frameId</td> </tr> <tr> <td>timestamp</td> <td>int</td> <td>秒级时间戳,WiFi款不支持</td> </tr> </tbody> </table> <p><strong>应答示例</strong></p> <pre><code>{ &amp;quot;method&amp;quot;: &amp;quot;playUrl&amp;quot;, &amp;quot;result&amp;quot;: &amp;quot;ok&amp;quot;, &amp;quot;imei&amp;quot;: &amp;quot;1745396239780&amp;quot;, &amp;quot;frameId&amp;quot;: &amp;quot;1745396239780&amp;quot;, &amp;quot;timestamp&amp;quot;: 1745396759 }</code></pre> <p><strong>备注</strong> 无</p>

页面列表

ITEM_HTML