You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Create a buffer for this voiceint32_tvoice_samples[NUM_SAMPLES_PER_FRAME];
intvoice_samples_left=ARRAY_SIZE(voice_samples);
// Figure out how many samples we'll require from the input, to fill this// frame.intvoice_buffer_sample_count=1337; //FIXME!// Get the samples#defineMAX_VOICE_SAMPLES 100
int32_tvoice_buffer_samples[MAX_VOICE_SAMPLES];
// Decode some input samples for this voiceinput_sample_count=decode(voice_buffer_raw_samples, voice_buffer_samples, voice_buffer_sample_count);
// Resample voice inputwhile(voice_samples_left>0) {
// This needs to play back at 48kHzresample(f, 48000, &input_samples, &input_sample_count, &voice_samples, &voice_samples_left);
// Handle end of input bufferif (input_sample_count==0) {
if (voice_loops) {
// Voice loops; go back to start of bufferinput_samples=voice_buffer_samples;
input_sample_count=voice_buffer_sample_count;
} else {
// Voice finishes; fill with silencewhile(voice_samples_left--) {
*voice_samples++=0;
}
}
}
}
#if0//FIXME: Generate envelope for this voiceuint8_tamplitude_level=get_envelope_level(voice);
//FIXME: This buffer generation is not necessary.// The envelope counter runs at 1500 Hz = 1 update per frame.// We simply have to figure out if there's linear interpolation.// Eitherway: We can apply it in the mixing step belowuint8_tamplitude_envelope[NUM_SAMPLES_PER_FRAME];
memset(amplitude_envelope, amplitude_level, sizeof(amplitude_envelope));
// Apply amplitude envelopesmultiply(voice_samples, amplitude_envelope, NUM_SAMPLES_PER_FRAME);
#endif// Add the output to each of the MIXBINs for this voicefor(inti=0; i<8; i++) {
mix(mixbin[voice_mixbin_target[i]], NUM_SAMPLES_PER_FRAME, voice_samples, ARRAY_SIZE(voice_samples), voice_mixbin_volume[i]);
}
The text was updated successfully, but these errors were encountered:
Pseudocode:
The text was updated successfully, but these errors were encountered: