hanxi / xiaomusic

使用小爱音箱播放音乐,音乐使用 yt-dlp 下载。
https://github.com/hanxi/xiaomusic
MIT License
968 stars 95 forks source link

小米AI音箱二代不支持语音控制播放 #32

Closed liuxc0116 closed 3 months ago

liuxc0116 commented 3 months ago

小米AI音箱二代和小米小爱音箱mini都不支持语音控制播放。控制台上监听不到语音对话。但是web上可以播放。

hanxi commented 3 months ago

监听聊天记录是抓的接口的,应该跟设备关系不大,只要小米app里能看到聊天记录的话,接口应该也能看到,你可以试试用 https://github.com/yihong0618/MiService 排查一下具体原因。

liuxc0116 commented 3 months ago

监听聊天记录是抓的接口的,应该跟设备关系不大,只要小米app里能看到聊天记录的话,接口应该也能看到,你可以试试用 https://github.com/yihong0618/MiService 排查一下具体原因。

APP上是能够看到对话记录的。查询了接口能力,然后查询了lx01型号的5-1和l15a型号的7-1显示的都是null.

root@az:~/work/python/MiService# ./micli.py spec xiaomi.wifispeaker.lx01
# Generated by https://github.com/Yonsm/MiService
# http://miot-spec.org/miot-spec-v2/instance?type=urn:miot-spec-v2:device:speaker:0000A015:xiaomi-lx01:1

Device_Information = 1
    Device_Manufacturer = 1
    Device_Model = 2
    Device_Serial_Number = 3
    Current_Firmware_Version = 4

Speaker = 2
    Volume = 1  # uint8  # rw
    Mute = 2  # bool  # rw

Microphone = 3
    Mute = 1  # bool  # rw

Play_Control = 4
    Playing_State = 1  # uint8

    _Pause = 1
    _Play = 2
    _Next = 3
    _Previous = 4

Intelligent_Speaker = 5
    _Text_Content = 1
    _Silent_Execution = 2  # uint8

    _Play_Text = 1  # in=[1]
    _Wake_Up = 2
    _Play_Radio = 3
    _Play_Music = 4
    _Execute_Text_Directive = 5  # in=[1, 2]

Clock = 6

    _Stop_Alarm = 1

Speaker_Volume
    MIN = 1
    MAX = 100

Play_Control_Playing_State
    Idle = 0
    Playing = 1

Intelligent_Speaker_Silent_Execution
    On = 0
    Off = 1

root@az:~/work/python/MiService# ./micli.py spec xiaomi.wifispeaker.l15a
# Generated by https://github.com/Yonsm/MiService
# http://miot-spec.org/miot-spec-v2/instance?type=urn:miot-spec-v2:device:speaker:0000A015:xiaomi-l15a:2

Device_Information = 1
    Device_Manufacturer = 1
    Device_Model = 2
    Device_ID = 3
    Current_Firmware_Version = 4
    Serial_Number = 5  # rn

Speaker = 2
    Volume = 1  # uint8  # rwn
    Mute = 2  # bool  # rwn

Play_Control = 3
    Playing_State = 1  # uint8  # rn
    _Seek_Time = 2  # int16
    Play_Loop_Mode = 3  # uint8  # rwn

    _Seek = 1  # in=[2]
    _Play = 2
    _Pause = 3
    _Stop = 4
    _Previous = 5
    _Next = 6

Microphone = 4
    Mute = 1  # bool  # rwn

Clock = 6
    Switch_Status = 1  # bool  # rwn
    Status = 2  # uint8  # rn
    Device_Fault = 3  # uint8  # rn
    Ringtone = 4  # uint8  # rwn

    _Stop_Alarm = 1

Intelligent_Speaker = 7
    _Text_Content = 1
    _Silent_Execution = 2  # bool
    Sleep_Mode = 3  # bool  # rwn
    Audio_Id = 4  # rn

    _Wake_Up = 1
    _Play_Radio = 2
    _Play_Text = 3  # in=[1]
    _Execute_Text_Directive = 4  # in=[1, 2]
    _Play_Music = 5

No_Disturb = 9
    No_Disturb = 1  # bool  # rwn
    Enable_Time_Period = 2  # rwn

tv-switch = 8

    _tv = 1  # -switchon

Speaker_Volume
    MIN = 0
    MAX = 100

Play_Control_Playing_State
    Playing = 1
    Stop = 0
    Pause = 2

Play_Control_Seek_Time
    MIN = -30000
    MAX = 30000
    STEP = 10

Play_Control_Play_Loop_Mode
    Single_Cycle = 1

Clock_Status
    Idle = 1
    Busy = 2

Clock_Device_Fault
    No_Faults = 0

Clock_Ringtone
    MIN = 1
    MAX = 5
root@az:~/work/python/MiService# ./micli.py 5-1
[
  null
]

image

hanxi commented 3 months ago

请求聊天记录的接口是这个 https://github.com/hanxi/xiaomusic/blob/main/xiaomusic/config.py#L11

是不是hardware参数设置错了?

liuxc0116 commented 3 months ago

是的,没有改hardware参数。修改后就好了。谢谢。