Mercurial > hg > svcore
comparison data/fileio/AudioFileReader.cpp @ 327:1d656dcda8ef
* some tweaks to improve usability of these classes in a console application
author | Chris Cannam |
---|---|
date | Fri, 02 Nov 2007 16:50:31 +0000 |
parents | 92e8dbde73cd |
children | 59e7fe1b1003 |
comparison
equal
deleted
inserted
replaced
326:bb6e4c46e202 | 327:1d656dcda8ef |
---|---|
13 COPYING included with this distribution for more information. | 13 COPYING included with this distribution for more information. |
14 */ | 14 */ |
15 | 15 |
16 #include "AudioFileReader.h" | 16 #include "AudioFileReader.h" |
17 | 17 |
18 void | |
19 AudioFileReader::getDeInterleavedFrames(size_t start, size_t count, | |
20 std::vector<SampleBlock> &frames) const | |
21 { | |
22 SampleBlock interleaved; | |
23 getInterleavedFrames(start, count, interleaved); | |
24 | |
25 size_t channels = getChannelCount(); | |
26 size_t rc = interleaved.size() / channels; | |
27 | |
28 frames.clear(); | |
29 | |
30 for (size_t c = 0; c < channels; ++c) { | |
31 frames.push_back(SampleBlock()); | |
32 } | |
33 | |
34 for (size_t i = 0; i < rc; ++i) { | |
35 for (size_t c = 0; c < channels; ++c) { | |
36 frames[c].push_back(interleaved[i * channels + c]); | |
37 } | |
38 } | |
39 } | |
40 |