CS 111 - Program Design I

Lab 12

In this lab, you will take the Sound File preamble.wav and create a new sentence from those words.

The sentence you are to create is:

We order the domestic people to insure justice.

The entire text of the Preamble is:

We the People of the United States, in Order to form a more perfect Union, establish Justice, insure domestic Tranquility, provide for the common defence, promote the general Welfare, and secure the Blessings of Liberty to ourselves and our Posterity, do ordain and establish this Constitution for the United States of America.
Make sure the you include some break/silence between the words of your newly created sentence.

To break the original sound into word, we need to know the starting and ending indices of the words. According to page 300 in our text book, the following words from the beginning of the Preamble can be found at the given indices from preamble10.wav:

Word Starting
Index
Ending
Index
We 0 15,730
the 15,730 17,407
People 17,407 26,726
of 26,726 31,131
the 31,131 33,413
United 33,413 40,052
States 40,052 55,510

For this lab, you may want to use the code from

Lab Assignment 12

Due: Wednesday 4/24/2012 by 11:59 pm

Create a Java program that will:

  1. Be writen using good programming style which includes:
    • Using Multiple Methods
    • Good variable names
    • In-line commenting
    • Proper indentation of program statements
    • Use of blank lines to separate blocks of code.
    • Header block commenting for the program and each method written

      Your header block comment for the program must include the following:

      • Your Name,
      • Net-ID,
      • Course Name,
      • Assignment Name and
      • Day and time of your CS 101 lab section (i.e. Wednesday at 9:00)
      • A short description of the assignment.
Header block comments for each method must include the following:
      • A description of the purpose of the method
      • A listing of the name, type and purpose of every parameter
      • A description of the return value and its type

  1. Contain the main() method that will
    • Get the soundtrack file preamble.wav
    • Create a sound object from the file
    • Split this sound into the needed words
    • Join those words into the required sentence
    • Play (or explore) the sound.
    • Prompt the user for a name and save it.

  1. Use at least two other methods:
    • One to create a sound byte from another sound
    • One to join two sounds together (one following the other)

  1. You are to submit the Java file electronically via the assignment link for Lab 12 in BLackboard.
Here are some example sound files you can use with this assignment. -- Main.troy - 2013-04-19
Topic revision: r2 - 2013-04-19 - 16:15:57 - Main.troy
 
Copyright 2016 The Board of Trustees
of the University of Illinois.webmaster@cs.uic.edu
WISEST
Helping Women Faculty Advance
Funded by NSF