<?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[How to store Audio Input in array?]]></title><description><![CDATA[[[topic:post-is-deleted]]]]></description><link>https://forum.qt.io/topic/139275/how-to-store-audio-input-in-array</link><generator>RSS for Node</generator><lastBuildDate>Thu, 05 Nov 2026 09:00:11 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/139275.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 13 Sep 2022 11:09:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to store Audio Input in array? on Tue, 13 Sep 2022 11:13:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kayakaan02">@<bdi>kayakaan02</bdi></a> <a href="https://doc.qt.io/qt-5/qaudiooutput.html#start-1" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io/qt-5/qaudiooutput.html#start-1</a> returns QIODevice* which you can use to read the data (see <a href="https://doc.qt.io/qt-5/qiodevice.html#readyRead" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io/qt-5/qiodevice.html#readyRead</a> and <a href="https://doc.qt.io/qt-5/qiodevice.html#readAll" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io/qt-5/qiodevice.html#readAll</a></p>
]]></description><link>https://forum.qt.io/post/728539</link><guid isPermaLink="true">https://forum.qt.io/post/728539</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Tue, 13 Sep 2022 11:13:27 GMT</pubDate></item><item><title><![CDATA[Reply to How to store Audio Input in array? on Wed, 14 Sep 2022 11:49:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kayakaan02">@<bdi>kayakaan02</bdi></a> said in <a href="/post/728691">How to store Audio Input in array?</a>:</p>
<blockquote>
<p dir="auto">The QByteArray that readAll() returns is empty</p>
</blockquote>
<p dir="auto">That is not possible provided you call <code>readAll()</code> in the slot for <code>readyRead()</code>, just as I see you have marked as the correct answer from <a class="plugin-mentions-user plugin-mentions-a" href="/user/jsulm">@<bdi>jsulm</bdi></a> above.....  If you call <code>readAll()</code> anywhere else it could be empty.  Your code cannot be the same as the example you quote since that does not use <code>readAll()</code>.</p>
]]></description><link>https://forum.qt.io/post/728693</link><guid isPermaLink="true">https://forum.qt.io/post/728693</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Wed, 14 Sep 2022 11:49:31 GMT</pubDate></item><item><title><![CDATA[Reply to How to store Audio Input in array? on Wed, 14 Sep 2022 11:42:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a> So I have another problem, The QByteArray that readAll() returns is empty, and also I compared two .raw files that QAudioInput generated, one of them is recorded while my mic is muted and the other is normal, they have no difference. As I said, It's the same code as shown as example at QT Doc(<a href="https://doc.qt.io/qt-5/qaudiooutput.html#details" target="_blank" rel="noopener noreferrer nofollow ugc">here</a>)</p>
]]></description><link>https://forum.qt.io/post/728691</link><guid isPermaLink="true">https://forum.qt.io/post/728691</guid><dc:creator><![CDATA[kayakaan02]]></dc:creator><pubDate>Wed, 14 Sep 2022 11:42:07 GMT</pubDate></item><item><title><![CDATA[Reply to How to store Audio Input in array? on Tue, 13 Sep 2022 13:35:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a> <a class="plugin-mentions-user plugin-mentions-a" href="/user/jsulm">@<bdi>jsulm</bdi></a> thanks, I solved the problem.</p>
]]></description><link>https://forum.qt.io/post/728572</link><guid isPermaLink="true">https://forum.qt.io/post/728572</guid><dc:creator><![CDATA[kayakaan02]]></dc:creator><pubDate>Tue, 13 Sep 2022 13:35:22 GMT</pubDate></item><item><title><![CDATA[Reply to How to store Audio Input in array? on Tue, 13 Sep 2022 13:29:18 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kayakaan02">@<bdi>kayakaan02</bdi></a> said in <a href="/post/728563">How to store Audio Input in array?</a>:</p>
<blockquote>
<p dir="auto">seems like It doesn't return anything.</p>
</blockquote>
<p dir="auto">What do you mean?  When you call <a href="https://doc.qt.io/qt-6/qiodevice.html#readAll" target="_blank" rel="noopener noreferrer nofollow ugc">QByteArray QIODevice::readAll()</a> it returns a <code>QByteArray</code> of the bytes read.  If you have your own <code>char</code> buffer you would prefer it read into there is also <a href="https://doc.qt.io/qt-6/qiodevice.html#read" target="_blank" rel="noopener noreferrer nofollow ugc">qint64 QIODevice::read(char *data, qint64 maxSize)</a>.</p>
]]></description><link>https://forum.qt.io/post/728568</link><guid isPermaLink="true">https://forum.qt.io/post/728568</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Tue, 13 Sep 2022 13:29:18 GMT</pubDate></item><item><title><![CDATA[Reply to How to store Audio Input in array? on Tue, 13 Sep 2022 13:08:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jsulm">@<bdi>jsulm</bdi></a> I've got an another question, this can read the data but how can I access it? where does it store what it just read? seems like It doesn't return anything.</p>
]]></description><link>https://forum.qt.io/post/728563</link><guid isPermaLink="true">https://forum.qt.io/post/728563</guid><dc:creator><![CDATA[kayakaan02]]></dc:creator><pubDate>Tue, 13 Sep 2022 13:08:07 GMT</pubDate></item><item><title><![CDATA[Reply to How to store Audio Input in array? on Tue, 13 Sep 2022 11:23:56 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kayakaan02">@<bdi>kayakaan02</bdi></a> Yes, you can also write the data you get from the QIODevice into a file.</p>
]]></description><link>https://forum.qt.io/post/728545</link><guid isPermaLink="true">https://forum.qt.io/post/728545</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Tue, 13 Sep 2022 11:23:56 GMT</pubDate></item><item><title><![CDATA[Reply to How to store Audio Input in array? on Tue, 13 Sep 2022 11:19:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jsulm">@<bdi>jsulm</bdi></a> Thank you! I didnt see this. So as I read the data real-time it can also append data to the file?</p>
]]></description><link>https://forum.qt.io/post/728543</link><guid isPermaLink="true">https://forum.qt.io/post/728543</guid><dc:creator><![CDATA[kayakaan02]]></dc:creator><pubDate>Tue, 13 Sep 2022 11:19:13 GMT</pubDate></item><item><title><![CDATA[Reply to How to store Audio Input in array? on Tue, 13 Sep 2022 11:13:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kayakaan02">@<bdi>kayakaan02</bdi></a> <a href="https://doc.qt.io/qt-5/qaudiooutput.html#start-1" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io/qt-5/qaudiooutput.html#start-1</a> returns QIODevice* which you can use to read the data (see <a href="https://doc.qt.io/qt-5/qiodevice.html#readyRead" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io/qt-5/qiodevice.html#readyRead</a> and <a href="https://doc.qt.io/qt-5/qiodevice.html#readAll" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io/qt-5/qiodevice.html#readAll</a></p>
]]></description><link>https://forum.qt.io/post/728539</link><guid isPermaLink="true">https://forum.qt.io/post/728539</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Tue, 13 Sep 2022 11:13:27 GMT</pubDate></item></channel></rss>