Commit b1e07455 authored by martin hou's avatar martin hou

feat: 设置指令的消息体兼容

parent 7317ba8f
......@@ -871,12 +871,8 @@ Jensen.prototype.getRecordingQuality = async function (seconds)
Jensen.prototype.setRecordingQuality = async function (quality, seconds)
{
return this.send(new Command(SET_RECORDING_QUALITY).body([quality & 0xff]), seconds);
}
Jensen.prototype.getRecordingQuality = async function (seconds)
{
return this.send(new Command(GET_RECORDING_QUALITY), seconds);
const q = quality == 'normal' ? 0x00 : 0x01;
return this.send(new Command(SET_RECORDING_QUALITY).body([0x00, 0x00, 0x00, q]), seconds);
}
Jensen.prototype.getAudioInputDevice = async function (seconds)
......@@ -889,7 +885,7 @@ Jensen.prototype.setAudioInputDevice = async function (device, seconds)
// 0x00: 蓝牙麦克风, 0x01: 内置麦克风
// device: 'bt-mic' or 'mic'
const dev = 'bt-mic' == device ? 0x00 : 0x01;
return this.send(new Command(SET_AUDIO_INPUT_DEV).body([dev]), seconds);
return this.send(new Command(SET_AUDIO_INPUT_DEV).body([0x00, 0x00, 0x00, dev]), seconds);
}
Jensen.prototype.listFiles = async function () {
......@@ -1821,7 +1817,7 @@ Jensen.registerHandler(GET_RECORDING_STATUS, (msg) => {
});
Jensen.registerHandler(GET_RECORDING_QUALITY, (msg) => {
return { quality: msg.body[0] & 0xff == 0x00 ? 'normal' : 'high' };
return { quality: (msg.body[0] & 0xff) == 0x00 ? 'normal' : 'high' };
});
Jensen.registerHandler(SET_RECORDING_QUALITY, commonMessageParser);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment