<?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[Qt Android MediaPlayer for .mp3 files not working]]></title><description><![CDATA[<p dir="auto">Hey there :D</p>
<p dir="auto">I am almost done with porting my app from Qt5.15.17 QMake to Qt6.9.1 CMake :DDD<br />
Last thing I noticed is that for some reason playing an .mp3 sound file does not work anymore :/</p>
<p dir="auto">Previously there were no problems,<br />
but after switching to the new version I receive output like</p>
<pre><code>I/qt.multimedia.ffmpeg(30077): Using Qt multimedia with FFmpeg version 7.1.1 LGPL version 2.1 or later
...
W/AudioCapabilities(30077): Unsupported mime audio/ac4
W/AudioCapabilities(30077): Unsupported mime audio/x-ima
W/AudioCapabilities(30077): Unsupported mime audio/eac3-joc
W/AudioCapabilities(30077): Unsupported mime audio/evrc
W/AudioCapabilities(30077): Unsupported mime audio/mpeg-L1
W/AudioCapabilities(30077): Unsupported mime audio/mpeg-L2
W/AudioCapabilities(30077): Unsupported mime audio/qcelp
W/AudioCapabilities(30077): Unsupported mime audio/x-ms-wma
W/AudioCapabilities(30077): Unsupported mime audio/evrc
W/AudioCapabilities(30077): Unsupported mime audio/qcelp
W/VideoCapabilities(30077): Unrecognized profile 4 for video/hevc
W/VideoCapabilities(30077): Unsupported mime video/mp43
W/VideoCapabilities(30077): Unrecognized profile/level 1/32 for video/mp4v-es
W/VideoCapabilities(30077): Unrecognized profile/level 32768/2 for video/mp4v-es
W/VideoCapabilities(30077): Unrecognized profile/level 32768/64 for video/mp4v-es
W/VideoCapabilities(30077): Unsupported mime video/wvc1
</code></pre>
<p dir="auto">on startup,<br />
and when trying to play my set .mp3 file just:</p>
<blockquote>
<p dir="auto">W/        ( 8481): 273 - 2 2025-06-25 15:31:34.397 QAudioSink::start: QAudioFormat not supported by QAudioDevice &gt;&gt; :0 ()</p>
</blockquote>
<p dir="auto">Why is that? The Android device I am using is the same as before and this worked perfectly using Qt5.15.</p>
<p dir="auto">I put some code in my main.cpp to print supported formats like</p>
<pre><code>QAudioDevice device = QMediaDevices::defaultAudioOutput();
qDebug() &lt;&lt; "Supported sample formats:";
for (auto fmt : device.supportedSampleFormats())
    qDebug() &lt;&lt; "  " &lt;&lt; fmt;

QAudioFormat format = device.preferredFormat();
qDebug() &lt;&lt; "Sample rate:" &lt;&lt; format.sampleRate();
qDebug() &lt;&lt; "Channel count:" &lt;&lt; format.channelCount();
qDebug() &lt;&lt; "Sample format:" &lt;&lt; format.sampleFormat();
</code></pre>
<p dir="auto">and received this output:</p>
<blockquote>
<p dir="auto">D/default (30077): Supported sample formats:<br />
D/default (30077):    Int16<br />
D/default (30077): Sample rate: 48000<br />
D/default (30077): Channel count: 2<br />
D/default (30077): Sample format: Int16</p>
</blockquote>
<p dir="auto">Because I did not find a real solution to this problem I just converted my .mp3 file to a .wav file which seems to work, but has an 10 times increased file size that also is reflected in the resulting apk/aab binary :/</p>
<p dir="auto">Is anyone aware of a solution that allows me to continue playing .mp3 files on my Android device? This also works fine on iOS and macOS builds</p>
]]></description><link>https://forum.qt.io/topic/162511/qt-android-mediaplayer-for-.mp3-files-not-working</link><generator>RSS for Node</generator><lastBuildDate>Tue, 11 Aug 2026 13:52:34 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/162511.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 25 Jun 2025 14:06:06 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Qt Android MediaPlayer for .mp3 files not working on Mon, 30 Jun 2025 10:22:18 GMT]]></title><description><![CDATA[<p dir="auto">seems like this was actually a bug and should be fixed in Qt6.10: <a href="https://bugreports.qt.io/browse/QTBUG-138057" target="_blank" rel="noopener noreferrer nofollow ugc">https://bugreports.qt.io/browse/QTBUG-138057</a></p>
<p dir="auto">So for no I am using .wav files instead and wait for Qt to release 6.10 stable</p>
]]></description><link>https://forum.qt.io/post/828303</link><guid isPermaLink="true">https://forum.qt.io/post/828303</guid><dc:creator><![CDATA[MarcoDC]]></dc:creator><pubDate>Mon, 30 Jun 2025 10:22:18 GMT</pubDate></item><item><title><![CDATA[Reply to Qt Android MediaPlayer for .mp3 files not working on Thu, 26 Jun 2025 12:37:40 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/marcodc">@<bdi>MarcoDC</bdi></a>  If gstreamer(you may use FFmpeg) build for Android is downloaded, the libs and plugins are static and can not be linked for commercial use. What I did was to build all gstreamer stuff into  a single dynamic lib. Very messy! But if your app is not commercial, you can simply link static ones to your app.</p>
]]></description><link>https://forum.qt.io/post/828175</link><guid isPermaLink="true">https://forum.qt.io/post/828175</guid><dc:creator><![CDATA[JoeCFD]]></dc:creator><pubDate>Thu, 26 Jun 2025 12:37:40 GMT</pubDate></item><item><title><![CDATA[Reply to Qt Android MediaPlayer for .mp3 files not working on Thu, 26 Jun 2025 08:54:37 GMT]]></title><description><![CDATA[<p dir="auto">Hey <a class="plugin-mentions-user plugin-mentions-a" href="/user/joecfd">@<bdi>JoeCFD</bdi></a> thanks for your answer :D</p>
<p dir="auto">How/where to I do this?</p>
]]></description><link>https://forum.qt.io/post/828158</link><guid isPermaLink="true">https://forum.qt.io/post/828158</guid><dc:creator><![CDATA[MarcoDC]]></dc:creator><pubDate>Thu, 26 Jun 2025 08:54:37 GMT</pubDate></item><item><title><![CDATA[Reply to Qt Android MediaPlayer for .mp3 files not working on Wed, 25 Jun 2025 15:10:53 GMT]]></title><description><![CDATA[<p dir="auto">both audio and video encoders/decoders have to be added in your android build.</p>
]]></description><link>https://forum.qt.io/post/828113</link><guid isPermaLink="true">https://forum.qt.io/post/828113</guid><dc:creator><![CDATA[JoeCFD]]></dc:creator><pubDate>Wed, 25 Jun 2025 15:10:53 GMT</pubDate></item><item><title><![CDATA[Reply to Qt Android MediaPlayer for .mp3 files not working on Wed, 25 Jun 2025 14:08:49 GMT]]></title><description><![CDATA[<p dir="auto">Ah I forgot, in my root project CMakeLists I just add Multimedia package to link against:</p>
<pre><code>find_package(Qt6 REQUIRED COMPONENTS Quick Qml QuickControls2 ... Multimedia)
target_link_libraries(${PROJECT_NAME} PRIVATE
    Qt::Concurrent
    Qt::Qml
    Qt::Quick
    Qt::QuickControls2
    ...
    Qt::Multimedia
)
</code></pre>
<p dir="auto">For iOS I needed to add</p>
<pre><code># Add FFMpeg lib for MediaPlayer support
qt_add_ios_ffmpeg_libraries(${PROJECT_NAME})
</code></pre>
<p dir="auto">for audio to work at all, macOS does not need any additional stuff</p>
<p dir="auto">So maybe there is some dependency for Android that I am just missing?</p>
]]></description><link>https://forum.qt.io/post/828110</link><guid isPermaLink="true">https://forum.qt.io/post/828110</guid><dc:creator><![CDATA[MarcoDC]]></dc:creator><pubDate>Wed, 25 Jun 2025 14:08:49 GMT</pubDate></item></channel></rss>