Skip to content

Commit

Permalink
Buildfix, more checks
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Aug 2, 2020
1 parent d3ec52b commit afb9dd7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions UI/BackgroundAudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,12 @@ BackgroundAudio::Sample *BackgroundAudio::LoadSample(const std::string &path) {
return nullptr;
}

RIFFReader reader(data, (int)bytes);

WavData wave;
wave.Read(RIFFReader(data, (int)bytes));
wave.Read(reader);

if (wave.num_channels != 2) {
if (wave.num_channels != 2 || wave.sample_rate != 44100 || wave.raw_bytes_per_frame_ != 4) {
ELOG("Wave format not supported for mixer playback. Must be 16-bit raw stereo. '%s'", path.c_str());
return nullptr;
}
Expand Down

0 comments on commit afb9dd7

Please sign in to comment.