<?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[QNetworkAccessManager download mp3 file]]></title><description><![CDATA[<p dir="auto">I have a code<br />
<a class="plugin-mentions-user plugin-mentions-a" href="/user/void">@<bdi>void</bdi></a> Eng::getRecord(QString&amp; file, QString&amp; word)<br />
{<br />
QEventLoop loop;<br />
req.setUrl(QUrl("<a href="http://translate.google.ru/translate_tts?ie=UTF-8&amp;q=" target="_blank" rel="noopener noreferrer nofollow ugc">http://translate.google.ru/translate_tts?ie=UTF-8&amp;q=</a>" + word + "&amp;tl=en&amp;total=1&amp;idx=0&amp;textlen=" + word.length() + "&amp;prev=input"));<br />
QNetworkReply* reply = m-&gt;get(req);<br />
QObject::connect(reply,SIGNAL(finished()),&amp;loop,SLOT(quit()));<br />
loop.exec();<br />
QFile out(file);<br />
out.open(QIODevice::Text | QIODevice::WriteOnly);<br />
QTextStream stream(&amp;out);<br />
stream &lt;&lt; reply-&gt;readAll();<br />
out.close();<br />
}@<br />
File was saved, but in incorrect format. Can i save in correct format that file?</p>
]]></description><link>https://forum.qt.io/topic/32192/qnetworkaccessmanager-download-mp3-file</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Apr 2026 11:14:50 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/32192.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 20 Sep 2013 10:00:06 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QNetworkAccessManager download mp3 file on Fri, 20 Sep 2013 10:53:44 GMT]]></title><description><![CDATA[<p dir="auto">@out.open(QIODevice::WriteOnly);<br />
out.write(reply-&gt;readAll());<br />
out.close();@</p>
<p dir="auto">Yes! Thats work!1 Thank you!</p>
]]></description><link>https://forum.qt.io/post/196087</link><guid isPermaLink="true">https://forum.qt.io/post/196087</guid><dc:creator><![CDATA[bagipro]]></dc:creator><pubDate>Fri, 20 Sep 2013 10:53:44 GMT</pubDate></item><item><title><![CDATA[Reply to QNetworkAccessManager download mp3 file on Fri, 20 Sep 2013 10:33:14 GMT]]></title><description><![CDATA[<p dir="auto">Instead of passing it to QTextStream write the QByteArray directly to QFile.<br />
For eg.<br />
Following works for me:</p>
<p dir="auto">@QEventLoop loop;<br />
QNetworkRequest req;<br />
QNetworkAccessManager <em>m = new QNetworkAccessManager;<br />
req.setUrl(QUrl("<a href="http://translate.google.com/translate_tts?ie=UTF-8&amp;tl=en&amp;q=hello+world" target="_blank" rel="noopener noreferrer nofollow ugc">http://translate.google.com/translate_tts?ie=UTF-8&amp;tl=en&amp;q=hello+world</a>"));<br />
QNetworkReply</em> reply = m-&gt;get(req);<br />
QObject::connect(reply,SIGNAL(finished()),&amp;loop,SLOT(quit()));<br />
loop.exec();</p>
<pre><code>QFile out("/root/Speech/hello.mp3");
out.open(QIODevice::WriteOnly);
//QTextStream stream(&amp;out);
//stream &lt;&lt; reply-&gt;readAll();
out.write(reply-&gt;readAll());
out.close();@
</code></pre>
]]></description><link>https://forum.qt.io/post/196082</link><guid isPermaLink="true">https://forum.qt.io/post/196082</guid><dc:creator><![CDATA[p3c0]]></dc:creator><pubDate>Fri, 20 Sep 2013 10:33:14 GMT</pubDate></item><item><title><![CDATA[Reply to QNetworkAccessManager download mp3 file on Fri, 20 Sep 2013 10:26:53 GMT]]></title><description><![CDATA[<p dir="auto">Use that for example <a href="http://kibergard.com/cache/music/3ea/853372/Selena" target="_blank" rel="noopener noreferrer nofollow ugc">http://kibergard.com/cache/music/3ea/853372/Selena</a> Gomez - Come and Get It (Fred Falke Dub).mp3</p>
]]></description><link>https://forum.qt.io/post/196080</link><guid isPermaLink="true">https://forum.qt.io/post/196080</guid><dc:creator><![CDATA[bagipro]]></dc:creator><pubDate>Fri, 20 Sep 2013 10:26:53 GMT</pubDate></item><item><title><![CDATA[Reply to QNetworkAccessManager download mp3 file on Fri, 20 Sep 2013 10:17:17 GMT]]></title><description><![CDATA[<p dir="auto">If you don't mind, can you show the complete URL that you have passed ?</p>
]]></description><link>https://forum.qt.io/post/196076</link><guid isPermaLink="true">https://forum.qt.io/post/196076</guid><dc:creator><![CDATA[p3c0]]></dc:creator><pubDate>Fri, 20 Sep 2013 10:17:17 GMT</pubDate></item><item><title><![CDATA[Reply to QNetworkAccessManager download mp3 file on Fri, 20 Sep 2013 10:11:38 GMT]]></title><description><![CDATA[<p dir="auto">Still doesn't work</p>
]]></description><link>https://forum.qt.io/post/196075</link><guid isPermaLink="true">https://forum.qt.io/post/196075</guid><dc:creator><![CDATA[bagipro]]></dc:creator><pubDate>Fri, 20 Sep 2013 10:11:38 GMT</pubDate></item><item><title><![CDATA[Reply to QNetworkAccessManager download mp3 file on Fri, 20 Sep 2013 10:08:50 GMT]]></title><description><![CDATA[<p dir="auto">Try the same code just omitting the "QIODevice::Text" mode.</p>
]]></description><link>https://forum.qt.io/post/196074</link><guid isPermaLink="true">https://forum.qt.io/post/196074</guid><dc:creator><![CDATA[p3c0]]></dc:creator><pubDate>Fri, 20 Sep 2013 10:08:50 GMT</pubDate></item></channel></rss>