If you use the shifting recipe (Program 119) with a factor of 2.0 or 3.0, youll get
Question:
If you use the shifting recipe (Program 119) with a factor of 2.0 or 3.0, you’ll get the sound repeated or even triplicated. Why? Can you fix it? Write shiftDur that takes a number of samples (or even seconds) to play the sound.
Data from Program 119
Transcribed Image Text:
def shift(source, factor): target = makeEmptySound (getLength(source)) sourceIndex = 0 for targetIndex in range (0, getLength(target)): sourceValue = getSampleValueAt(source, int(sourceIndex)) setSampleValueAt (target, targetIndex, sourceValue) sourceIndex = sourceIndex + factor if (sourceIndex >= getLength(source)): sourceIndex = 0 play(target) return target
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 60% (10 reviews)
You get the sound repeated or triplicated as the higher frequency sound takes up less t...View the full answer
Answered By
Antony Sang
I am a research and academic writer whose work is outstanding. I always have my customer's interests at heart. Time is an important factor in our day to day life so I am always time conscious. Plagiarism has never been my thing whatsoever. I give best Research Papers, Computer science and IT papers, Lab reports, Law, programming, Term papers, English and literature, History, Math, Accounting, Business Studies, Finance, Economics, Business Management, Chemistry, Biology, Physics, Anthropology, Sociology, Psychology, Nutrition, Creative Writing, Health Care, Nursing, and Articles.
5.00+
2+ Reviews
10+ Question Solved
Related Book For
Introduction To Computing And Programming In Python A Multimedia Approach
ISBN: 9780134025544
4th Edition
Authors: Mark J. Guzdial, Barbara Ericson
Question Posted:
Students also viewed these Computer science questions
-
You have been asked to interview candidates for an open secretarial position. Each candidate's qualifications for the job can be modeled with a lognormal distribution with a mean of 10 and a standard...
-
Use the data from Exercise 9.35. In exercise The weights of four randomly and independently selected bags of potatoes labeled 20 pounds were found to be 21.0, 21.5, 20.5, and 21.2 pounds. Assume...
-
The leaf springs for an automobile are formed from high-carbon steel. For best corrosion resistance, should the springs be formed by hot working or cold working? Explain. Would corrosion still occur...
-
explain the term " system development" and describe the steps involved in system development
-
The mass fractions of a mixture of gases are 15 percent nitrogen, 5 percent helium, 60 percent methane, and 20 percent ethane. This mixture is enclosed in a 4 m3 rigid, well-insulated vessel at 150...
-
Determine the tension in each cable for equilibrium. 800 N -3 m 5 m 4 n 2 m 5m- 4 m 4 m - B
-
The following are the number of pounds per day shipped by a trucking company. It is suggested that the shipments be treated as a process. Because these data are not symmetrically distributed, you...
-
Fredcos defined benefit pension plan had a PBO of $10,000,000 at the beginning of the year. This was based on a 10% discount rate (obligation discount rate). The fair value of pension plan assets at...
-
Half a liter of gas in an air conditioner is initially at a temperature of 25 degrees Celsius and 2.0 atm of pressure. The volume of the gas is rapidly expanded to 2 L and the pressure of the gas...
-
Mr B aged 52 years, has earned rupees 75,00,000 out of his business. His ex-wife gifted him a car worth rupees 8 lakh. He spent a total of rupees 20 lakh during a family trip. He won a lottery of 16...
-
Using the sound tools, figure out the characteristic pattern of different instruments. For example, pianos tend to have a pattern the opposite of what we createdthe amplitudes decrease as we get to...
-
Consider changing the if block in the frequency shift recipe (Program 119 (page 264)) to sourceIndex = sourceIndex - getLength(source). Whats the difference from just setting the sourceIndex to 0? Is...
-
Classify the given group according to the fundamental theorem of finitely generated abelian groups. (Z x Z x Z)/((3, 3, 3))
-
You have credit card debt of $30,000 that has an APR (monthly compounding) of 16%. Each month you pay the minimum monthly payment. You are required to pay only the outstanding interest. You have...
-
Identify which of the minimal sufficient statistics in (2) are complete sufficient statistics.
-
Mark, a friend of yours, has always had a nagging desire to be his own boss. He has a good job with AT&T but has several ideas for new products that he cant get AT&T interested in. Mark has done a...
-
What benefit do people get from the market for insurance? What two problems impede the insurance market from working perfectly?
-
Which of the problems in the construction of the CPI might be illustrated by each of the following situations? Explain. a. the invention of cell phones b. the introduction of air bags in cars c....
-
Identify the parties impacted by the quality and rigor of an organization's corporate governance. What responsibilities do corporate executives have to those parties?
-
Phosgene, COCl2, is a toxic gas used in the manufacture of urethane plastics. The gas dissociates at high temperature. At 400oC, the equilibrium constant Kc is 8.05 104. Find the percentage of...
-
The attenuation of a signal is 10 dB. What is the final signal power if it was originally 5 W?
-
A signal travels from point A to point B. At point A, the signal power is 100 W. At point B, the power is 90 W. What is the attenuation in decibels?
-
We modulate several voice signals and send them through the air. Is this baseband or broadband transmission?
-
A pilot taxiing on the airport loses radio contact with ATC and then sees a flashing red light being shown at his aircraft from the Air Traffic Control Tower. What action should the pilot take?
-
Discussion questions: It is better to be a human being dissatisfied than a pig satisfied; better to be Socrates dissatisfied than a fool satisfied. 1. Do you agree? Why (not)? 2. What would a...
-
Describe how to make a strong magnet out of an initially unmagnetized iron rod without using the earth or another bar magnet. Include in your instructions the materials one would need, how one could...
Study smarter with the SolutionInn App