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

@@ -78,7 +78,7 @@ void AudioPlayMemory::update(void)
*out++ = ulaw_decode_table[(tmp32 >> 16) & 255];
*out++ = ulaw_decode_table[(tmp32 >> 24) & 255];
}
consumed = 128;
consumed = AUDIO_BLOCK_SAMPLES;
break;

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

case 0x02: // u-law encoded, 22050 Hz
@@ -107,7 +107,7 @@ void AudioPlayMemory::update(void)
*out++ = s4;
s0 = s4;
}
consumed = 64;
consumed = AUDIO_BLOCK_SAMPLES/2;
break;

case 0x82: // 16 bits PCM, 22050 Hz
@@ -121,7 +121,7 @@ void AudioPlayMemory::update(void)
*out++ = s2;
s0 = s2;
}
consumed = 64;
consumed = AUDIO_BLOCK_SAMPLES/2;
break;

case 0x03: // u-law encoded, 11025 Hz
@@ -149,7 +149,7 @@ void AudioPlayMemory::update(void)
*out++ = s4;
s0 = s4;
}
consumed = 32;
consumed = AUDIO_BLOCK_SAMPLES/4;
break;

case 0x83: // 16 bit PCM, 11025 Hz
@@ -167,7 +167,7 @@ void AudioPlayMemory::update(void)
*out++ = s2;
s0 = s2;
}
consumed = 32;
consumed = AUDIO_BLOCK_SAMPLES/4;
break;

default:

+ 1
- 1
synth_dc.cpp View File

@@ -54,7 +54,7 @@ void AudioSynthWaveformDc::update(void)
// transitioning to a new DC level
//count = (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
do {
magnitude += increment;

Loading…
Cancel
Save