音量加
player-add-vol
指令简介
增加设备音量。设备收到指令后音量上调(10),最高到最大音量,超出上限时保持最大值不变。
向设备发送指令
服务端向设备订阅topic发送消息
{
"action" : "add-volume",
"messageId" : "202201241610366046",
"type" : "player"
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
action |
String |
固定动作 |
add-volume |
| 2 |
channel |
String |
通道 |
left |
| 3 |
freq |
int |
频率,单位(Khz) |
31 |
| 4 |
gain |
int |
增益,单位dB,范围-13到13。 |
-13 |
| 5 |
messageId |
String |
消息ID字段 |
202201241610366046 |
| 6 |
type |
String |
指令类型 |
player |
{
"commandName" : "player-add-volume",
"mac" : "206ef1883b7c",
"message" : "OK",
"messageId" : "202201241610366046",
"source" : "command",
"success" : true,
"volume" : 85
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
channel |
String |
左右 |
left |
| 2 |
commandName |
String |
指令名称 |
player-add-volume |
| 3 |
freq |
int |
频率,单位(Khz) |
31 |
| 4 |
gain |
int |
增益,单位dB,范围-13到13。 |
-13 |
| 5 |
mac |
String |
wifi设备MAC地址或4G设备的IMEI号,唯一标识 |
206ef1883b7c |
| 6 |
message |
String |
执行返回结果 |
OK |
| 7 |
messageId |
String |
消息ID字段 |
202201241610366046 |
| 8 |
name |
String |
歌曲名字 |
001.mp3 |
| 9 |
size |
int |
歌曲大小(单位字节) |
12099546 |
| 10 |
source |
String |
指令回复“command" |
command |
| 11 |
success |
boolean |
执行结果 |
true |
| 12 |
volume |
int |
音量大小(0-100) |
85 |
删除SD卡音频文件
player-delete
指令简介
从SD卡中删除指定歌曲,通过 name 参数指定歌曲名(不含扩展名),设备在播放列表中查找并删除该歌曲及其文件。
向设备发送指令
服务端向设备订阅topic发送消息
{
"action" : "delete",
"name" : "我爱中国",
"type" : "player"
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
action |
String |
固定动作 |
delete |
| 2 |
name |
String |
音频名 |
我爱中国 |
| 3 |
type |
String |
指令类型 |
player |
{
"commandName" : "player-delete",
"mac" : "206ef1883b7c",
"message" : "OK",
"messageId" : "202201241610366046",
"name" : "我爱中国",
"source" : "command",
"success" : true
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
commandName |
String |
指令名称 |
player-delete |
| 2 |
mac |
String |
wifi设备MAC地址或4G设备的IMEI号,唯一标识 |
206ef1883b7c |
| 3 |
message |
String |
执行返回结果 |
OK |
| 4 |
messageId |
String |
消息ID字段 |
202201241610366046 |
| 5 |
name |
String |
歌曲名字 |
我爱中国 |
| 6 |
source |
String |
指令回复“command" |
command |
| 7 |
success |
boolean |
执行结果 |
true |
下载音频文件到SD卡
player-download
指令简介
从指定URL下载音频并保存到SD卡,通过 name 参数指定保存的歌曲名、url 参数指定音频地址(仅支持 http,不支持 https)。
向设备发送指令
服务端向设备订阅topic发送消息
{
"action" : "download",
"name" : "饿狼传说",
"type" : "player",
"url" : "http://smart-bird-oss.smart-bird.cn/music/2025/%E9%A5%BF%E7%8B%BC%E4%BC%A0%E8%AF%B4.mp3"
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
action |
String |
固定动作 |
download |
| 2 |
name |
String |
保存到在sd,歌曲名字 |
饿狼传说 |
| 3 |
type |
String |
指令类型 |
player |
| 4 |
url |
String |
下载的http地址 |
http://smart-bird-oss.smart-bird.cn/music/2025/%E9%A5%BF%E7%8B%BC%E4%BC%A0%E8%AF%B4.mp3 |
{
"commandName" : "player-download",
"mac" : "2026bb16aa14",
"progress" : 0,
"source" : "command",
"status" : 0
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
commandName |
String |
指令名称 |
player-download |
| 2 |
mac |
String |
wifi设备MAC地址或4G设备的IMEI号,唯一标识 |
2026bb16aa14 |
| 3 |
progress |
int |
进度值(0-100%) |
0 |
| 4 |
source |
String |
指令回复“command" |
command |
| 5 |
status |
int |
状态 0:开始 ,1:进行中 ,2:结束 |
0 |
获取播放器参数
player-getParams
指令简介
查询设备当前播放器参数。设备收到指令后返回当前音量、播放模式等信息,用于查看设备播放状态。
向设备发送指令
服务端向设备订阅topic发送消息
{
"action" : "getParams",
"type" : "player"
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
action |
String |
固定动作 |
getParams |
| 2 |
type |
String |
指令类型 |
player |
{
"commandName" : "player-getParams",
"eqGains" : [-13, -10, -5, 0, 3, 5, 3, 0, -5, -10, -13, -10, -5, 0, 3, 5, 3, 0, -5, -10],
"mac" : "2026bb16aa14",
"playMode" : "ListLoopPlay",
"sdCardFreeSpace" : 256,
"sdCardTotalSpace" : 512,
"sdCardUsage" : 26,
"source" : "command",
"volume" : 70
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
commandName |
String |
指令名称 |
player-getParams |
| 2 |
eqGains |
List |
eqGains: int[20] EQ均衡器增益值
前10个为左声道,后10个为右声道,一一对应以下10个频段:
频段(Hz): 31 62 125 250 500 1K 2K 4K 8K 16K
每个频段增益范围: -13 ~ +13
-13 = 最大削减
0 = 不调整(原始)
+13 = 最大增益
示例(左右声道相同):
[-13, -10, -5, 0, 3, 5, 3, 0, -5, -10, ← 左声道
-13, -10, -5, 0, 3, 5, 3, 0, -5, -10] ← 右声道 |
[-13, -10, -5, 0, 3, 5, 3, 0, -5, -10, -13, -10, -5, 0, 3, 5, 3, 0, -5, -10] |
| 3 |
mac |
String |
wifi设备MAC地址或4G设备的IMEI号,唯一标识 |
2026bb16aa14 |
| 4 |
playMode |
String |
播放模式:(OnePlay:播完一首就停),(OneLoopPlay:单曲循环),(RandomPlay:随机播放),(ListLoopPlay:列表循环) |
ListLoopPlay |
| 5 |
sdCardFreeSpace |
int |
内存卡剩余空间,单位:MB |
256 |
| 6 |
sdCardTotalSpace |
int |
内存卡总大小,单位:MB |
512 |
| 7 |
sdCardUsage |
int |
内存卡使用率,单位:% |
26 |
| 8 |
source |
String |
指令回复“command" |
command |
| 9 |
volume |
int |
音量大小(0-100) |
70 |
查询SD卡音频文件
player-getSongList
指令简介
获取SD卡内的歌曲列表,设备返回播放列表中的所有歌曲名称。
向设备发送指令
服务端向设备订阅topic发送消息
{
"action" : "getSongList",
"type" : "player"
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
action |
String |
固定动作 |
getSongList |
| 2 |
type |
String |
指令类型 |
player |
{
"commandName" : "player-getSongList",
"fileCount" : 1,
"mac" : "2026bb16aa14",
"songs" :
{
"name" : "我爱中国",
"size" : 8504797
},
"source" : "command"
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
commandName |
String |
指令名称 |
player-getSongList |
| 2 |
fileCount |
int |
歌曲数量 |
1 |
| 3 |
mac |
String |
wifi设备MAC地址或4G设备的IMEI号,唯一标识 |
2026bb16aa14 |
| 4 |
name |
String |
歌曲名字 |
我爱中国 |
| 5 |
size |
int |
歌曲大小(单位字节) |
8504797 |
| 6 |
songs |
Object |
所有歌曲信息 |
|
| 7 |
source |
String |
指令回复“command" |
command |
播放网络音频
player-http-play
指令简介
播放指定URL的网络音频,通过 url 参数传入音频地址(仅支持 http,不支持 https)。priority 为 high 时走高优先级通道优先播放,否则按普通优先级播放。
向设备发送指令
服务端向设备订阅topic发送消息
{
"action" : "http-play",
"messageId" : 20260520,
"priority" : high,
"type" : "player",
"url" : "http://smart-bird-oss.smart-bird.cn/music/2025/%E9%9F%B3%E7%AE%B1%E7%AE%80%E4%BB%8B.mp3"
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
action |
String |
固定字段 |
http-play |
| 2 |
messageId |
|
业务流水号。由请求方生成的唯一标识,响应方原样回显,用于请求与响应的关联匹配。
|
20260520 |
| 3 |
priority |
|
若有这个字段,表示插播, |
high |
| 4 |
type |
String |
指令类型 |
player |
| 5 |
url |
String |
url地址 |
http://smart-bird-oss.smart-bird.cn/music/2025/%E9%9F%B3%E7%AE%B1%E7%AE%80%E4%BB%8B.mp3 |
{
"commandName" : "player-http-play",
"mac" : "2026bb16aa14",
"message" : "ok",
"source" : "command",
"success" : true,
"url" : "http://smart-bird-oss.smart-bird.cn/music/2025/%E9%9F%B3%E7%AE%B1%E7%AE%80%E4%BB%8B.mp3"
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
commandName |
String |
指令名称 |
player-http-play |
| 2 |
mac |
String |
wifi设备MAC地址或4G设备的IMEI号,唯一标识 |
2026bb16aa14 |
| 3 |
message |
String |
执行返回结果 |
ok |
| 4 |
source |
String |
指令回复“command" |
command |
| 5 |
success |
boolean |
执行结果 |
true |
| 6 |
url |
String |
url地址 |
http://smart-bird-oss.smart-bird.cn/music/2025/%E9%9F%B3%E7%AE%B1%E7%AE%80%E4%BB%8B.mp3 |
播放下一曲
player-next
指令简介
播放SD卡播放列表中的下一首歌曲。设备收到指令后切换到当前歌曲的下一曲并播放,若当前为最后一首则循环到第一首。
向设备发送指令
服务端向设备订阅topic发送消息
{
"action" : "next",
"type" : "player"
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
action |
String |
固定动作 |
next |
| 2 |
type |
String |
指令类型 |
player |
{
"commandName" : "player-next",
"mac" : "4CEBD60BFD62",
"message" : "OK",
"messageId" : "202201241610366046",
"name" : "我爱中国",
"source" : "command",
"success" : true
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
commandName |
String |
指令名称 |
player-next |
| 2 |
mac |
String |
wifi设备MAC地址或4G设备的IMEI号,唯一标识 |
4CEBD60BFD62 |
| 3 |
message |
String |
执行返回结果 |
OK |
| 4 |
messageId |
String |
消息ID字段 |
202201241610366046 |
| 5 |
name |
String |
歌曲名字 |
我爱中国 |
| 6 |
source |
String |
指令回复“command" |
command |
| 7 |
success |
boolean |
执行结果 |
true |
设置播放器参数
player-params-set
指令简介
设置设备音量(volume,0-100)、播放模式(playMode:OnePlay播放一次/OneLoopPlay单曲循环/ListLoopPlay列表循环/RandomPlay随机播放)和EQ音效(eqGains,20个数值,左右声道各10段,范围-13~13),未传字段保持不变。
向设备发送指令
服务端向设备订阅topic发送消息
{
"action" : "setParams",
"eqGains" : [-13, -10, -5, 0, 3, 5, 3, 0, -5, -10, -13, -10, -5, 0, 3, 5, 3, 0, -5, -10],
"playMode" : "ListLoopPlay",
"type" : "player",
"volume" : 85
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
action |
String |
固定动作 |
setParams |
| 2 |
eqGains |
List |
eqGains: int[20] EQ均衡器增益值
前10个为左声道,后10个为右声道,一一对应以下10个频段:
频段(Hz): 31 62 125 250 500 1K 2K 4K 8K 16K
每个频段增益范围: -13 ~ +13
-13 = 最大削减
0 = 不调整(原始)
+13 = 最大增益
示例(左右声道相同):
[-13, -10, -5, 0, 3, 5, 3, 0, -5, -10, ← 左声道
-13, -10, -5, 0, 3, 5, 3, 0, -5, -10] ← 右声道 |
[-13, -10, -5, 0, 3, 5, 3, 0, -5, -10, -13, -10, -5, 0, 3, 5, 3, 0, -5, -10] |
| 3 |
playMode |
String |
播放模式:(OnePlay:播完一首就停),(OneLoopPlay:单曲循环),(RandomPlay:随机播放),(ListLoopPlay:列表循环) |
ListLoopPlay |
| 4 |
type |
String |
指令类型 |
player |
| 5 |
volume |
int |
音量大小(0-100) |
85 |
{
"commandName" : "player-params-set",
"eqGains" : [-13, -10, -5, 0, 3, 5, 3, 0, -5, -10, -13, -10, -5, 0, 3, 5, 3, 0, -5, -10],
"mac" : "2026bb16aa14",
"message" : "ok",
"playMode" : "ListLoopPlay",
"source" : "command",
"success" : true,
"volume" : 85
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
commandName |
String |
指令名称 |
player-params-set |
| 2 |
eqGains |
List |
eqGains: int[20] EQ均衡器增益值
前10个为左声道,后10个为右声道,一一对应以下10个频段:
频段(Hz): 31 62 125 250 500 1K 2K 4K 8K 16K
每个频段增益范围: -13 ~ +13
-13 = 最大削减
0 = 不调整(原始)
+13 = 最大增益
示例(左右声道相同):
[-13, -10, -5, 0, 3, 5, 3, 0, -5, -10, ← 左声道
-13, -10, -5, 0, 3, 5, 3, 0, -5, -10] ← 右声道 |
[-13, -10, -5, 0, 3, 5, 3, 0, -5, -10, -13, -10, -5, 0, 3, 5, 3, 0, -5, -10] |
| 3 |
mac |
String |
wifi设备MAC地址或4G设备的IMEI号,唯一标识 |
2026bb16aa14 |
| 4 |
message |
String |
执行返回结果 |
ok |
| 5 |
playMode |
String |
播放模式:(OnePlay:播完一首就停),(OneLoopPlay:单曲循环),(RandomPlay:随机播放),(ListLoopPlay:列表循环) |
ListLoopPlay |
| 6 |
source |
String |
指令回复“command" |
command |
| 7 |
success |
boolean |
执行结果 |
true |
| 8 |
volume |
int |
音量大小(0-100) |
85 |
暂停播放
player-pause
指令简介
暂停当前正在播放的音频。设备收到指令后暂停播放,可通过继续播放指令恢复。
向设备发送指令
服务端向设备订阅topic发送消息
{
"action" : "pause",
"messageId" : "202201241610366046",
"type" : "player"
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
action |
String |
固定动作 |
pause |
| 2 |
messageId |
String |
消息ID字段 |
202201241610366046 |
| 3 |
type |
String |
指令类型 |
player |
{
"commandName" : "player-pause",
"mac" : "4CEBD60BFD62",
"message" : "OK",
"messageId" : "202201241610366046",
"source" : "command",
"success" : true
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
commandName |
String |
指令名称 |
player-pause |
| 2 |
mac |
String |
wifi设备MAC地址或4G设备的IMEI号,唯一标识 |
4CEBD60BFD62 |
| 3 |
message |
String |
执行返回结果 |
OK |
| 4 |
messageId |
String |
消息ID字段 |
202201241610366046 |
| 5 |
source |
String |
指令回复“command" |
command |
| 6 |
success |
boolean |
执行结果 |
true |
播放SD卡音频
player-play
指令简介
播放SD卡内存储的歌曲。
向设备发送指令
服务端向设备订阅topic发送消息
{
"action" : "play",
"messageId" : "202201241610366046",
"type" : "player"
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
action |
String |
固定动作 |
play |
| 2 |
messageId |
String |
消息ID字段 |
202201241610366046 |
| 3 |
type |
String |
指令类型 |
player |
{
"commandName" : "player-play",
"mac" : "4CEBD60BFD62",
"message" : "OK",
"messageId" : "202201241610366046",
"source" : "command",
"success" : true
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
commandName |
String |
指令名称 |
player-play |
| 2 |
mac |
String |
wifi设备MAC地址或4G设备的IMEI号,唯一标识 |
4CEBD60BFD62 |
| 3 |
message |
String |
执行返回结果 |
OK |
| 4 |
messageId |
String |
消息ID字段 |
202201241610366046 |
| 5 |
source |
String |
指令回复“command" |
command |
| 6 |
success |
boolean |
执行结果 |
true |
播放上一曲
player-prev
指令简介
播放SD卡播放列表中的上一首歌曲。设备收到指令后切换到当前歌曲的上一曲并播放,若当前为第一首则循环到最后一首。
向设备发送指令
服务端向设备订阅topic发送消息
{
"action" : "prev",
"type" : "player"
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
action |
String |
指令名称 |
prev |
| 2 |
type |
String |
指令类型 |
player |
{
"commandName" : "player-prev",
"mac" : "4CEBD60BFD62",
"message" : "OK",
"messageId" : "202201241610366046",
"name" : "晴天",
"source" : "command",
"success" : true
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
commandName |
String |
指令名称 |
player-prev |
| 2 |
mac |
String |
wifi设备MAC地址或4G设备的IMEI号,唯一标识 |
4CEBD60BFD62 |
| 3 |
message |
String |
执行返回结果,播放的歌曲地址 |
OK |
| 4 |
messageId |
String |
消息ID字段 |
202201241610366046 |
| 5 |
name |
String |
歌曲名字 |
晴天 |
| 6 |
source |
String |
指令回复“command" |
command |
| 7 |
success |
boolean |
执行结果 |
true |
播放指定SD卡歌曲
player-sd-play
指令简介
高优先级播放SD卡中指定的歌曲,通过 name 参数指定歌曲名(不含扩展名)。priority 为 high 时走高优先级通道优先播放,可打断当前正在播放的音频。
向设备发送指令
服务端向设备订阅topic发送消息
{
"action" : "sd-play",
"name" : "明天-会更好",
"priority" : "high",
"type" : "player"
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
action |
String |
固定字段 |
sd-play |
| 2 |
name |
String |
歌曲名字,无需后缀 |
明天-会更好 |
| 3 |
priority |
String |
若有这个字段,表示插播, |
high |
| 4 |
type |
String |
指令类型 |
player |
{
"commandName" : "player-sd-play",
"mac" : "2026bb16aa14",
"message" : "ok",
"name" : "半岛铁盒",
"source" : "command",
"success" : true
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
commandName |
String |
指令名称 |
player-sd-play |
| 2 |
mac |
String |
wifi设备MAC地址或4G设备的IMEI号,唯一标识 |
2026bb16aa14 |
| 3 |
message |
String |
执行返回结果 |
ok |
| 4 |
name |
String |
歌曲名字 |
半岛铁盒 |
| 5 |
source |
String |
指令回复“command" |
command |
| 6 |
success |
boolean |
执行结果 |
true |
停止播放
player-stop
指令简介
停止当前正在播放的音频。设备收到指令后停止播放并释放播放资源,与暂停不同,停止后需重新下发播放指令。
向设备发送指令
服务端向设备订阅topic发送消息
{
"action" : "stop",
"messageId" : "202201241610366046",
"type" : "player"
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
action |
String |
固定动作 |
stop |
| 2 |
messageId |
String |
消息ID字段 |
202201241610366046 |
| 3 |
type |
String |
指令类型 |
player |
{
"commandName" : "player-stop",
"mac" : "4CEBD60BFD62",
"message" : "OK",
"messageId" : "202201241610366046",
"source" : "command",
"success" : true
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
commandName |
String |
指令名称 |
player-stop |
| 2 |
mac |
String |
wifi设备MAC地址或4G设备的IMEI号,唯一标识 |
4CEBD60BFD62 |
| 3 |
message |
String |
执行返回结果 |
OK |
| 4 |
messageId |
String |
消息ID字段 |
202201241610366046 |
| 5 |
source |
String |
指令回复“command" |
command |
| 6 |
success |
boolean |
执行结果 |
true |
音量减
player-sub-vol
指令简介
减小设备音量。设备收到指令后音量下调10,最低到音量 0(静音),到达下限时保持不变。
向设备发送指令
服务端向设备订阅topic发送消息
{
"action" : "sub-volume",
"messageId" : "202201241610366046",
"type" : "player"
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
action |
String |
固定动作 |
sub-volume |
| 2 |
messageId |
String |
消息ID字段 |
202201241610366046 |
| 3 |
type |
String |
指令类型 |
player |
{
"commandName" : "player-sub-volume",
"mac" : "4CEBD60BFD62",
"message" : "ok",
"messageId" : "202201241610366046",
"source" : "command",
"success" : true,
"volume" : 80
}
字段属性
| # |
字段名称 |
字段类型 |
字段说明 |
示例值 |
| 1 |
001.MP3 |
String |
歌曲名字 |
|
| 2 |
channel |
String |
左右通道 |
left |
| 3 |
commandName |
String |
指令名称 |
player-sub-volume |
| 4 |
freq |
int |
频率,单位(Khz) |
31 |
| 5 |
gain |
int |
增益,单位dB,范围-13到13。 |
-13 |
| 6 |
mac |
String |
wifi设备MAC地址或4G设备的IMEI号,唯一标识 |
4CEBD60BFD62 |
| 7 |
message |
String |
执行返回结果 |
ok |
| 8 |
messageId |
String |
消息ID字段 |
202201241610366046 |
| 9 |
name |
String |
歌曲名字 |
003.mp3 |
| 10 |
size |
int |
歌曲大小(单位字节) |
12041911 |
| 11 |
source |
String |
指令回复“command" |
command |
| 12 |
success |
boolean |
执行结果 |
true |
| 13 |
volume |
int |
音量大小(0-100) |
80 |