Hi,
I am using the Audio Library on a Teensy 3.6 and I want to play a sine wave when a certain command with a frequency comes in via Serial. This sound should last some milliseconds, but not longer. Other programming may not be interrupted.
So, I thought I could use the AudioSynthWaveformSine and play it via DAC. But when I do that, I am not able to say start/stop playing. Of course, that is quite basic behaviour, so I am sure there must be a solution to this - I am just not able to find it or figure it out.
Little background: It is for an experiment, in which I want the subject to do something based on the sound they hear. So it may be that I need to play a sine wave at 1000 Hz for 20 ms and a little later a sine wave at 1500 Hz for 100 ms.
Can anyone give me some hints?
Thanks in advance!
I am using the Audio Library on a Teensy 3.6 and I want to play a sine wave when a certain command with a frequency comes in via Serial. This sound should last some milliseconds, but not longer. Other programming may not be interrupted.
So, I thought I could use the AudioSynthWaveformSine and play it via DAC. But when I do that, I am not able to say start/stop playing. Of course, that is quite basic behaviour, so I am sure there must be a solution to this - I am just not able to find it or figure it out.
Little background: It is for an experiment, in which I want the subject to do something based on the sound they hear. So it may be that I need to play a sine wave at 1000 Hz for 20 ms and a little later a sine wave at 1500 Hz for 100 ms.
Can anyone give me some hints?
Thanks in advance!