[Openal] Spectrum analyzer - mouth movements

Jean-Michel Trivi jmtrivi at google.com
Mon Oct 18 10:19:50 PDT 2010


If you want to animate mouth movements based on your waveform, you can't use
a single sample value to decide by how much the mouth is open.
Let's say you animate the mouth at 60fps, then you need to compute the
energy of the last 16ms (1000/60) of audio (around your iOffset) to
compute iMouthOpen.

On Sat, Oct 16, 2010 at 12:34 AM, Nameless <mrnameless at hotmail.sk> wrote:

>
> Hi,
>
> I came to a problem, which I can't resolve by myself, that's why I'm asking
> here. I need mouth movements( byte 0 - 255 (255 - opened mouth, 0 - closed)
> which should be controlled by current spectrum / cur. frequency of actual
> byte/sample offset. For now, I've done this:
>
> alGetSourcei(m_pActiveSamples[i]->Source, AL_BYTE_OFFSET, &iOffset);
> ErrorCheck();
>
> if(m_pActiveSamples[i]->pCache->nBitRes == 8)
>        iMouthOpen = *(m_pActiveSamples[i]->pCache->pSampleData + iOffset);
> else
>        iMouthOpen = *(m_pActiveSamples[i]->pCache->pSampleData + iOffset *
> 2);
>
> pSample data is data chunk from wave file. But mouth movements are weird
> and
> I don't know how to "clean" them. So I'm asking if somebody knows how to
> resolve this.
>
> Thanks,
> Richard Rohac.
> --
> View this message in context:
> http://old.nabble.com/Spectrum-analyzer---mouth-movements-tp29977404p29977404.html
> Sent from the OpenAL - User mailing list archive at Nabble.com.
>
> _______________________________________________
> Openal mailing list
> Openal at opensource.creative.com
> http://opensource.creative.com/mailman/listinfo/openal
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://opensource.creative.com/pipermail/openal/attachments/20101018/620c3d8e/attachment.html


More information about the Openal mailing list