Mercurial > hg > svcore
comparison data/fileio/AudioFileReader.cpp @ 1527:710e6250a401 zoom
Merge from default branch
author | Chris Cannam |
---|---|
date | Mon, 17 Sep 2018 13:51:14 +0100 |
parents | 54af1e21705c |
children |
comparison
equal
deleted
inserted
replaced
1324:d4a28d1479a8 | 1527:710e6250a401 |
---|---|
15 | 15 |
16 #include "AudioFileReader.h" | 16 #include "AudioFileReader.h" |
17 | 17 |
18 using std::vector; | 18 using std::vector; |
19 | 19 |
20 vector<vector<float>> | 20 vector<floatvec_t> |
21 AudioFileReader::getDeInterleavedFrames(sv_frame_t start, sv_frame_t count) const | 21 AudioFileReader::getDeInterleavedFrames(sv_frame_t start, sv_frame_t count) const |
22 { | 22 { |
23 vector<float> interleaved = getInterleavedFrames(start, count); | 23 floatvec_t interleaved = getInterleavedFrames(start, count); |
24 | 24 |
25 int channels = getChannelCount(); | 25 int channels = getChannelCount(); |
26 if (channels == 1) return { interleaved }; | 26 if (channels == 1) return { interleaved }; |
27 | 27 |
28 sv_frame_t rc = interleaved.size() / channels; | 28 sv_frame_t rc = interleaved.size() / channels; |
29 | 29 |
30 vector<vector<float>> frames(channels, vector<float>(rc, 0.f)); | 30 vector<floatvec_t> frames(channels, floatvec_t(rc, 0.f)); |
31 | 31 |
32 for (int c = 0; c < channels; ++c) { | 32 for (int c = 0; c < channels; ++c) { |
33 for (sv_frame_t i = 0; i < rc; ++i) { | 33 for (sv_frame_t i = 0; i < rc; ++i) { |
34 frames[c][i] = interleaved[i * channels + c]; | 34 frames[c][i] = interleaved[i * channels + c]; |
35 } | 35 } |