Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 01 Dec 1999 13:33:33 +1030 (CST)
From:      "Daniel O'Connor" <doconnor@gsoft.com.au>
To:        Warren Toomey <wkt@cs.adfa.edu.au>
Cc:        freebsd-multimedia@freebsd.org
Subject:   RE: Help ioctl()ing /dev/audio
Message-ID:  <XFMail.991201133333.doconnor@gsoft.com.au>
In-Reply-To: <199912010256.NAA06269@henry.cs.adfa.edu.au>

next in thread | previous in thread | raw e-mail | index | archive | help
On 01-Dec-99 Warren Toomey wrote:
>  I want to encode 16-bit mono/stereo audio (at different samplerates)
>  on the fly using Lame (http://www.sulaco.org/mp3/). Lame can read
>  raw PCM data from standard input and save as an MP3 file.
>  
>  However, running lame [options] < /dev/audio isn't going to work, because
>  I'll need to issue the correct ioctls to the sound device. I'm thinking of
>  writing a front-end C program which does:

Try looking at http://www.4front-tech.com/pguide/index.html

>       - reads cmd-line args, works out sound format required
>       - opens /dev/audio
>       - issues appropriate ioctl()s to /dev/audio
>       - closes file descriptor 0
>       - dup2()s /dev/audio down to file descriptor 0
>       - closes /dev/audio
>       - execs Lame with the original cmd-line args

What you could do is issue the ioctl and then act like cat..

Much less hassle :)

ie..

./myaudiothing -w -f 44100 -m | lame
 
---
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum


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?XFMail.991201133333.doconnor>