This commit is contained in:
Nishi 2026-05-27 23:56:20 +09:00
commit e3bbeb9917
2 changed files with 3 additions and 3 deletions

View file

@ -21,7 +21,7 @@ int main(){
drv = new fishbone::SoundDriver();
snd = drv->mixer.open("dubmood.xm");
snd = drv->mixer.open("betrayal.mod");
snd->setLoop(true);
snd->resume();

View file

@ -33,13 +33,13 @@ fishbone::Sound* fishbone::XMPSoundLoader::open(fishbone::Mixer* mixer, void* bu
}
int fishbone::XMPSoundLoader::read(fishbone::Sound* sound, short* buffer, size_t frames) {
if(xmp_play_buffer(sound->impl->ctx, buffer, frames * 4, 0) < 0) return -1;
if(xmp_play_buffer(sound->impl->ctx, buffer, frames * 4, sound->isLoop() ? 0 : 1) < 0) return -1;
return frames;
}
void fishbone::XMPSoundLoader::seek(fishbone::Sound* sound, size_t pos) {
xmp_set_position(sound->impl->ctx, pos);
if(pos == 0) xmp_seek_time(sound->impl->ctx, 0);
}
fishbone::XMPSound::~XMPSound() {