Skip to content

Commit

Permalink
Fix: Correct math on sine-tone generation (#260)
Browse files Browse the repository at this point in the history
  • Loading branch information
bigtimebuddy authored Jan 16, 2024
1 parent 30cd00e commit 0b67d01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/sineTone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function sineTone(hertz = 200, seconds = 1): Sound
for (let i = 0; i < fArray.length; i++)
{
const time = i / buffer.sampleRate;
const angle = hertz * time * Math.PI;
const angle = hertz * time * 2 * Math.PI;

fArray[i] = Math.sin(angle) * amplitude;
}
Expand Down

0 comments on commit 0b67d01

Please sign in to comment.