🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #12868

Re: tarjeta de sonido en full-duplex

#12868
From: Manuel López
Date: Tue, 08 May 2001 21:06
29 lines
1823 bytes
Alberto Hernando <alb.ertoQUITA@ESTOwanadoo.es> escribi�:

>          dsp=open("/dev/dsp",O_RDWR,0);
>          ioctl (dsp,SNDCTL_DSP_SETDUPLEX,0);
>          /*printf ("dsp=%i\n",dsp);*/
>          ioctl (dsp, SNDCTL_DSP_SAMPLESIZE, 8);
>          ioctl (dsp, SNDCTL_DSP_CHANNELS, 1);
>          ioctl (dsp, SNDCTL_DSP_SPEED, &fs);
>          /*ioctl (dsp, SNDCTL_DSP_RESET, 0);*/

El 3er argumento de una llamada ioctl() suele ser un puntero.

As� que, aunque vayas a pasar valores constantes, has de hacerlo
mediante punteros:

	int	bits, chan, frec;

	dsp=open("/dev/dsp", O_RDWR);		// No necesita 3er arg
	ioctl (dsp, SNDCTL_DSP_SETDUPLEX);	// No necesita 3er arg

	bits = 8; chan = 1; frec = 22050;

	ioctl (dsp, SNDCTL_DSP_SAMPLESIZE, &bits);
	ioctl (dsp, SNDCTL_DSP_CHANNELS, &chan);
	ioctl (dsp, SNDCTL_DSP_SPEED, &frec);

-- 
Manuel L�pez Moreno	PGP key ID: 0xC6C9455E
Visita: Web de es.comp.os.linux.* <http://www.escomposlinux.org>
Technical Details
Message-ID: <slrn9fgnvc.2d7.luname@delly.intra.luname.net>
Path: arc1-ca.pugleaf.net!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!130.133.1.3!fu-berlin.de!uni-berlin.de!213.98.164.60!not-for-mail
References: <dfl9d9.in.ln@127.0.0.1>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f86c8,47b3d91b5e09de63
X-Google-Attributes: gidf86c8,public
X-Google-ArrivalTime: 2001-05-08 14:20:25 PST
Path: arc1-ca.pugleaf.net!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!130.133.1.3!fu-berlin.de!uni-berlin.de!213.98.164.60!not-for-mail
From: luname@linuxfan.com (Manuel López)
Newsgroups: es.comp.os.linux.programacion
Subject: Re: tarjeta de sonido en full-duplex
Date: Tue, 8 May 2001 23:06:54 +0200
Lines: 29
Message-ID: <slrn9fgnvc.2d7.luname@delly.intra.luname.net>
References: <dfl9d9.in.ln@127.0.0.1>
NNTP-Posting-Host: 213.98.164.60
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: fu-berlin.de 989356773 17739956 213.98.164.60 (16 [66614])
X-Orig-Path: luname
User-Agent: slrn/0.9.7.0 (Linux)