Object Oriented Recording

Programming Module

Prior to implementing the module. You need to modify Redhat Linux's audio settings by following these steps:

  1. Go to System->Preferences->Sound
  2. Under the Hardware tab make sure that the HDA NVidia is disabled and the Internal Audio is enabled with a profile of Analog Stereo Duplex.
  3. Under the Input tab make sure the Connector is "Microphone" and that the internal audio analog stereo radio button is selected.
  4. Plug in your headphone earplugs (or microphone) into the audio jack that has both the microphone symbol and the headphone symbol. You can see if your mic is working properly by tapping on the mic (earphones) and visually checking if there is movement in the Input tab section.
  5. Under the Output tab make sure the Connect is: "Analog Speakers" and that the internal audio stereo radio button is selected.
  6. Make sure that the Sound Preferences window is closed prior to running your java program. If this window is not closed, you will not be able to record anything.

You are given:

  1. A Microphone class which you will use to record audio clips. The class contains the following methods:
    • startRecording()
    • stopRecording()
    • getAudioFormat()
    • getClip()
    • getAudioInputStream()
    • getData()
    • isRecording()
    For more information on each method, type the method out and hover your mouse over the method (text) to see more information. Additionally you can refer to the Microphone source code comments.
  2. A skeleton AudioClip class that only contains a constructor and 2 private variables (attributes). This class needs to be filled in with the methods in the comment section of the class. Additional attributes may be required.
  3. A main console user interface that provides stub selection inputs that need to be filled in with your object method calls.


Requirements:

  1. The Microphone class returns an object called "Clip". You need to research this class and its methods to implement your own AudioClip class that does the following:
    • setAudioClip(...) method which sets the "Clip" and other attributes that may be needed to allow the methods below to work properly.
    • play() method which plays an AudioClip.
    • stop() method which stops playing an AudioClip.
    • loop(...) method which loops an AudioClip a finite or infinite number of times.
    • setName(...) method which sets the name of the AudioClip.
    • getName() method which returns the name of the AudioClip.
    • isPlaying() method which returns if the AudioClip is playing or not (a Boolean).
  2. Fill in the main interface with your AudioClip and Microphone method calls. (There should be no "Clip" calls visible in this interface.)