使用SoCo尝试play_uri()一首歌时出现“非法MIME类型”错误

时间:2016-03-20 15:33:23

标签: python-3.x sonos

SoCo是一个用于控制Sonos扬声器的Python库。我正在尝试播放本地存储的歌曲:

device = SoCo("192.168.209.7")
device.play_uri("/home/myuser/mysong.ogg")

如果我正确阅读了文档,mysong.ogg应该开始在Sonos上播放。但是,此代码会立即导致以下异常:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.4/site-packages/soco/core.py", line 95, in inner_function
    return function(self, *args, **kwargs)
  File "/usr/lib/python3.4/site-packages/soco/core.py", line 470, in play_uri
    ('CurrentURIMetaData', meta)
  File "/usr/lib/python3.4/site-packages/soco/services.py", line 156, in _dispatcher
    return self.send_command(action, *args, **kwargs)
  File "/usr/lib/python3.4/site-packages/soco/services.py", line 357, in send_command
    self.handle_upnp_error(response.text)
  File "/usr/lib/python3.4/site-packages/soco/services.py", line 417, in handle_upnp_error
    error_xml=xml_error
soco.exceptions.SoCoUPnPException: UPnP Error 714 received: Illegal MIME-Type from 192.168.209.7

0 个答案:

没有答案