<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hello,<br>
I have played my sound file in pygame, VLC and Audacity.<br>
What is Slicer?<br>
I am on Windows 7 64 Bit, so that may be part of the problem. Is
there another audio type other than ogg that is more multiplatform?
(That is not wav!)<br>
Here is my not working code:<br>
<br>
import sys<br>
from PyQt5.QtWidgets import QApplication, QWidget<br>
from PyQt5.QtCore import QUrl<br>
from PyQt5 import QtMultimedia<br>
from qt_tools import key_text<br>
<br>
class Window(QWidget):<br>
def __init__(self):<br>
super().__init__()<br>
self.player = QtMultimedia.QMediaPlayer(self)<br>
self.sound =
QtMultimedia.QMediaContent(QUrl.fromLocalFile("draw_sword.ogg"))<br>
self.player.setMedia(self.sound)<br>
self.player.setVolume(100)<br>
self.show()<br>
<br>
def keyPressEvent(self, e):<br>
key = key_text(e.key())<br>
if key == "space":<br>
print(self.player.errorString())<br>
self.player.play()<br>
<br>
app = QApplication(sys.argv)<br>
window = Window()<br>
sys.exit(app.exec_())<br>
<br>
<br>
<div class="moz-signature">
<a href="http://www.brandonkeithbiggs.com/">Brandon Keith Biggs</a></div>
<div class="moz-cite-prefix">On 9/9/2015 4:46 PM, Saeed Mahdizadeh
Bakhshmand wrote:<br>
</div>
<blockquote
cite="mid:CAGdd0Q5AqvR7HW_o2KwKxBN+R89YJqATZJDp0vLb8kpYFrL2TA@mail.gmail.com"
type="cite">
<p dir="ltr">This problem is solved, thanks for your follow up, so
I tried it in a later nightly version of Slicer and it worked
fine.</p>
<div class="gmail_quote">On Sep 9, 2015 10:11 AM, "Rembrand
(daxLAB Limitted)" <<a moz-do-not-send="true"
href="mailto:rembrand@daxlab.com">rembrand@daxlab.com</a>>
wrote:<br type="attribution">
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div><br>
</div>
<div>Did you try to play the same .ogg file with another
(external) player? </div>
<div><br>
</div>
<div>I did play multimedia files on Linux with QtMultimedia
succesfully but I have to check and see if it was .ogg (I
believe I did). I also used the fromLocalFile option for
that to be sure.</div>
<div> </div>
<div>I'm not sure but I think that I read that spaces
inside the path to the codecs can cause problems.</div>
<div><br>
</div>
<div>
<div style="font-size:9px">Best regards,</div>
<div style="font-size:9px">Rembrand</div>
<div style="font-size:9px"><br>
</div>
<div style="font-size:9px">Cell phone: +31 646.224.526</div>
<div style="font-size:9px">Email: <a
moz-do-not-send="true"
href="mailto:rembrand@daxlab.com" target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:rembrand@daxlab.com">rembrand@daxlab.com</a></a></div>
<div style="font-size:9px">Sent from my smart phone.</div>
<div style="font-size:9px"><br>
</div>
</div>
<br>
<br>
-------- Original message --------<br>
From: <a moz-do-not-send="true"
href="mailto:pyqt-request@riverbankcomputing.com"
target="_blank">pyqt-request@riverbankcomputing.com</a> <br>
Date: 09/09/2015 13:00 (GMT+01:00) <br>
To: <a moz-do-not-send="true"
href="mailto:pyqt@riverbankcomputing.com" target="_blank">pyqt@riverbankcomputing.com</a>
<br>
Subject: PyQt Digest, Vol 134, Issue 9 <br>
<br>
Send PyQt mailing list submissions to<br>
<a moz-do-not-send="true"
href="mailto:pyqt@riverbankcomputing.com" target="_blank">pyqt@riverbankcomputing.com</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
<a moz-do-not-send="true"
href="https://www.riverbankcomputing.com/mailman/listinfo/pyqt"
target="_blank">https://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><br>
or, via email, send a message with subject or body 'help' to<br>
<a moz-do-not-send="true"
href="mailto:pyqt-request@riverbankcomputing.com"
target="_blank">pyqt-request@riverbankcomputing.com</a><br>
<br>
You can reach the person managing the list at<br>
<a moz-do-not-send="true"
href="mailto:pyqt-owner@riverbankcomputing.com"
target="_blank">pyqt-owner@riverbankcomputing.com</a><br>
<br>
When replying, please edit your Subject line so it is more
specific<br>
than "Re: Contents of PyQt digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
1. Usage of active-x based camera viewer components (Carl
Wolff)<br>
2. Re: Playing an ogg file with QtMultimedia? (Brandon
Keith Biggs)<br>
3. Return type Qlist<QModelIndex> is ignored
because it is<br>
unknown to PythonQt (Saeed Mahdizadeh Bakhshmand)<br>
4. Re: Return type Qlist<QModelIndex> is ignored
because it is<br>
unknown to PythonQt (Florian Bruhin)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Tue, 8 Sep 2015 21:36:39 +0200<br>
From: Carl Wolff <<a moz-do-not-send="true"
href="mailto:carl@wolff-online.nl" target="_blank">carl@wolff-online.nl</a>><br>
To: <a moz-do-not-send="true"
href="mailto:pyqt@riverbankcomputing.com" target="_blank">pyqt@riverbankcomputing.com</a><br>
Subject: [PyQt] Usage of active-x based camera viewer
components<br>
Message-ID:<br>
<CA+89xzSKqZK_CwUWQfmYpAixiNBNQs=<a
moz-do-not-send="true"
href="mailto:ACtNZkisEif3vRgaW6A@mail.gmail.com"
target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:ACtNZkisEif3vRgaW6A@mail.gmail.com">ACtNZkisEif3vRgaW6A@mail.gmail.com</a></a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Hello Group members<br>
<br>
If I have an com / active-x based camera viewer library (in
order to create<br>
a viewing pane in my pyqt based application) can I use
qaxcontainer for<br>
that?<br>
<br>
What are the pitfalls and things to be careful with?<br>
<br>
Are there limitations?<br>
<br>
Best regards<br>
Carl.<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a moz-do-not-send="true"
href="https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20150908/d91bfe97/attachment-0001.html"
target="_blank">https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20150908/d91bfe97/attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Tue, 8 Sep 2015 21:52:24 +0200<br>
From: Brandon Keith Biggs <<a moz-do-not-send="true"
href="mailto:brandonkeithbiggs@gmail.com" target="_blank">brandonkeithbiggs@gmail.com</a>><br>
To: <a moz-do-not-send="true"
href="mailto:pyqt@riverbankcomputing.com" target="_blank">pyqt@riverbankcomputing.com</a><br>
Subject: Re: [PyQt] Playing an ogg file with QtMultimedia?<br>
Message-ID: <<a moz-do-not-send="true"
href="mailto:55EF3C78.3060305@gmail.com" target="_blank">55EF3C78.3060305@gmail.com</a>><br>
Content-Type: text/plain; charset="windows-1252";
Format="flowed"<br>
<br>
Hello,<br>
> I get:<br>
> "Unsupported media type."<br>
> as the error.<br>
><br>
> I found:<br>
> <a moz-do-not-send="true"
href="http://stackoverflow.com/questions/15043620/cant-play-ogg-and-flac"
target="_blank">http://stackoverflow.com/questions/15043620/cant-play-ogg-and-flac</a><br>
><br>
> and installed the codecs from:<br>
> <a moz-do-not-send="true"
href="http://www.xiph.org/dshow/" target="_blank">http://www.xiph.org/dshow/</a><br>
><br>
> I just ran the binary installer installing them into:<br>
> C:\Program Files (x86)\Xiph.Org\Open Codecs\x64<br>
><br>
> But I am still getting the unsupported media type.<br>
> Thank you,<br>
><br>
> Brandon Keith Biggs <<a moz-do-not-send="true"
href="http://www.brandonkeithbiggs.com/" target="_blank">http://www.brandonkeithbiggs.com/</a>><br>
> On 9/4/2015 9:56 AM, Florian Bruhin wrote:<br>
>> Hi,<br>
>><br>
>> (also Cc-ing the list again as I don't think it was
intended to send<br>
>> this off-list)<br>
>><br>
>> * Brandon Keith Biggs<<a moz-do-not-send="true"
href="mailto:brandonkeithbiggs@gmail.com" target="_blank">brandonkeithbiggs@gmail.com</a>>
[2015-09-04 09:31:41 +0200]:<br>
>>> Here is what I have, but it is silent and there
is no error:<br>
>>><br>
>>> self.player =
QtMultimedia.QMediaPlayer(self)<br>
>>> self.s =
QtMultimedia.QMediaContent(QUrl("sounds/my_sound.ogg"))<br>
>> This should probably be QUrl.fromLocalFile(...)
instead.<br>
>><br>
>>> self.player.setMedia(self.s)<br>
>>> self.player.play()<br>
>>><br>
>>> Could there be some kind of dll that I need to
put in my PyQt5 dir?<br>
>> If a DLL was missing, Qt would probably
terminate/abort.<br>
>><br>
>> Some things to check:<br>
>><br>
>> - .error()/.errorString()<br>
>> - .volume() (in the example they do .setVolume(50))<br>
>><br>
>> Florian<br>
>><br>
><br>
<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a moz-do-not-send="true"
href="https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20150908/a689efc2/attachment-0001.html"
target="_blank">https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20150908/a689efc2/attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Tue, 8 Sep 2015 17:51:45 -0400<br>
From: Saeed Mahdizadeh Bakhshmand <<a
moz-do-not-send="true"
href="mailto:saeedbakhshmand@gmail.com" target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:saeedbakhshmand@gmail.com">saeedbakhshmand@gmail.com</a></a>><br>
To: <a moz-do-not-send="true"
href="mailto:pyqt@riverbankcomputing.com" target="_blank">pyqt@riverbankcomputing.com</a><br>
Subject: [PyQt] Return type Qlist<QModelIndex> is
ignored because it<br>
is unknown to PythonQt<br>
Message-ID:<br>
<CAGdd0Q7Q7u4+yuagqUOo=6PAS+DzXJ4CZ=<a
moz-do-not-send="true"
href="mailto:ASpc0y6sLS2UhJLA@mail.gmail.com"
target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:ASpc0y6sLS2UhJLA@mail.gmail.com">ASpc0y6sLS2UhJLA@mail.gmail.com</a></a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Hello All,<br>
<br>
I am trying to obtain a list (indices) of selected cells in
a QTableView<br>
using this script (in 3D slicer interface):<br>
<br>
table = qt.QTableView()<br>
...<br>
#setup of the table and adding models and items etc.<br>
...<br>
select = table.selectionModel()<br>
index = select.selectedIndexes()<br>
<br>
and I get this error:<br>
<br>
File "<console>", line 1, in <module><br>
<br>
ValueError: Called QList<QModelIndex> selectedRows(),
return type<br>
'QList<QModelIndex>' is ignored because it is unknown
to PythonQt. Probably<br>
you should register it using qRegisterMetaType() or add a
default<br>
constructor decorator to the class.<br>
<br>
<br>
Any hint on which way is better and how can I register an
unknown type in<br>
PythonQt?<br>
<br>
<br>
Best,<br>
<br>
Saeed<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a moz-do-not-send="true"
href="https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20150908/60ae1d5e/attachment-0001.html"
target="_blank">https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20150908/60ae1d5e/attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Message: 4<br>
Date: Wed, 9 Sep 2015 06:22:12 +0200<br>
From: Florian Bruhin <<a moz-do-not-send="true"
href="mailto:me@the-compiler.org" target="_blank">me@the-compiler.org</a>><br>
To: <a moz-do-not-send="true"
href="mailto:pyqt@riverbankcomputing.com" target="_blank">pyqt@riverbankcomputing.com</a><br>
Subject: Re: [PyQt] Return type Qlist<QModelIndex> is
ignored because<br>
it is unknown to PythonQt<br>
Message-ID: <20150909042212.GW18577@tonks><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
* Saeed Mahdizadeh Bakhshmand <<a moz-do-not-send="true"
href="mailto:saeedbakhshmand@gmail.com" target="_blank">saeedbakhshmand@gmail.com</a>>
[2015-09-08 17:51:45 -0400]:<br>
> Any hint on which way is better and how can I register
an unknown type in<br>
> PythonQt?<br>
<br>
PythonQt != PyQt ;)<br>
<br>
Florian<br>
<br>
-- <br>
<a moz-do-not-send="true" href="http://www.the-compiler.org"
target="_blank">http://www.the-compiler.org</a> | <a
moz-do-not-send="true" href="mailto:me@the-compiler.org"
target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:me@the-compiler.org">me@the-compiler.org</a></a> (Mail/XMPP)<br>
GPG: 916E B0C8 FD55 A072 | <a moz-do-not-send="true"
href="http://the-compiler.org/pubkey.asc" target="_blank">http://the-compiler.org/pubkey.asc</a><br>
I love long mails! | <a moz-do-not-send="true"
href="http://email.is-not-s.ms/" target="_blank">http://email.is-not-s.ms/</a><br>
-------------- next part --------------<br>
A non-text attachment was scrubbed...<br>
Name: not available<br>
Type: application/pgp-signature<br>
Size: 819 bytes<br>
Desc: not available<br>
URL: <<a moz-do-not-send="true"
href="https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20150909/56db31a4/attachment-0001.sig"
target="_blank">https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20150909/56db31a4/attachment-0001.sig</a>><br>
<br>
------------------------------<br>
<br>
Subject: Digest Footer<br>
<br>
_______________________________________________<br>
PyQt mailing list<br>
<a moz-do-not-send="true"
href="mailto:PyQt@riverbankcomputing.com" target="_blank">PyQt@riverbankcomputing.com</a><br>
<a moz-do-not-send="true"
href="https://www.riverbankcomputing.com/mailman/listinfo/pyqt"
target="_blank">https://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><br>
<br>
------------------------------<br>
<br>
End of PyQt Digest, Vol 134, Issue 9<br>
************************************<br>
</div>
<br>
_______________________________________________<br>
PyQt mailing list <a moz-do-not-send="true"
href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a><br>
<a moz-do-not-send="true"
href="https://www.riverbankcomputing.com/mailman/listinfo/pyqt"
rel="noreferrer" target="_blank">https://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><br>
</blockquote>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
PyQt mailing list <a class="moz-txt-link-abbreviated" href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a>
<a class="moz-txt-link-freetext" href="https://www.riverbankcomputing.com/mailman/listinfo/pyqt">https://www.riverbankcomputing.com/mailman/listinfo/pyqt</a></pre>
</blockquote>
<br>
</body>
</html>