473,402 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

Jython/Python Programmers

Greetings Group!
I'm trying to do a project for my CS class. I'm using this program
from Mark Guzdial Jython text:

def echoes(snd, delay, factor):
sound1 = makeSound(snd)
sndlen1 = getLength(sound1)
sndlen2 = sndlen1 + (delay * factor)

sound2 =decideLen(sound1, sndlen2) # this function return the length
# new sound canvas
echoamp = 1.0 for echocount in range(1, factor + 1):
echoamp = echoamp * 0.6
for echoposition1 in range(1, sndlen1):
echoposition2 = echoposition1 + (delay*echocount)
value1 = getSampleValueAt(sound1, echoposition1) * echoamp
#problem here# value2 = getSampleValueAt(sound2, echoposition2)
setSampleValueAt(sound2, echoposition2, value1 + value2)
play(sound2)
return(sound2)

def decideLen(snd1, len1):
srate1 = getSamplingRate(snd1)
time1 = len1/srate1
time1 =int( ceil(time1))
snd2 = makeEmptySound(time1)
return snd2

The problem I'm having is that this program will work for a sampling
rate of 22050, but not for the higher quality 44000 rate.
I keep getting an array out of bounds message where I marked it on the
program. Can't seem to find out why. Too much of a NewBe programmer I
guess. Any one help?
Regards,
Solar^
Apr 22 '06 #1
0 915

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Michael Chermside | last post by:
Ype writes: > For the namespaces in Jython this 'Python internal thread safety' > is handled by the Java class: > > http://www.jython.org/docs/javadoc/org/python/core/PyStringMap.html > > which...
6
by: Dave Benjamin | last post by:
Hey good people, I've been doing a lot of simultaneous Jython and CPython programming lately, and just wanted to say, with no intended ill will toward any of the individuals who have been...
4
by: angel | last post by:
A java runtime environment includes jvm and java class (for example classes.zip in sun jre). Of course jython need jvm,but does it need java class. Thanx
5
by: Maurice Ling | last post by:
Hi, I have read that this had been asked before but there's no satisfactory replies then. I have a module (pA) written in python, which originally is called by another python module (pB), and...
8
by: George Jempty | last post by:
I'm undergoing a phone interview for a Jython job today. Anybody have practical advice for me? I haven't worked with Python in years, but I have been working with Java in the meantime (resume at...
6
by: Mike Wimpe | last post by:
Other than being used to wrap Java classes, what other real use is there for Jython being that Python has many other GUI toolkits available? Also, these toolkits like Tkinter are so much better for...
4
by: Nadeem Mohsin | last post by:
Me and a couple of friends have been thinking of doing something involving Python for our final year undergrad project. We're considering the first idea mentioned on this page:...
3
by: Sloan.Kohler | last post by:
Is Jython development dead or has it just seemed that way for over a year?. The jython.org website has a recent new appearance (but no new content) and there is some message traffic on the...
5
by: sarup26 | last post by:
Hello .. I would like to know more about Python and Jython? What is the difference between both of them? What is the future for Jython and which are the areas where it is used? Swot
1
by: RC | last post by:
Dear Python Experts/Programmers, I'm going to write a Python program to access some Java class methods from our *.jar file. In your opinion, which way is the good (not the best) way to do...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.