mirror of
https://github.com/HarbourMasters/Starship
synced 2026-05-23 15:02:24 -04:00
Ported CODEC_S16 from 2ship
This commit is contained in:
@@ -1036,13 +1036,24 @@ Acmd* AudioSynth_ProcessNote(s32 noteIndex, NoteSubEu* noteSub, NoteSynthesisSta
|
||||
goto skip;
|
||||
|
||||
case CODEC_S16:
|
||||
aLoadBuffer(aList++, OS_K0_TO_PHYSICAL(bookSample->sampleAddr + synthState->samplePosInt * 2), DMEM_UNCOMPRESSED_NOTE,
|
||||
(numSamplesToLoadAdj + SAMPLES_PER_FRAME) * 2);
|
||||
aClearBuffer(aList++, DMEM_UNCOMPRESSED_NOTE,
|
||||
(numSamplesToLoadAdj + SAMPLES_PER_FRAME) * SAMPLE_SIZE);
|
||||
|
||||
flags = A_CONTINUE;
|
||||
skipBytes = 0;
|
||||
numSamplesProcessed = numSamplesToLoadAdj;
|
||||
size_t bytesToRead;
|
||||
numSamplesProcessed += numSamplesToLoadAdj;
|
||||
dmemUncompressedAddrOffset1 = numSamplesToLoadAdj;
|
||||
|
||||
if (((synthState->samplePosInt * 2) + (numSamplesToLoadAdj)*SAMPLE_SIZE) < bookSample->size) {
|
||||
bytesToRead = (numSamplesToLoadAdj)*SAMPLE_SIZE;
|
||||
} else {
|
||||
bytesToRead = bookSample->size - (synthState->samplePosInt * 2);
|
||||
}
|
||||
// 2S2H [Port] [Custom audio] Handle decoding OPUS data
|
||||
aLoadBuffer(cmd++, sampleAddr + (synthState->samplePosInt * 2), DMEM_UNCOMPRESSED_NOTE,
|
||||
bytesToRead);
|
||||
|
||||
goto skip;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user