Re: [linux-audio-dev] sine wave question

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] sine wave question
From: Jim Jackson (jj_AT_scs.leeds.ac.uk)
Date: ti helmi  22 2000 - 04:32:29 EST


generate the sinewave samples and store them in a buffer.
write the buffer contents to the DAC at appropriate time.
If you need to generate several different frequencies quickly, then
generate samples for a 1Hz sine wave and save in a buffer. To play a sine
wave of F Hz pick out ever F'th sample from the buffer. For continous
playing just cylcel back to beginning of buffer when you get to or passed
the end.

On Tue, 22 Feb 2000, Scott C. Knight wrote:

> Ok, I've written a program before to generate and play one period of a
> sine wave. Is it possible to play less than one full period? Or would it
> just sound all scrwewed up. Like Im thinking of playing a sinewave when a
> button is clicked, but with generating one full period or multiples or 1
> period theres a bit of delay when releasing the button, but if you only
> generate and play the sine wave while the button is down it would work. So
> i guess my question is, how would I go about generating a sine wave to
> play on the fly rather than generating it then palying it. Sorry if this
> question seems to easy, but this seemed like the best place to ask.
>
> Scott Knight
>
>


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : pe maalis 10 2000 - 07:23:27 EST