diff options
author | Stijn Buys <ingar@osirion.org> | 2011-04-17 14:21:29 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2011-04-17 14:21:29 +0000 |
commit | 09d68d3d1d77d45343e3562c0b5e0cd6816d47d3 (patch) | |
tree | 6b89c585fe8cd8bd49699cdb349566d3f382010e /src/audio/wavfile.cc | |
parent | 8264546908f1722b4d0f0e91c42dd791ba8535c4 (diff) |
Initial Ogg Vorbis sounds effect support.
Diffstat (limited to 'src/audio/wavfile.cc')
-rw-r--r-- | src/audio/wavfile.cc | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/audio/wavfile.cc b/src/audio/wavfile.cc index 3e3ca2b..58afca7 100644 --- a/src/audio/wavfile.cc +++ b/src/audio/wavfile.cc @@ -16,18 +16,13 @@ namespace audio { -PCM *Wav::load(std::string const & name) +PCM *Wav::load(std::string const & filename) { - if (!name.size()) + if (!filename.size()) return 0; - std::string filename("sounds/"); - filename.append(name); - filename.append(".wav"); - filesystem::File *wav_file = filesystem::open(filename.c_str()); if (!wav_file) { - con_warn << "Could not open " << filename << std::endl; return 0; } @@ -115,7 +110,7 @@ PCM *Wav::load(std::string const & name) } if (total_bytes < datasize) { - con_warn << "Error reading " << filename << ": file truncated!" << std::endl; + con_warn << "Error reading " << filename << ": file appears to be truncated!" << std::endl; } con_debug << " " << filename << " " << pcm->samplerate() << "Hz " << pcm->bitspersample() << "bit " << |