<?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[what is a good way to store a huge data with QT C++?]]></title><description><![CDATA[<p dir="auto">I have audio data and I am not sure what is the best way to store it as matrix.<br />
I have 4 large files of recordings from acoustic sensors, each file has 4 channels data interleaved.<br />
I am using Qt C++ to do some treatements of these data. I already made this approach using QVector of QVectors to store the data in. I tried this code:</p>
<pre><code>QVector&lt;QVector&lt;int&gt;&gt; buffer(16) // 4 * 4 : numberOfChannels * numberOfFiles
for(int i = 0 ; i &lt; 4 ; i++){ 
	QFile file(fileList[i]);	// fileList is QList of QStrings contains 4 files path
	if(file.open(QIODevice::ReadOnly)){
		int k = 0;
		while(!file.atEnd()){
			QByteArray sample = file.read(depth/8); // depth here is 24
			int integerSample = convertByteArrayToIntFunction(sample);
			buffer[4 * i + (K%4)].append(integerSample);	
			k++;

		}
	}
}
</code></pre>
<p dir="auto">To have at the end this matrix of 16 columns like below(f:file, c:channel):<br />
f1c0 | f1c1 | f1c2 | f1c3 | f2c0 | f2c1 |  ...   | f4c2 | f4c3</p>
<p dir="auto">But this approach it takes ages for large files of few gigabytes. I am wondering if there is another efficient way to fulfill this task and gain a lot of time.<br />
Thanks in advance.</p>
]]></description><link>https://forum.qt.io/topic/142628/what-is-a-good-way-to-store-a-huge-data-with-qt-c</link><generator>RSS for Node</generator><lastBuildDate>Fri, 26 Jun 2026 19:57:58 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/142628.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 02 Feb 2023 09:06:40 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to what is a good way to store a huge data with QT C++? on Thu, 02 Feb 2023 13:09:57 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jsulm">@<bdi>jsulm</bdi></a> you mean divide the process in many times? as I understand, divide the reading from the files in different chunks and afterwords treat chunk after chunk, right!</p>
]]></description><link>https://forum.qt.io/post/746007</link><guid isPermaLink="true">https://forum.qt.io/post/746007</guid><dc:creator><![CDATA[Aa.Aa]]></dc:creator><pubDate>Thu, 02 Feb 2023 13:09:57 GMT</pubDate></item><item><title><![CDATA[Reply to what is a good way to store a huge data with QT C++? on Thu, 02 Feb 2023 12:21:51 GMT]]></title><description><![CDATA[<p dir="auto">@Aa-Aa Well, don't read whole file at once. Read it in chunks.</p>
]]></description><link>https://forum.qt.io/post/746000</link><guid isPermaLink="true">https://forum.qt.io/post/746000</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Thu, 02 Feb 2023 12:21:51 GMT</pubDate></item></channel></rss>