however try to understand precisely big idea implemented:
    synchronized void updateAudio(int tstates, int value) {
        tstates = tstates - audiotstates;
        audiotstates += tstates;
        float time = tstates;
        synchronized (beeper) {
            if (time + timeRem > spf) {
                level += ((spf - timeRem) / spf) * value;
                time -= spf - timeRem;
                lastLevel = (lastLevel + level) >>> 1;
                beeper[bufp++] = lastLevel;
            } else {
                timeRem += time;
                level += (time / spf) * value;
                return;
            }
            while (time > spf) {
                lastLevel = (lastLevel + value) >>> 1;
                beeper[bufp++] = lastLevel;
                time -= spf;
            }
        }
        // calculamos el nivel de sonido de la parte residual de la muestra
        // para el prуximo cambio de estado
        level = (int) (value * (time / spf));
        timeRem = time;
    }
Now, can you write the own implementation?
 
You've got a real device why poking with emulator?
ReplyDeletereal device needs some improvements :)
ReplyDeleteon emulators, this implementation IMHO is cleanest and simplest...
tiny and algorithmically interesting...
ideas from and into what modulations?