Subject: Audio encodings
To: None <current-users@NetBSD.ORG>
From: William O Ferry <WOFerry+@CMU.EDU>
List: current-users
Date: 10/11/1997 21:11:20
    I was taking a look at compiling mpg123 0.59m under NetBSD,
apparently it supported it as of this newest version.  However, when I
built it and ran it I got the error message:

audio: Invalid argument

    Upon examining the code, it's dying on the statements (pasted
together from various parts of audio.c to remove a large switch
statement):

  audio_info_t ainfo;

  AUDIO_INITINFO(&ainfo);

  ainfo.play.encoding = AUDIO_ENCODING_LINEAR;
  ainfo.play.precision = 16;

  if(ioctl(ai->fn, AUDIO_SETINFO, &ainfo) == -1)
    return -1;

    According to ktrace and such, this is where the error is occurring. 
Looking at <sys/audioio.h>, I see that the above incoding is "obsolete".
 What can / should I set the encoding to for this to work?  The program
seems to output in 16-bit PCM headerless data format, and it sounds like
that encoding would be right had it not been obsoleted.  Was it replaced
with something else, or simply removed?  I'd greatly appreciate any
suggestions.  Thanks in advance.


                                                          Will Ferry

-----------------------------------------------------------------------
 William O Ferry  <woferry@CMU.EDU> | finger: woferry@Warp.RES.CMU.EDU
 http://light.res.cmu.edu/~woferry/ | talk:   finger for online status
-----------------------------------------------------------------------