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...
-
Residents of the northeastern United States suffered record-setting low temperatures throughout November and December 2021. Spot prices of heating oil rose 25%, to over $2 a gallon. a. What effect...
-
Calculate the energy density versus temperature very early in the universe when the temperatures were above \(k T=300 \mathrm{MeV}\). At those temperatures, quarks and gluons were released from...
-
Tierney County Total Governmental Funds Preclosing Trial Balance December 31, 20X5 Debit Credit Additional Information 1. The beginning trial balance of the general capital assets and general...
-
2. In the system below, the coefficient of friction between the block and the table is 0.2. T2 2 kg 5 kg Find the acceleration of the system and the tensions T1 and T2. 10 kg [8]
-
Singh Development Co. is deciding whether to proceed with Project X. The cost would be $11 million in Year 0. There is a 50% chance that X would be hugely successful and would generate annual...
-
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...
-
In Problems 1332, use the accompanying graph of y = f(x). x = 6 (-4,2) -8 -6 -4 -2 y, 4 2 -2 -4 I 2 (2,3) 6 (6,2) X
-
If two parallel wires are placed beside each other and current is sent down each wire in the same direction, will the wires repel or attract one another? Explain using a diagram that shows the...
-
On one of your numerous displays you find discount factors as given in the following table. A client is ringing you and wishes to enter into a fixed-for-floating swap with both legs paying every 3...
-
Given a revenue function R(x)= 1,000+ x - ex, calculate the average revenue when a = 3. Give your answer to the nearest dollar. Do not include the dollar symbol in your answer.
-
If a pipe effectively extends a wrench to four times its length, by how much will the torque increase for the same applied force? no increase twice three times four times
-
1. The Lone Star Company has $1,000 par value bonds outstanding at 9 percent interest. The bonds will mature in 25 years. Use Appendix B and Appendix D for an approximate answer but calculate your...
-
Allowance for Uncollectible Accounts is a contra asset account, which means that its normal balance is a credit. However, it is possible for the account to have a debit balance before year-end...
-
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?
-
What should McDonalds do going-forward to stay ahead of its competitors? Who are McDonalds current and future competitors? What intriguing things are they doing that might erode McDonalds share of...
-
Franca has AGI of $130,000 this year. After applying the $100 floor, she has $26,000 of federal disaster losses on personal assets, $12,000 of nonfederal casualty losses on personal assets, and...
-
Does the FTB require payers to file 1 0 9 9 - NEC forms under the information reporting requirement rules that exist for, for instance, 1 0 9 9 - MISC and Form W - 2 ?
Study smarter with the SolutionInn App