From owner-freebsd-multimedia Tue Nov 30 18:56:28 1999 Delivered-To: freebsd-multimedia@freebsd.org Received: from henry.cs.adfa.edu.au (henry.cs.adfa.edu.au [131.236.21.158]) by hub.freebsd.org (Postfix) with ESMTP id 5C17C15980 for ; Tue, 30 Nov 1999 18:56:24 -0800 (PST) (envelope-from wkt@henry.cs.adfa.edu.au) Received: (from wkt@localhost) by henry.cs.adfa.edu.au (8.9.2/8.9.3) id NAA06269 for freebsd-multimedia@freebsd.org; Wed, 1 Dec 1999 13:56:23 +1100 (EST) From: Warren Toomey Message-Id: <199912010256.NAA06269@henry.cs.adfa.edu.au> Subject: Help ioctl()ing /dev/audio To: freebsd-multimedia@freebsd.org Date: Wed, 1 Dec 1999 13:56:23 +1100 (EST) Reply-To: wkt@cs.adfa.edu.au X-Mailer: ELM [version 2.4ME+ PL43 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Hi all, I've just joined the multimedia list, but have searched/browsed thru the back-issues to find an answer with no luck. 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: - 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 However, I'm having a damn hard time trying to find the correct ioctls to issue to /dev/audio, or even if I should be using /dev/dsp instead. I'm running FreeBSD-3.2 with the following kernel options: # css: Crystal Sound System (CSS 423x PnP) controller snd0 device css0 at isa? port 0x534 irq 5 drq 1 flags 0x08 vector adintr and the device works fine. Could somebody point me at the right place to find the right ioctls to set up: sample rate, stereo/mono etc. I've found machine/sound.h to be extremely confusing. Many thanks in advance! Warren To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message