Skip to content

How to apply a Note with Duration to the I2S-Output Stream #880

Closed Answered by pschatzmann
Knottis asked this question in Q&A
Discussion options

You must be logged in to vote

Why don't just just create your own method like play(float note, int duration) in your sketch ?

void play(float frequency, int durationMs){
  sine.setFrequency(frequency);
  copier.copyMs(durationMs, audioInfo);
}

You will need to use the latest update or replace copyMs() with CopyN and calculate the number of "pages" yourself

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by pschatzmann
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants