Date: Wed, 18 Mar 1998 02:33:37 +0900 (JST) From: NAGAO -abtk- Tadaaki <nagao@cs.titech.ac.jp> To: accel@pacific.net.sg Cc: multimedia@FreeBSD.ORG Subject: Re: pcaudio volume Message-ID: <19980318023337U.abtk@wo-ppp1.cs.titech.ac.jp> In-Reply-To: Your message of "Mon, 16 Mar 1998 16:06:19 %2B0800" <v03110701b1328cc91f06@[165.21.161.136]> References: <v03110701b1328cc91f06@[165.21.161.136]>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
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>
[-- Attachment #2 --]
#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;
}
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980318023337U.abtk>
