This commit is contained in:
veins1 2023-03-14 23:23:17 +05:00 committed by GitHub
parent 796d96408b
commit cf04425bc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1790,9 +1790,9 @@ void UpdateMusicStream(Music music)
{
while (true)
{
int frameCountRed = (int)drwav_read_pcm_frames_s16((drwav *)music.ctxData, frameCountStillNeeded, (short *)((char *)AUDIO.System.pcmBuffer + frameCountReadTotal*frameSize));
frameCountReadTotal += frameCountRed;
frameCountStillNeeded -= frameCountRed;
int frameCountRead = (int)drwav_read_pcm_frames_s16((drwav *)music.ctxData, frameCountStillNeeded, (short *)((char *)AUDIO.System.pcmBuffer + frameCountReadTotal*frameSize));
frameCountReadTotal += frameCountRead;
frameCountStillNeeded -= frameCountRead;
if (frameCountStillNeeded == 0) break;
else drwav_seek_to_first_pcm_frame((drwav *)music.ctxData);
}
@ -1801,9 +1801,9 @@ void UpdateMusicStream(Music music)
{
while (true)
{
int frameCountRed = (int)drwav_read_pcm_frames_f32((drwav *)music.ctxData, frameCountStillNeeded, (float *)((char *)AUDIO.System.pcmBuffer + frameCountReadTotal*frameSize));
frameCountReadTotal += frameCountRed;
frameCountStillNeeded -= frameCountRed;
int frameCountRead = (int)drwav_read_pcm_frames_f32((drwav *)music.ctxData, frameCountStillNeeded, (float *)((char *)AUDIO.System.pcmBuffer + frameCountReadTotal*frameSize));
frameCountReadTotal += frameCountRead;
frameCountStillNeeded -= frameCountRead;
if (frameCountStillNeeded == 0) break;
else drwav_seek_to_first_pcm_frame((drwav *)music.ctxData);
}
@ -1815,9 +1815,9 @@ void UpdateMusicStream(Music music)
{
while (true)
{
int frameCountRed = stb_vorbis_get_samples_short_interleaved((stb_vorbis *)music.ctxData, music.stream.channels, (short *)((char *)AUDIO.System.pcmBuffer + frameCountReadTotal*frameSize), frameCountStillNeeded*music.stream.channels);
frameCountReadTotal += frameCountRed;
frameCountStillNeeded -= frameCountRed;
int frameCountRead = stb_vorbis_get_samples_short_interleaved((stb_vorbis *)music.ctxData, music.stream.channels, (short *)((char *)AUDIO.System.pcmBuffer + frameCountReadTotal*frameSize), frameCountStillNeeded*music.stream.channels);
frameCountReadTotal += frameCountRead;
frameCountStillNeeded -= frameCountRead;
if (frameCountStillNeeded == 0) break;
else stb_vorbis_seek_start((stb_vorbis *)music.ctxData);
}