Date: Wed, 18 Mar 1998 16:46:53 +0800 From: Richard Goh <accel@pacific.net.sg> To: NAGAO -abtk- Tadaaki <nagao@cs.titech.ac.jp> Cc: multimedia@FreeBSD.ORG Subject: Re: pcaudio volume Message-ID: <v03110700b13539ca5fbe@[165.21.154.102]> In-Reply-To: <19980318023337U.abtk@wo-ppp1.cs.titech.ac.jp> References: Your message of "Mon, 16 Mar 1998 16:06:19 %2B0800" <v03110701b1328cc91f06@[165.21.161.136]> <v03110701b1328cc91f06@[165.21.161.136]>
next in thread | previous in thread | raw e-mail | index | archive | help
Thanks! Will try it ! Just bought a sound card :( But its only S$26 ( US$16 ) :) speakers cost slight more. but will try your code first. thanks Richard At 1:33 AM +0800 3/18/98, NAGAO -abtk- Tadaaki wrote: >Hi, > >In message <v03110701b1328cc91f06@[165.21.161.136]>, > accel@pacific.net.sg (Richard Goh) wrote: >[pcaudio's volume is so low] >> Is there a way to set the volume or any documentation on this. I have tried >> the handbook, faq and the archives without much luck. > >Here attached a simple sample code to set the volume. >Try to save it as "pcavolume.c", compile it and use, for example: > ./pcavolume 500 >(though the message in the code says that volume must be 0-100, > much larger values can actually be specified.) > >Still low? Then try 1000, 2000 ..., as large as can be stored into >"int". :-) > >ps. >I'd like to recommend you to buy a sound card and use it instead of >pcaudio which uses your "beep" hardware. (The "beep" hardware is >not designed for high-quality audio sounds :-) > >Cheers, >-- Tada > NAGAO Tadaaki <nagao@cs.titech.ac.jp> > >Content-Type: Text/Plain; charset=us-ascii >Content-Transfer-Encoding: 7bit >Content-Description: pcavolume.c > >#include <stdio.h> >#include <fcntl.h> >#include <err.h> >#include <sys/ioctl.h> >#include <machine/pcaudioio.h> > >int >main(int argc, char **argv) >{ > int fd; > audio_info_t ainfo; > > if (argc < 2) > errx(1, "specify volume(0-100)"); > > AUDIO_INITINFO(&ainfo); > ainfo.play.gain = atoi(argv[1]); > > if ((fd = open("/dev/pcaudioctl", O_RDONLY, 0)) < 0) > err(1, "/dev/pcaudioctl"); > > if (ioctl(fd, AUDIO_SETINFO, &ainfo) < 0) > err(1, "AUDIO_SETINFO"); > > return 0; >} To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?v03110700b13539ca5fbe>