[PyQt] Playing an ogg file with QtMultimedia?

Brandon Keith Biggs brandonkeithbiggs at gmail.com
Tue Sep 8 20:52:24 BST 2015


  Hello,
> I get:
> "Unsupported media type."
> as the error.
>
> I found:
> http://stackoverflow.com/questions/15043620/cant-play-ogg-and-flac
>
> and installed the codecs from:
> http://www.xiph.org/dshow/
>
> I just ran the binary installer installing them into:
> C:\Program Files (x86)\Xiph.Org\Open Codecs\x64
>
> But I am still getting the unsupported media type.
> Thank you,
>
> Brandon Keith Biggs <http://www.brandonkeithbiggs.com/>
> On 9/4/2015 9:56 AM, Florian Bruhin wrote:
>> Hi,
>>
>> (also Cc-ing the list again as I don't think it was intended to send
>> this off-list)
>>
>> * Brandon Keith Biggs<brandonkeithbiggs at gmail.com>  [2015-09-04 09:31:41 +0200]:
>>> Here is what I have, but it is silent and there is no error:
>>>
>>>          self.player = QtMultimedia.QMediaPlayer(self)
>>>          self.s = QtMultimedia.QMediaContent(QUrl("sounds/my_sound.ogg"))
>> This should probably be QUrl.fromLocalFile(...) instead.
>>
>>>          self.player.setMedia(self.s)
>>>          self.player.play()
>>>
>>> Could there be some kind of dll that I need to put in my PyQt5 dir?
>> If a DLL was missing, Qt would probably terminate/abort.
>>
>> Some things to check:
>>
>> - .error()/.errorString()
>> - .volume() (in the example they do .setVolume(50))
>>
>> Florian
>>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20150908/a689efc2/attachment.html>


More information about the PyQt mailing list