CS-360, Assignment 7 Due Date: 12-1-2008 In this assignment you are to implement a Visual Studio .NET application written in C# that does many of the same things as the old Windows "Sound Recorder" application. (I believe Sound Recorder still comes with the Windows operating system.) This application enables the user to use a microphone and the computer's speaker to record, play back, save, and load .WAV audio clips. A diagram of the application's window (minus some of the extra features Sound Recorder has and which you are not required to implement) is given below. The title of the window should always be the name of whatever .WAV file is currently being worked on by the user. When the application first starts, the title should be just "Sound Recorder".
The application's menu item should be "File" which should consist of "Open" and "Save" submenu items. Each of these will start a Common File Dialog Box to allow the user to navigate through the computer's directory system to find or enter the name of a .WAV file to be loaded into the application or the name of a .WAV file to which the current recording is to be saved. The application should have five buttons with the images in the diagram above on them. The buttons are "GoToStart" which when clicked will go to the beginning of the current audio clip, "GoToEnd" which will go to the end of the clip, "Start Play" which will cause the clip to be played from its current position, "Stop Play" which will stop the playing or recording of an audio clip, and "Record" which will allow the user to speak into the microphone attached to the computer's sound card and record sound until the user clicks the "Stop Play" button. Your application should enable or disable these buttons in a way that "makes sense" according to what the user is doing at any given time. For example, in the diagram the user has just clicked the "Start Play" button which means that audio clip is playing. So the "Stop Play" button should be enabled and the "Record" and "Start Play" buttons should be disabled". The application should have a label control with 3D borders that presents the current position in the audio clip expressed in seconds. Another label control should display the length of the current clip, also expressed in seconds. Finally the application should have a TrackBar control which enables the user to see exactly where we are in the audio clip and to use its thumb to visually move to any other position in the clip in a visual way. A TrackBar is very similar to a standalone ScrollBar. The following is taken from Microsoft Visual Studio's Online Help on "TrackBar Control Overview": The Windows Forms TrackBar control (also sometimes called a "slider" control) is used for navigating through a large amount of information or for visually adjusting a numeric setting. The TrackBar control has two parts: the thumb, also known as a slider, and the tick marks. The thumb is the part that can be adjusted. Its position corresponds to the Value property. The tick marks are visual indicators that are spaced at regular intervals. The trackbar moves in increments that you specify and can be aligned horizontally or vertically. The key properties of the TrackBar control are Value, TickFrequency, Minimum, and Maximum. TickFrequency is the spacing of the ticks. Minimum and Maximum are the smallest and largest values that can be represented on the track bar. The TrackBar shown in the diagram doesn't look exactly like the current Windows Forms TrackBar control and also doesn't have tick marks. You have the option of using tick marks or not. The TrackBar's Minimum property will be zero and its Maximum will be determined by the length of the clip that the user is working on. This value can, of course, be determined by using the appropriate MCI "status" command string. The current position can also be obtained in similar fashion. As an audio clip is playing, the thumb of the trackbar should move and the current position label control should be continually updated. It is suggested that you use a timer to facilitate these actions. The user should also be able to drag the trackbar's thumb and in so doing move to any position in the audio clip. Once again after that kind of action the current position label control should be updated. As you are debugging your program, you will need to have access to a microphone for the part that has to do with recording sound. If you don't have a microphone, there will be one available in EB-N23 where the TAs hold their office hours. I suggest you do as much of the design, programming, and debugging of your program on whatever computer you ordinarily use. Then, if you don't have a microphone, you can either come to the TAs or to my office hours to test the part that has to do with sound recording.