Results 1 to 3 of 3
Thread: Programming an echo to a sound
- 11-10-2012, 09:40 AM #1
Member
- Join Date
- Nov 2012
- Posts
- 3
- Rep Power
- 0
Programming an echo to a sound
An echo occurs when sound waves produced at one place reflect off a hard surface and return back to the original source. The time it takes for the sound to reach the surface and then return is the delay in the echo. Since sound attenuates (diminishes) as it travels, the reflected sound (echo) is quieter than the original.
Write a method:
private Sound echo ( Sound aSound, double delay,
double factor ) {...
which produces a sound with an echo based on the original sound aSound with a delay of delay seconds and an attenuation of factor. The delay can be converted to a number of samples by multiplying by the sampling rate of the sound. The new sound will be longer than the original sound by the number of samples that make up the delay. The first samples in the echo will just be a copy of the samples from the original sound. Once the delay has elapsed, the next set of samples (until the end of the original sound) will be the sum of the samples in the original sound and the samples from the beginning of the original sound at the attenuated amplitude. Finally the last part of the result will simply be the remaining samples of the original sound at the attenuated amplitude.
Write a program that loads a sound, allows the user to play it and then produces a sound with an echo having a delay of 0.5 seconds and an attenuation of 0.25. The new sound should then be presented for the user to play and, when done, the new sound should be saved.
- 11-10-2012, 01:55 PM #2
Re: Programming an echo to a sound
This isn't a homework factory. Recommended reading: How to ask questions the smart way
Also, it might be a good idea to reply to the two responses on your earlier thread before we come to the conclusion that you're not really interested.
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 11-11-2012, 10:09 PM #3
Member
- Join Date
- Nov 2012
- Posts
- 3
- Rep Power
- 0
Similar Threads
-
Have server echo output to multiple clients
By Wnt2bsleepin in forum New To JavaReplies: 19Last Post: 05-07-2012, 02:26 AM -
Problems with sound in java and USB sound card
By marblecatdog in forum New To JavaReplies: 1Last Post: 04-19-2011, 12:02 PM -
ant in eclipse: echo task does not print
By GVD in forum EclipseReplies: 0Last Post: 07-20-2008, 03:58 PM -
An echo server using UDP sockets
By Java Tip in forum java.netReplies: 0Last Post: 04-07-2008, 08:09 PM -
echo of pwd
By jeffpoulsen in forum New To JavaReplies: 3Last Post: 12-04-2007, 03:14 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks