Please write audio tests (was: Playing ULAW sample correctly?)

Damjan Jovanovic damjan.jov at
Tue Nov 3 11:48:29 CST 2009

On Tue, Nov 3, 2009 at 3:33 PM,  <Joerg-Cyril.Hoehle at> wrote:
> Hi,
> Eric Pouech wrote:
>>> It is not acceptable that µ-law code bit-rots because of
>>lack of continuous
>>> testing (assuming it worked the day it was checked in).
>>actually, you can add a (small) wave file in the test program (and
>>create on the fly the needed file)
>>we already test some .exe this way in winetest
> One could do without real .wav files:
> Wine would benefit from a test in msacm32/tests/ sketched as follows:
> 0. choose some base frequency like 11025Hz;
> 1. generate a PCM sine wave tone (like winmm/tests/wave.c);
> 2. convert it to µ-law via the ACM functions;
> 3. play it via winmm if wine_interactive is set (like in wave.c)
> 4. convert it back and apply some delta function to tell if it's
>   close enough to the original sine,
>   i.e. mechanically verify that the round-trip worked.

You'd need to verify the energy in the discrete Fourier transform of
the signal at the frequency you're testing for, is say 90% of the
total signal energy.

wave.c however does this instead:

    if (winetest_interactive && (device != WAVE_MAPPER))
        trace("Playing a 5 seconds reference tone.\n");
        trace("All subsequent tones should be identical to this one.\n");
        trace("Listen for stutter, changes in pitch, volume, etc.\n");

...which is a human verification not an automated one...

And recording from the microphone while playing seems like bad news,
surrounding noise levels are unpredictable, hardware might not be
present, etc.

Any other idea how to play and record without using the microphone?
Maybe we should test against the implementation in a tool like sox

> 5. repeat 2-4 for
>  - ADPCM
>  - GSM6.10 (is available)
>  - ....
>  - actually, better enumerate all ACM converters and call them in turn
>   rather than hard-code a fixed set of them.
> I'll not write that, as the MCI will probably keep me busy until the end of the year.
> Any volunteer who wants to provide this?

> Regards,
>        Jörg Höhle.

Damjan Jovanovic

More information about the wine-devel mailing list