Programs for implement tools for digital sound, Computer Networking

Assignment Help:

You must write the 6 programs described below. All of these are command-line tools that follow the Unix style of passing switches and arguments on the command line. As such, your programs should never prompt the user for anything. You may assume that all switches appear before the first argument. The requirements below are minimal requirements; you may provide extra functionality or handle extra cases as you choose. For example, you might include a --debug switch that causes extra debugging information to be written to standard error. As a general rule, your programs should be user friendly". That means they should print useful error messages whenever possible. Additionally, your programs should print any messages or diagnostic information to standard error, with standard output reserved for sound output. I do not require that your programs be absolutely \quiet", but take care that the default behaviour prints at most a few messages.

All programs should handle the following 2 formats for sound files: .cs229 format, and .wav format, described in Appendix B. Similarly, all programs should accept the -h switch, which causes the program to display a "help" screen and then terminate. The help screen should describe the program, its usage, and all legal switches (including any extra ones you implemented).

1.0 sndinfo

This program reads all sound files passed as arguments, and for each one, displays the following.

 The file name

 The file type (.cs229 or .wav)

 The sample rate

 The bit depth

 The number of channels

 The number of samples

 The length of the sound (in seconds)

If no files are passed as arguments, then the program should read from standard input. The only required switch for this program is -h.

1.1 sndcat

This program reads all sound files passed as arguments, and writes a single sound file that is the concatenation of the inputs. If no files are passed as arguments, then the program should read from standard input. You must support the following switches.

-h: show the help screen.

-o file: specify the output file name; if omitted, write to standard output.

-w: output in .wav format instead of .cs229 format

1.2 sndchan

This program reads all sound les passed as arguments, and produces a single sound le where each channel corresponds to one of the input le channels (channel order should be preserved). For instance, if the first sound le has 2 channels and the second sound le has 3 channels, then this produces a sound le with 5 channels. If no les are passed as arguments, then the program should read from standard input. You must support the following switches.

-c n : output channel n only; otherwise all channels

-h : show the help screen.

-o file : specify the output le name; if omitted, write to standard output.

-w : output in .wav format instead of .cs229 format.

1.3 sndmix

This program reads all sound les passed as arguments, and "mixes" them into a single sound le. The program is invoked as

sndmix [switches] mult1 file1 ...multn filen

where the sample data of filei is multiplied by multi (a real value between -10 and 10); the scaled data is summed to produce the output le. You must support the following switches.

-h : show the help screen.

 -o file : specify the output le name; if omitted, write to standard output.

-w : output in .wav format instead of .cs229 format.

1.4 sndgen

This program is a mess of switches. It produces a sound of a specified frequency and waveform, using a simple ADSR envelope (see Appendix D). You must support the following switches.

-h : show the help screen.

-o file: specify the output le name; if omitted, write to standard output.

-w: output in .wav format instead of .cs229 format

--bits n : use a bit depth of n

--sr n : use a sample rate of n

-f r : use a frequency of r Hz

-t r : total duration of r seconds

-v p : Peak volume. 0  p  1

-a r : attack time of r seconds

-d r : decay time of r seconds

-s p : sustain volume. 0  p  1

-r r : release time of r seconds

--sine : generate a sine wave

--triangle : generate a triangle wave

--sawtooth : generate a sawtooth wave

--pulse : generate a pulse wave

--pf p : Fraction of the time the pulse wave is "up"

Note that the volume parameters are given as the percentage of the maximum volume.

1.5 sndplay

This program reads a music file in .abc229 format and produces a sound file of that music.

You must support the following switches.

-h : show the help screen.

-o file : specify the output file name; if omitted, write to standard output.

-w: output in .wav format instead of .cs229 format

--bits n: use a bit depth of n

--sr n : use a sample rate of n

--mute n : do not play instrument n


Related Discussions:- Programs for implement tools for digital sound

Error and flow control in dll, differntiate between error control and flow...

differntiate between error control and flow control in data link layer

Dns working - domain name server, DNS Working While discussing about t...

DNS Working While discussing about the working of the DNS, there are many things which need to consider and play Avery significant role. This can the type of communication bet

What is dhcp, What is DHCP? DHCP is short for Dynamic Host Configuratio...

What is DHCP? DHCP is short for Dynamic Host Configuration Protocol. Its major task is to automatically assign an IP address to devices across the network. It first checks for

Explain fdm and tdm with example, Question 1 Explain FDM and TDM with exam...

Question 1 Explain FDM and TDM with example Question 2 Define B-ISDN and explain its services Question 3 What is symmetric key cryptography? Describe one symmetric

Multiple activity charts, A multiple activity chart records the related ...

A multiple activity chart records the related sequence of activities of more than one subject, men and / or machine on a common time scale showing the relationship between

Describe the term - stateful implies, Describe the term - stateful implies ...

Describe the term - stateful implies The term stateful implies that the firewall is wakeful and is capable of remembering the state of each session of packet exchange across it

What do you mean by open system, COMPUTER NETWORKS 1. What do you mean ...

COMPUTER NETWORKS 1. What do you mean by open system? What is the purpose of OSI model? Explain the layered architecture of OSI model. 2. Define the following terms: a) Ana

Define bandwidth and latency, Define Bandwidth and Latency? Network per...

Define Bandwidth and Latency? Network performance is calculated in Bandwidth (throughput) and Latency (Delay). Bandwidth of a network is given by the number of bits that can be

What are diagrams and trigrams, What are Diagrams and Trigrams? The mos...

What are Diagrams and Trigrams? The most ordinary two letter combinations are known as diagrams. e.g. th, in, er, re and an. The most common three letter combinations are known

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd