Date: Wed, 18 Jul 2001 18:41:20 +0200 From: Christoph Kukulies <kuku@gilberto.physik.RWTH-Aachen.DE> To: Tim Pozar <pozar@lns.com> Cc: Brian Reichert <reichert@numachi.com>, Christoph Kukulies <kuku@gilberto.physik.rwth-aachen.de>, multimedia@FreeBSD.ORG Subject: Re: writing a sine to a .wav Message-ID: <20010718184119.A64530@gil.physik.rwth-aachen.de> In-Reply-To: <20010718092628.A42443@lns.com>; from pozar@lns.com on Wed, Jul 18, 2001 at 09:26:29AM -0700 References: <200107181542.f6IFgtl63993@gilberto.physik.rwth-aachen.de> <20010718114559.Q49286@numachi.com> <20010718092628.A42443@lns.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Nice. That's very close to what I'm looking for. Thanks. I'll play with it and try to understand what you are doing. On Wed, Jul 18, 2001 at 09:26:29AM -0700, Tim Pozar wrote: > I have a quicky program that will generate the raw PCM sine audio > (sans WAV headers) that you can run into SOX or write directly to > /dev/dsp (OSS). It is called tonegen and is availible at: > > http://www.lns.com/papers/tonegen/ > > Functions include... > > tonegen: Generates a sine wave on the sound card or standard out. > -a dB Sets attenuation from "all ones" in dB. Default is "0 db". > -d device Sets device name. Default is "/dev/dspW". > If "device" is "-" then it uses STDOUT > -f Hz Sets tone in Hertz. Default is "400 Hz". > -r rate Sets device sample rate in Hertz. Default is "44100 Hz". > -t seconds Sets time to run. Default is infinite. > The length of the tone will run over slightly until full > cycle stops at a "zero crossing" to prevent clicks. > > It is distributed as source only and compiles on FreeBSD and Linux. > > On Wed, Jul 18, 2001 at 11:45:59AM -0400, Brian Reichert wrote: > > On Wed, Jul 18, 2001 at 05:42:55PM +0200, Christoph Kukulies wrote: > > > Does anyone know of a function (API) or whatever that allows for generating > > > .wav data (or .mp3) data out of mathematical functions like sin(x),sin(2x), > > > sin(3x) etc. > > > > Well, sox(1) seems to be the switchblade knife for sound file > > conversion, and it can accept 'raw' and 'textual' data. > > > > .dat Text Data files > > These files contain a textual representation of > > the sample data. There is one line at the > > beginning that contains the sample rate. Subse- > > quent lines contain two numeric data items: the > > time since the beginning of the sample and the > > sample value. Values are normalized so that the > > maximum and minimum are 1.00 and -1.00. This > > file format can be used to create data files for > > external programs such as FFT analyzers or graph > > routines. SoX can also convert a file in this > > format back into one of the other file formats. > > > > I have no idea if that's useful for you, though... > > > > Brian 'you Bastard' Reichert <reichert@numachi.com> > > 37 Crystal Ave. #303 Daytime number: (603) 434-6842 > > Derry NH 03038-1713 USA Intel architecture: the left-hand path > > -- Chris Christoph P. U. Kukulies kuku@gil.physik.rwth-aachen.de "The Hammond Tonewheel Organ - God's harmonica" http://blues.physik.rwth-aachen.de/hammond.html 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?20010718184119.A64530>