• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 10 pages
Exam (elaborations)

Java Audio Processor Project - Complete Code (AudioProcessor.java), StdAudio Guide & Worked Solution

Document preview thumbnail
Preview 2 out of 10 pages

Get 100% verified solutions and step-by-step study notes for Java Project 3 (Audio Processor / Ride the Wave)! What's included in this guide: Complete Java Source Code: Fully commented, clean implementation of AudioP using the StdAudio library. Full Command Set Implementation: Covers all 7 text commands: Play (p), Reverse (r), Speed Up/Slow Down (s), Add Noise (n), Scale Volume (v), Save Output (o), and Quit (q). Step-by-Step Study Guide: Detailed explanation of audio sample arrays (doubles between -1.0 and 1.0), array reversal algorithms, noise/clipping bounds checking, and speed factor calculations. Sample Execution & Output: Complete trace example matching expected terminal output (using sample). Perfect for verifying project logic, homework submission, and mastering Java array manipulation!

Content preview

Project 3: Ride the Wave



Overview
For this project, you will write a program that processes audio files based on
user input. You might be familiar with audio editing tools such as SoundForge
or Cool Edit Pro. The program you will write will have some of the same
functionality, only using text input commands instead of a graphical interface.


Background
This project is based around the manipulation of audio data inside a program.
As you probably known from physics classes, sound travels as a wave. We can
visualize this wave as something like a sine function.




Here is an image of several waves with different frequencies. Each is what
is called a pure tone. At the top, the frequency is lower, making the equivalent
note lower in pitch. The pitch of the notes increases as the waves go down
the page. Of course, the representation of real sounds are more complex. Real
sounds have chaotic looking wave forms because much more is going on than
just a single pure tone, as shown.




1

, Of course, computers can’t deal with with nice, smooth waves. To record or
manipulate a sound in a computer, you need to turn the wave into a series of
values. This is done with a process called sampling. Sampling means that the
wave is chopped up into lots of equal sized time divisions. For each division,
we pick one value to represent the wave at that point. In this way, we can
approximate the wave with a series of numbers. Below is a picture showing a
tiny section of a wave form. Each small blue box represents the sample value of
that wave.




With CD quality sound, there are 44,100 samples per second. That’s why
CD audio takes up so much space. Every single second has 44,100 numbers
giving the height of various parts of a wave. The StdAudio library developed
by two Princeton professors lets us easily manipulate CD quality audio, but not
MP3’s. MP3’s use a number of mathematical and psycho-acoustic techniques
to use a lot fewer numbers to represent the waves. So, we’re going to stick with
CD quality audio, stored in the form of .wav files on your computer.
The StdAudio library provides a very easy way to load and save .wav files.
When they are loaded, they will be represented as an array of double values.
Each value represents one sample. So, for a song that is 3:56 long, the array will
contain 10,407,600 double values. For this reason, we are going to stick to small
.wav files. In the format used by StdAudio, each value in the array is between
-1.0 and 1.0. Thus, a maximum volume sound has peaks at 1.0 and -1.0. A
completely silent sound represented by samples at 0.




2

Connected book
 image
Barry Wittman, Aditya Mathur, Tim Korb Start Concurrent
Publisher: 2013 ISBN: 9781626710092 Edition: Unknown

Document information

Uploaded on
November 7, 2026
Number of pages
10
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$10.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Sold
0
Followers
0
Items
7
Last sold
-



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions