[ale] Generating sound

Jeff Hubbs hbbs at comcast.net
Mon May 7 14:46:33 EDT 2007


Chuck -

Audacity will generate a sine wave at variable frequencies and
amplitudes.  You can save the result as a .wav and use lame to convert
to MP3. 

I'm not sure what you're trying to do, but note that in digital audio, a
digitized 1KHz sine wave will only truly repeat periodically at certain
sample rates.  For instance, 1KHz at a sample rate of 44.1KHz won't
cross zero at quite the right time, whereas it will at 44KHz. 

In the Denon audio test CD, they fudge a little on the sine frequencies
in order to get the waveform to digitize cleanly.

- Jeff

Chuck Huber wrote:
> Okay, admittedly I'm new to using sound cards beyond playing alert
> sounds and
> hooking up speakers for video/audio playback.
>
> I need to generate a 1kHz tone and
>    a) emit this through a sound card to speakers
>    and b) convert this to an MP3 file.
> I can write a quick C program that will generate integer values in a
> sinusoidal
> fashion.  However, getting these values to a sound card is a mystery
> to me at
> this point.  Perhaps I'm thinking too low of a level - maybe the sound
> card will
> accept a command to generate a tone at a certain frequency.  Don't know.
>
> Additionally, I'll need to capture the A/D input from the line input
> jack.  I
> *don't* need to do both at the same time.
>
> If anyone could point me in a direction to get started, it'd be
> greatly appreciated.
>
> Thanks,
>     - Chuck
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale
>




More information about the Ale mailing list