JEAB186X / Project

1 stars 1 forks source link

AudioHandler.java #1

Open agustafson19 opened 4 years ago

agustafson19 commented 4 years ago

Create an audio handler class with the following specifications:

void playNote(int note) must play a single note, specified by the "note" variable.

void startPlayingRecord(RecordHandler rh) must start playing the current record in the recordhandler class.

void stopPlayingRecord() must stop playing the current record if it is playing.

Additionally, do look for alternative ways to play audio in Java; the way we're doing it right now may not be the best.

kelvis24 commented 4 years ago

Sure! Roger that

agustafson19 commented 4 years ago

Here are some of the methods I predict you will need to play a record: rh.startRecalling();//Starts the recalling process in the Record Handler rh.nextPitch();//Switches to the next note and returns its pitch; this can be the "index" of the note rh.thisRhythm();//Returns the rhythm of the current note; you decide how you want to represent rhythm. I recommend a whole note to be 1, half note 2, quarter note 4, eighth note 8, and sixteenth note 16. rh.tempo();//Returns the tempo (how fast the piece is) in beats per minute. One quarter note is one beat. Notice that you will have to wait in terms of milliseconds per beat for this beat. Thread.sleep(int milliseconds);//This makes your thread wait before proceeding: Your thread is run by pressing the "playback" button, so this will only effect code running through this method.

If you need any help halting the startPlayingRecord() method with the stopPlayingRecord() method, ask me.