I need to make a function in Java that adds a note of a certain frequency and length to audio. I have the frequency as a double, and the note length in milliseconds.
Full Function Description:
This method takes one AudioInputStream and adds the sound of a certain pure frequency to the FRONT of it, lasting a certain length of time.
So the method takes two additional parameters: frequency and noteLengthInMilliseconds. The amplitude of the additional sound should be 64*256.
However, I need to find the note's length in Frames, as well as in Bytes and Ints.
Also, any advice on how to create the note as a data array of samples (am using java.sound.sampled package) would be helpful.
FRAME & SAMPLE RATE: 44100.0hz
ENCODING: PCM_SIGNED