Use a TArray for SoundDecoder::readAll

This commit is contained in:
Chris Robinson 2014-06-27 21:51:05 -07:00
commit 6f8545e694
5 changed files with 16 additions and 15 deletions

View file

@ -100,17 +100,17 @@ size_t SndFileDecoder::read(char *buffer, size_t bytes)
return total * SndInfo.channels * 2;
}
std::vector<char> SndFileDecoder::readAll()
TArray<char> SndFileDecoder::readAll()
{
if(SndInfo.frames <= 0)
return SoundDecoder::readAll();
int framesize = 2 * SndInfo.channels;
std::vector<char> output;
TArray<char> output;
output.resize(SndInfo.frames * framesize);
size_t got = read(&output[0], output.size());
output.resize(got);
output.Resize(SndInfo.frames * framesize);
size_t got = read(&output[0], output.Size());
output.Resize(got);
return output;
}