Fix the new Miniaudio audio_stream_set_position

This commit is contained in:
Agent X 2024-06-12 17:05:41 -04:00
parent 9e4599ecb3
commit 82cd4176a3
1 changed files with 1 additions and 3 deletions

View File

@ -316,9 +316,7 @@ void audio_stream_set_position(struct ModAudio* audio, f32 pos) {
if (!audio_sanity_check(audio, true, "setpos")) {
return;
}
u64 length;
ma_sound_get_length_in_pcm_frames(&audio->sound, &length);
ma_sound_seek_to_pcm_frame(&audio->sound, (u64)(length * pos));
ma_sound_seek_to_pcm_frame(&audio->sound, pos * ma_engine_get_sample_rate(&gModAudioEngine));
}
bool audio_stream_get_looping(struct ModAudio* audio) {