This commit is contained in:
cam900 2022-09-25 13:16:53 +09:00
commit 2defb12800
3 changed files with 7 additions and 7 deletions

View File

@ -111,10 +111,10 @@ long brrEncode(short* buf, unsigned char* out, long len, long loopStart) {
next+=(last1*15)/16; \
break; \
case 8: \
next+=((last1*61)/32)-((last2*15)/16); \
next+=((last2*61)/32)-((last1*15)/16); \
break; \
case 12: \
next+=((last1*115)/64)-((last2*13)/16); \
next+=((last2*115)/64)-((last1*13)/16); \
break; \
} \
\

View File

@ -243,7 +243,7 @@ bool DivSample::save(const char* path) {
break;
}
default:
sf_write_raw(f,data16,length16);
sf_writef_short(f,data16,samples);
break;
}
@ -852,7 +852,7 @@ void DivSample::render() {
}
break;
case DIV_SAMPLE_DEPTH_BRR: // BRR
brrDecode(dataBRR,data16,samples);
brrDecode(dataBRR,data16,lengthBRR);
break;
case DIV_SAMPLE_DEPTH_VOX: // VOX
oki_decode(dataVOX,data16,samples);
@ -909,7 +909,7 @@ void DivSample::render() {
data8[i]=data16[i]>>8;
}
}
if (depth!=DIV_SAMPLE_DEPTH_VOX) { // BRR
if (depth!=DIV_SAMPLE_DEPTH_BRR) { // BRR
if (!initInternal(DIV_SAMPLE_DEPTH_BRR,samples)) return;
// TODO: loop point
brrEncode(data16,dataBRR,samples,0);

View File

@ -86,7 +86,7 @@ SafeWriter* DivEngine::saveZSM(unsigned int zsmrate, bool loop) {
// Prepare to write song data
playSub(false);
size_t tickCount=0;
//size_t tickCount=0;
bool done=false;
int loopPos=-1;
int writeCount=0;
@ -155,7 +155,7 @@ SafeWriter* DivEngine::saveZSM(unsigned int zsmrate, bool loop) {
fracWait &= MASTER_CLOCK_MASK;
if (totalWait>0) {
zsm.tick(totalWait);
tickCount+=totalWait;
//tickCount+=totalWait;
}
}
// end of song