Wolfgang Lenerz wrote:
>> Unfortunately 20kHz doesn't work for me at all.
> Yes, it's a pity, but I can't do anything about that, it's part of the
> Java Virtual Machine.

Well, you can output 22kHz and do at least a simple upsampling of the
sound. Better than not sound at all and 20Khz is not Hifi anyway. Example:

static double FreqAdjust = 0.0;
while ([Space left in native buffer] && [Bytes in SMSQ/E buffer]) {
    if (FreqAdjust < 1.0) {
        SSSSLastSample = [Next sample from SMSQ/E buffer++];
        [Native sound buffer++] = SSSSLastSample;
        FreqAdjust += (double)(SSSS_SAMPLE_RATE - 
20000)/(double)SSSS_SAMPLE_RATE;
    } else {
        // Double last sample
        FreqAdjust -= 1.0;
        [Native sound buffer++] = SSSSLastSample;
    }
}

> Actually, what kind of A/V interleave do you use for the qvm files?

It's always one second of sound followed by [FPS] frames.

Cheers, Marcel

_______________________________________________
QL-Users Mailing List

Reply via email to