<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[It can run normally in pyqt5, how to run in pyside6?]]></title><description><![CDATA[<p dir="auto">This code works in pyqt5. But in pyside6, there is no setSampleSize, setCodec, setByteOrder and setSampleType in QAudioFormat. And the usage of QAudioOutput also seems to have changed. How should this code be modified?</p>
<pre><code>class CAudioRender(QObject):
    def __init__(self, parent=None):
        super().__init__(parent=parent)
        self.m_audio_output = 0
        self.m_audio_fmt = 0
        self.m_io_device = 0

    def open_audio_render(self, channels, bits, samples):
        self.m_audio_fmt = QAudioFormat()
        self.m_audio_fmt.setChannelCount(2)
        self.m_audio_fmt.setSampleRate(48000)
        self.m_audio_fmt.setSampleSize(16)
        self.m_audio_fmt.setCodec("audio/pcm")
        self.m_audio_fmt.setByteOrder(QAudioFormat.LittleEndian)
        self.m_audio_fmt.setSampleType(QAudioFormat.UnSignedInt)
        self.m_audio_output = QAudioOutput(self.m_audio_fmt, self)
        self.m_io_device = self.m_audio_output.start()
</code></pre>
]]></description><link>https://forum.qt.io/topic/151918/it-can-run-normally-in-pyqt5-how-to-run-in-pyside6</link><generator>RSS for Node</generator><lastBuildDate>Wed, 28 Oct 2026 19:18:02 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/151918.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 07 Nov 2023 03:27:22 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to It can run normally in pyqt5, how to run in pyside6? on Wed, 08 Nov 2023 07:11:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/friedemannkleint">@<bdi>friedemannkleint</bdi></a> Thank you for providing the information, it is very helpful.</p>
]]></description><link>https://forum.qt.io/post/779109</link><guid isPermaLink="true">https://forum.qt.io/post/779109</guid><dc:creator><![CDATA[WangQi1005]]></dc:creator><pubDate>Wed, 08 Nov 2023 07:11:33 GMT</pubDate></item><item><title><![CDATA[Reply to It can run normally in pyqt5, how to run in pyside6? on Tue, 07 Nov 2023 07:18:44 GMT]]></title><description><![CDATA[<p dir="auto">There is also  a blog post: <a href="https://www.qt.io/blog/qt-multimedia-in-qt-6" target="_blank" rel="noopener noreferrer nofollow ugc">https://www.qt.io/blog/qt-multimedia-in-qt-6</a></p>
]]></description><link>https://forum.qt.io/post/778984</link><guid isPermaLink="true">https://forum.qt.io/post/778984</guid><dc:creator><![CDATA[friedemannkleint]]></dc:creator><pubDate>Tue, 07 Nov 2023 07:18:44 GMT</pubDate></item><item><title><![CDATA[Reply to It can run normally in pyqt5, how to run in pyside6? on Tue, 07 Nov 2023 07:09:03 GMT]]></title><description><![CDATA[<p dir="auto">The Qt  multimedia  API has changed in Qt 6, have you checked the Audio output example<br />
<a href="https://doc.qt.io/qtforpython-6/examples/example_multimedia_audiooutput.html" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io/qtforpython-6/examples/example_multimedia_audiooutput.html</a></p>
<p dir="auto">?</p>
]]></description><link>https://forum.qt.io/post/778981</link><guid isPermaLink="true">https://forum.qt.io/post/778981</guid><dc:creator><![CDATA[friedemannkleint]]></dc:creator><pubDate>Tue, 07 Nov 2023 07:09:03 GMT</pubDate></item></channel></rss>