Browse Source

Fix hard-coded 128 block size limits

dds
PaulStoffregen 8 years ago
parent
commit
b51b80dc83
2 changed files with 7 additions and 7 deletions
  1. +6
    -6
      play_memory.cpp
  2. +1
    -1
      synth_dc.cpp

+ 6
- 6
play_memory.cpp View File

*out++ = ulaw_decode_table[(tmp32 >> 16) & 255]; *out++ = ulaw_decode_table[(tmp32 >> 16) & 255];
*out++ = ulaw_decode_table[(tmp32 >> 24) & 255]; *out++ = ulaw_decode_table[(tmp32 >> 24) & 255];
} }
consumed = 128;
consumed = AUDIO_BLOCK_SAMPLES;
break; break;


case 0x81: // 16 bit PCM, 44100 Hz case 0x81: // 16 bit PCM, 44100 Hz
*out++ = (int16_t)(tmp32 & 65535); *out++ = (int16_t)(tmp32 & 65535);
*out++ = (int16_t)(tmp32 >> 16); *out++ = (int16_t)(tmp32 >> 16);
} }
consumed = 128;
consumed = AUDIO_BLOCK_SAMPLES;
break; break;


case 0x02: // u-law encoded, 22050 Hz case 0x02: // u-law encoded, 22050 Hz
*out++ = s4; *out++ = s4;
s0 = s4; s0 = s4;
} }
consumed = 64;
consumed = AUDIO_BLOCK_SAMPLES/2;
break; break;


case 0x82: // 16 bits PCM, 22050 Hz case 0x82: // 16 bits PCM, 22050 Hz
*out++ = s2; *out++ = s2;
s0 = s2; s0 = s2;
} }
consumed = 64;
consumed = AUDIO_BLOCK_SAMPLES/2;
break; break;


case 0x03: // u-law encoded, 11025 Hz case 0x03: // u-law encoded, 11025 Hz
*out++ = s4; *out++ = s4;
s0 = s4; s0 = s4;
} }
consumed = 32;
consumed = AUDIO_BLOCK_SAMPLES/4;
break; break;


case 0x83: // 16 bit PCM, 11025 Hz case 0x83: // 16 bit PCM, 11025 Hz
*out++ = s2; *out++ = s2;
s0 = s2; s0 = s2;
} }
consumed = 32;
consumed = AUDIO_BLOCK_SAMPLES/4;
break; break;


default: default:

+ 1
- 1
synth_dc.cpp View File

// transitioning to a new DC level // transitioning to a new DC level
//count = (target - magnitude) / increment; //count = (target - magnitude) / increment;
count = substract_int32_then_divide_int32(target, magnitude, increment); count = substract_int32_then_divide_int32(target, magnitude, increment);
if (count >= 128) {
if (count >= AUDIO_BLOCK_SAMPLES) {
// this update will not reach the target // this update will not reach the target
do { do {
magnitude += increment; magnitude += increment;

Loading…
Cancel
Save