CS 111 - INTRODUCTION TO COMPUTING

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 united justice to establish the people.
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.
The individual wave files are already available on the assignments page. All you will need to do is to read them in and combine them together. We will assume that all of the sound files exist in the same directory/folder and by selecting one of the files your program will be able to open all of the sound files as was done for Project 3 as shown in the sample file Lect1029c.java.

You may want to include some break/silence between the words of your newly created sentence.

To join two sound objects together into a new sound:

  • First determine the length of the two original sound objects. The length of the new/joined sound object will be these two lengths added together.
  • Next copy all of the samples from the first original sound object into the new/joined sound object (where the first original sound object's sample is placed into the first sample of the new/joind sound object).
  • Finally, copy all of the samples from the second original sound object into the new/joined sound object but the position needs to be shifted by the length of the first original sound object.

Lab Assignment 12

Due: Wednesday 11/25/2015 by 11:59 pm

Create a Java program that will be written using good programming style, which includes using:

  • Multiple Methods
  • Meaningful variable names
  • In-line commenting
  • Proper indentation of program statements
  • Use of blank lines to separate blocks of code
  • Header Block Commenting for the entire program
  • Header Block Commenting for each method
Your header block comment for the program must include the following:
  • Your name,
  • Net-ID,
  • Course Name,
  • Assignment Name,
  • Day and time of the CS 111 lab section (i.e. Monday at 11:00 am)
  • A short description of the assignment
Your 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
Required Methods for the Lab Assignment:
  • Your program is to contain the main() method that will:
    • Prompt the use for one (and only one) of the seven files to be used for input for this lab.
    • Access the directory from the file specified and then open all seven sound files.
    • Join those words into the required sentence using multiple calls to the join sound method specified below.
    • Play (or explore) the sound.
    • Prompt the user for a name and save it.

  • Your program is to contain a method called join() that will:
    • take two sound objects as parameters and
    • return a newly created sound object.
    • The newly created sound object will contain the first sound object followed by the second sound object. (This is similar to the makeCollage() methods we created for pictures.)
You are also to submit the Java file electronically via the assignment link for Lab 12 in Blackboard.

-- Main.troy - 2015-11-23

Topic revision: r1 - 2015-11-23 - 00:09:36 - 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