On Sun, May 05, 2013 at 10:16:30PM +0200, Dimitri Sokolyuk wrote:
> Thank you very much! The problem is gone now.
> 
> Regarding uninitialized parameters, could you please point out, which of
> them are essential? I'm not sure it is stressed in the man-page. (Certainly
> I've overseen it.)

The program is supposed to ask the device for its prefered
parameters and then check if the device has accepted them:

AFAICS, the spectrogram program assumes samples are stereo 16-bit
native byte order signed integers. For instance it could do
(pseudo-code):

        sio_initpar(&par);
        par.rchan = 2;
        par.bits = 16;
        par.le = SIO_NATIVE_LE;
        par.sig = 1;
        if (!sio_setpar(hdl, &par))
                errx(1, "couldn't set params\n");
        if (!sio_getpar(hdl, &par))
                errx(1, "couldn't get params\n");
        if (par.rchan != 2 ||
            par.bits != 16 ||
            par.le != SIO_NATIVE_LE ||
            sio.sig != 1)
                errx(1, "unsupported audio params\n");

This ensures that either the device accepts them or the program
exits.

BTW, even if the program can deal with any block size and any
sample rate, setting them to values that makes the animation look
nicer or whatever may be desirable.

Hmm.. may be this should be explained in the man page.

-- Alexandre

Reply via email to