On Thu, Dec 31, 2009 at 01:52:07PM -0500, Lowell Gilbert wrote:
> Gary Kline <[email protected]> writes:
> 
> >     In working toward my goal of writing a keyboard driver with builtin
> >     clicks, I'm investigating different angles.  One would be to find
> >     existing audio files and catting then thru /dev/dsp.  
> >
> >     Is there a way of turning any audio file/format into a character
> >     array---in the way that a graphic can be turned into a character
> >     array?
> >     
> >     For example, I turned the graphic of a small arrow to the following:
> >
> > unsigned char uparrow_bits[] = {
> >    0x80, 0x01, 0xc0, 0x03, 0xe0, 0x07, 0xf0, 0x0f, 0xf8, 0x1f, 0xfc, 0x3f,
> >    0xfe, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x1f, 0xf8, 0x1f, 0xf8, 0x1f};
> >
> >     Are there tools to do the same with a .au or .wav file?
> 
> od(1), but that would be silly.  Just have your program open the file
> and read it in.
> 


        Yeah, I views the file with od -c; but wouldn't it be much faster
        to have the data file part of my test program than having to open,
        read, cat thru /dev/dsp each time, close file?  I stole the cat
        from the K&R book, and by reading the click.h data file it seems
        everything would go much faster.

        (I have three actual keyboard click drivers that I'm paring down,
        just wondering in my pre-built click file wouldn't be a better
        option.  It's got a seriously beautiful waveform.

> -- 
> Lowell Gilbert, embedded/networking software engineer, Boston area
>               http://be-well.ilk.org/~lowell/

-- 
 Gary Kline  [email protected]  http://www.thought.org  Public Service Unix
        http://jottings.thought.org   http://transfinite.thought.org
    The 7.79a release of Jottings: http://jottings.thought.org/index.php

_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[email protected]"

Reply via email to