diff options
author | chai <chaifix@163.com> | 2018-05-28 22:57:57 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-05-28 22:57:57 +0800 |
commit | 90a2ec2b18d7d3a36fa3106c4d063b1048d8d98e (patch) | |
tree | 42d04c0fd9bc843d9d0e54b347a00cd03533de14 /src/libjin/utils/unittest.cpp | |
parent | aa9393254a8a9deec3db5b17539a9be273965b07 (diff) |
修改读取wav错误
Diffstat (limited to 'src/libjin/utils/unittest.cpp')
-rw-r--r-- | src/libjin/utils/unittest.cpp | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/libjin/utils/unittest.cpp b/src/libjin/utils/unittest.cpp index 2c2985b..ecddffd 100644 --- a/src/libjin/utils/unittest.cpp +++ b/src/libjin/utils/unittest.cpp @@ -9,26 +9,20 @@ using namespace jin::audio; using namespace std; -int length = 2226052; -char buf[2226052]; + int main(int argc, char* argv[]) { Audio* audio = SDLAudio::get(); audio->init(0); - ifstream fs; - fs.open("a.ogg", ios::binary); - fs.read(buf, length); - SDLSource source(SDLSource::OGG, buf, length); - source.play(); - source.setLoop(true); + //SDLSource* source = SDLSource::createSource(SourceType::OGG, "a.ogg"); + SDLSource* source2 = SDLSource::createSource(SourceType::WAV, "a.wav"); + source2->play(); + source2->setLoop(true); + //source->play(); + //source->setLoop(true); int i = 0; while (true) { - i += 1; - if (i == 10) - { - source.resume(); - } SDL_Delay(1000); } audio->quit(); |