that is what JES shows
function makeAudioCollage at 16286583
gtg075e
| Are you typing makeAudioCollage() [i.e. with the parentheses?] | Bill Leahy |
Can anyone give me a clue as to how to get all of the sounds to play one after the other in the collage function?
| Do you realize that your function is supposed to make a new sound that contains all the things required? In other words, your function isn't supposed to play the sounds. It should return a new sound. | Bill Leahy |
I sought the help of my TA and he has given me some guidance. I will work on it & if I still get the same error. I will make another post. Thanks. gtg075e
Yes, I understand that my function is supposed to make a new sound that contains the requirements. The instructions say I can use existing sounds from the Media Sources folders & alter them, which I did. What is it that I'm not understanding regarding construction of the function for the assignment? I'm feeling like a dope.
| Don't feel like a dope! You're smart enough to ask questions, remember. Your function should create a destination sound, (this sound must be at least 5 seconds long. You can either take a sound in the mediasources directory of that length, or create your own, using the makeEmptySound() function. You input the length in seconds of your sound. Then you will have sources sounds (at least two, and you will be taking samples from your source sound, altering them, and laying them down on your destination sound. At the end, your function should return your destination sound. This is very similar to HW2 where the canvas from HW2 is like your destination sound. If you are still confused, or have more questions, I suggest you visit a TA in their office hours. They should be able to give more specific help. Kelly Lyons |
Are we supposed to be merging the sounds, like the example on p.189?
I'm a little confused about the whole setMediaPath thing ... does the TA do SetMediaPath and tells the comptuer where they saved the downloaded files we send them and then our program does getmediapath and it works that way? gtg894w
| Correct. If you use getMediaPath for your sound files, your TA will put your sound files in a directory and setMediaPath to that directory so that your program will run correctly. To test your function yourself, you should do the same, put your sounds all in the same folder and from the command area, type setMediaPath() and then choose that folder, and your program should run. Kelly Lyons | |
the directions say that the TA must be able to play the sound from a RETURNED sound....how I used return in my function, but when i go to play(target) in the command area, it does not play my collage. What do i need to do?
| So did you call your function like this: target = makeAudioCollage() | Bill Leahy |
no....I called it target within the function makeAudioCollage()
when the TAs get my function and run it and then try to say play(target) it won't work...is that ok? but if they say target=makeAudioCollage() then it will play..
| Yes, if we tell you to return something from a function then it will be our obligation to do something with the returned value. BTW...you can also do this: play(makeAudioCollage()) to play the returned value | Bill Leahy |
when i try to play my sounds, they overlap each other. How do I make them play one at a time?
| There is a function in JES called blockingPlay(). I believe this will do what you want. Try looking under help at sound functions for more info. Kelly Lyons |
I'm trying to make my sound go backwards, but for some reason I am only getting a silence during the range that I set to play backwards... any suggestions?
| Sounds like you're not setting the correct sample in your destination. But without seeing your code, it's hard to speculate otherwise. Try emailing a TA with your code, and then you should be able to get more specific answers. Kelly Lyons |
i am doing the code for merging just as it is in the book and for the third sound on the line setSampleValueAt(target, index, value) i get an error saying: JavaSoundException: That index 220501, does not exist. There are only 220500 frames in the entire sound?
What do i need to do to the index to change this? I thought that all the index for each sound in the target had to be index=index+1
| This is a common error. It means your function is running beyond the end of the song. I assume you are using some sort of for loop on a range of values. Make your range end one before it currently is, i.e. for samples in range(1,getLength(sound)) instead of for samples in range(1, getLength(sound)+1) or something like that. Kelly Lyons |
When exactly is Homework 3 due?
| Wed September 29th 2004 at 7 PM eastern standard time Kelly Lyons |
I wrote a sound to my MediaSources Floder, but when I tell it to make a sound out of it, it asks me if I am sure its a valid sound file...what could be wrong? Thanks
| Which function are you using to write your sound? How are you calling it? What did you name your sound? Does it have the correct file extension? Any of those could be reasons this is happening. I need more information to better answer your question. Kelly Lyons |
Would merging both sounds and then mirroring them fully meet the requirements for the homework? Also, how can you see how many seconds long the final result is?
| It will satisfy the two sounds appearing, at least one of which appears twice altered in some way. Though, as I can guess from your second question, you also realize that your sound must still be over 5 seconds long to satisfy fully the requirements. Refer to the professor's answer further down in the page to find out the length of a sound. Kelly Lyons |
This is exactly what I have it doing...Can you tell what the problem is?
writeSoundTo(sound, r"C:\Documents and Settings\Adrianne Ott\Desktop\JES Software\Windows\JES\MediaSources\'aah2.wav'")
Thanks
I have the same problem. In the command area I wrote >>>sound=makeAudioCollage(), then i did >>>writeSoundTo(sound,"audiocollage.wav") and it gives me this error: I wasn't able to do what you wanted.
The error JavaSoundException has occured
JavaSoundException: That file does not already exist, andthere were problems creating a new fileof that name. Are you sure the pathto: D:\MediaSources\makeAudioCollage.wavexists?
I know the path does not exist because I'm trying to create this new path...i'm confused
| Get rid of the single quotes around aah2.wav | Bill Leahy |
As opposed to writing a function to make a 5 second empty sound, I copied into the existing 3 seconds of silence in media sources & then I mirrored the end result. Is this okay? It's longer than 5 secs (the requirement), but I'm afraid the TA will just see the 3sec filename & think it's only that long. Should I be ok?
| Why don't you change the name of the file? | Bill Leahy |
How do you figure out how long the audio collage is in seconds?
gtg550w
| Well, there is a function that will tell you how many samples are contained in the sound and a function that will tell you the sampling rate of a sound. So you should be able to divide one of those into the other and get duration. | Bill Leahy | |
do we need silence between sounds that we join together?
i am trying to play a sound, play that same sound backwards, and play a new sound, but when i run my collage, all i get is the one sound backwards
| My guess is that you keep resetting the targetIndex to 1, so that you're replacing the sound in the target, not adding to the end of it. Mark Guzdial |
Is there a way to loop a sound?
Also... can you play two sound files over top of each other?
Jason
gtg307w@mail.gatech.edu
| Looping – sure, just keep copying it in. Blending? Sure – page 201-203. Mark Guzdial |
I am typing the example straight out of the book for merging words into a sentence, it gets through the first for loop and says this:I wasn't able to do what you wanted.
The error JavaSoundException has occured
JavaSoundException: That index 66151, does not exist. There are only 66150 frames in the entire sound
Please check line 15 of C:\Documents and Settings\Justin R\My Documents\makeAudioCollage.py
| Are we talking Recipe 59 on page 189? Line 15 is a comment, so there must be some change to the code. Is the error in a getSampleValueAt? If so, you've gone too far in the source. Is it in a setSamplevalueAt? Then, increase the size of the target, e.g., target=makeEmptySound(4). Mark Guzdial |
to meet the requirements for this assignment is it sufficient to create a sentence or phrase from the speech folder (which would be differnt sound files) and either increase or decrease the volumes of the words used to make the sentence?
I changed the size of the target..Thanks it works.
| That sounds fine to me, as long as it as at least 5 seconds and you use one sound twice (once normal and once altered)! Summer McWilliams |
I am also having a hard time writing my sound to hy HD. when I type in the command area:
>>> sound = makeAudioCollage() and then
>>> writeSoundTo(sound, r"C:\GT Fall 04\CS 1315\makeAudioCollage.wav")
it gives me this error:
writeSoundTo(sound,filename): Input is not a sound.
An error occurred attempting to pass an argument to a function.
My actual function works correctly. What am I doing wrong?
| make sure your function (makeAudioCollage()) returns a sound. Angela Liang |
I am trying to play a sound, then a second sound, then play the first sound backwards. When i run it, it plays the first and third sounds but skips the middle. No errors show up so i dont understand what i need to change. The second sound is coded exactly like the first except for the name of the sound.
| When you say, skips the middle, do you mean that it plays silence through the middle? This would be caused by incorrectly setting the sample value. If however there is no silece and it simply plays sound one, followed by sound3, then most likely your target start is incorrectly set for the third sound, and so it is copying over where you would have had the second sound. Kelly Lyons |
Can I access the same two sound files and another different sound file by using multiple getMediaPath() commands?
| So long as all of your sound files are in the same directory. Kelly Lyons |
When I enter play(makeAudioCollage()) with the Media Path set, the filename "thisisatest.wav" cannot be read as a sound file? I think I am having the problem above because I had to access the file twice through getMediaPath(), and again through getMediaPath("aah.wav").
| Make sure all of your sound files are in the same directory, and that you're set the path correctly. Kelly Lyons |
whenever i copy my audio file to a target and then play, the frequency is altered so that the resulting sounds is very slow, though i have not done anything to warrent this. what am i doing wrong? would the sampling rate of my file have anything to do with it?
| I would have to see your code to be more specific, but Is your target being incremented at the same rate as your source? Kelly Lyons |
how do you save a sound on a MAC?
| It should be the same way you saved a picture on a MAC, only using the writeSoundTo() funciton instead of writePictureTo() function. You can also check the MAC help page. It may have more detailed information. Kelly Lyons |
I'm trying to use the function we used in class to play a sound backwards, but it keeps giving me the error I wasn't able to do what you wanted. The error JavaSoundException has occured. JavaSoundException: You asked for the sample at index 0. This number is less than one. Please try again using an index in the range[1,153608] Please chack line 7 of C:\...." I understand that it means that it is going through the for loop and it keeps going until the value is less than one and then there is the error(or at least i think that's what it means), but I don't know how to fix it. Please help!
| Look at the for loop that you are using to do this. It should have a range associated with it. Try making the end of the range 1 before it currently is so that the loop stops before you get to index 0 that doesn't exist Kelly Lyons |
Can we Mirror one of the sounds?
| Sure: "Any other sound technique discussed in the book or in class" | Bill Leahy |
you say at the top of the page that the guide line for our program are: "One sound must appear twice. At least one of those two times it must be altered. You must also have one other sound appearing at least once. This is the minimum" since this is the minimum, will we still be able to make a 100 if it works correctly, or will we only be able to earn a minimum grade?
| If you meet the minimum requirements and it works properly you can get a 100 but when you look yourself in the mirror will you be saying: There is a just-do-the-minimum person? | Bill Leahy |
on the last part of my collage, i am trying to make one of the sounds play backwards, except when i do this, it cuts off part of the sound in the middle. why does it do that?
| There could be many reasons. Check your source and target variables and make sure that they are both incrementing at the same rate. Also check where you are setting the sample, and make sure you are getting it from the correct place and then setting it to the correct place. Kelly Lyons |
I made separate increaseVolume(sound) and reverseSound(filename) functions. I tried to execute one within my makeAudioCollage(), but it takes WAY too long to load. I assume it's because of the multiple for loops involved. How can I avoid this?
| If it is taking too long to load, as you say, then it shouldn't be a problem with your for loops unless there is some error in the code that you have written. If what you meant was that it is taking to long to run, then it could be that you are using a very long sound maybe, or it could be due to for loops. How many do you have? You really shouldn't need that many. Are they nested? Nested for loops take a long time to run, and you shouldn't really need them for this asignment. If this is your problem, then you could avoid this by rewriting your code without so many loops. How you could do that exactly is hard to say without seeing your code. Kelly Lyons |
I meant to run...and I did have loops within loops...fixed it. Thanks a lot for the quick response!! :)
ok, i'm putting together a bunch of sounds (all original) by merging them, and it's all been working out fine. but i wanted to distort the last sound (to meet the hw requirement) and i added the merging code within the defined function for makeEcho. that way, i figured i could still have the distorted sound added on at the end. but it didn't work. all the merged sounds play, but the distorted code on the end, doesn't. any suggestions?
| Sounds like there is an error in your code. Contact a TA or an instructor: in-person, via AIM or via email | Bill Leahy |
I'm trying to merge the sounds, but only the first sound is played and the other ones are not playing? whats going on?
| I don't know whether to laugh or cry! We just can't debug your code without more to go on than that. I have this terrible feeling that you think we are all a lot smarter than we really are. Maybe if people would sign their posts with their GT number we could email and get more info? | Bill Leahy | |
nevermind the last question about merging
its cool now
Is it ok to mirror a whole sentence, or do we need to modify one word in the sentence?? and plus, there's a super long pause between the sentence, and the mirrored sentence?
| If you have a sound that is basically a sentence and you modify one word then you have modified the sound. Is that what you meant to do or is it just what happened and you want to turn it in and go on with your life? As for the long pause...something like this might be cause by the original sounds having a long empty period at the end. | Bill Leahy |
I have fiddled with my program for hours, and I still get the first two sounds(increase and decrease) to play. The third sound reverse does not seem to be going through the samples and flipping them around. I made a seperate function that I utilize the line after return sound2 {enter} blockingPlay(sound2). I have checked indention and emailed my TA, but he has not responded.
Will Smolenski gtg608y@mail.gatech.edu
I think I figured out my problem, except now the program cannot recognize "preamble.wav" as a valid sound file. I have tried reverse("preamble.wav") and reverse(getMediaPath("preamble.wav")).
gtg608y@mail.gatech.edu
| Did you do a setMediaPath() before running your code? | Bill Leahy |
Is there a reason why its taking so long for my sound to upload to the website?
| How long are you talking about and are they files from Media Sources or something else? | Bill Leahy |
"It would probably be a good idea to turn in your audio collage, too," - how do i turn in the audio collage so that the TA can listen to it if my program in JES doesn't work for him? isn't turning the code and turning the audio collage the same thing?
| No, your program should return a sound. So your TA can do this: s = makeAudioCollage() and then he or she can play the sound. If for some mysterious reason your code doesn't work it will be helpful if you have saved the sound it produced and turned that in. Otherwise our conclusion will be that it didn't work for you either. | Bill Leahy |
My collage should play a sound, then that sound mirrored, and then a final sound. The problem is that when JES plays the collage, the volume is SUPER low and my final sound (which is a quote) is speeded up (it sounds like Alvin the Chipmunk). I'm not sure why JES is manipulating the sound files this way. I tried normalizing but that opened up a whole can of worms (computer crash, etc)... Any advice? O'Nisha Lawrence
| Where did you get the files? Are they ones from media sources or your own? | Bill Leahy |
I downloaded them from sites that offer free .wav files
| It all depends on what your code is doing. But if normalizing the sound is crashing your computer, then you are doing something wrong. Are you setting the sample value that you get from your source sound without changing it? And for your last sound, are you incrementing your source and target together. If you are incrementing your source faster than your target, then it could be causing the sound to speed up. Kelly Lyons |
My samples are slowed down when i play my created collage... but when I play the 'Clip1.wav' on its own through the command box it is at its normal speed. Is there anyway to fix this in my code?
def makeAudioCollage():
Beat1=makeSound(getMediaPath("Clip1.wav"))
Beat2=makeSound(getMediaPath("Clip2.wav"))
canvas=makeSound(getMediaPath("silence.wav"))
for index in range(1,205632):
setSampleValueAt(canvas,index,getSampleValueAt(Beat1,index))
for index in range(1,205632):
setSampleValueAt(canvas,index+205632,getSampleValueAt(Beat1,index))
for index in range(1,9846):
setSampleValueAt(canvas,index+411264,getSampleValueAt(Beat1,index))
play(canvas)
writeSoundTo(canvas, r"C:\JES\mediasources\mediaout\JasonAtkinsHW3.wav")
return canvas
| If the sound was sampled at 44,100 samples/second and you copy it into a sound that was samples at 22,050 samples per second this will happen | Bill Leahy |
so there is no way of changing this.. except by using code in jython to speed it up?
| well if you copy every other sample it should go back to normal | Bill Leahy |
| Except of course you will lose high frequencies if old Nyquist was correct | Bill Leahy |
so how do i copy every other sample?
#Something like this
target = 1
for index in range(1, 205632, 2):
setSampleValueAt(canvas,target,getSampleValueAt(Beat1,index))
target = target + 1
# Bill Leahy
Say I want to loop this.. do i set my target point at the end of the first target? Doing this didn't work.
target = 1
for index in range(1, 205632, 2):
setSampleValueAt(canvas,target,getSampleValueAt(Beat1,index))
target = target + 1
target = 102816
for index in range(1, 205632, 2):
setSampleValueAt(canvas,target,getSampleValueAt(Beat1,index))
target = target + 1
I know how to loop without the targets like this:
for index in range(1,205632):
setSampleValueAt(canvas,index,getSampleValueAt(Beat1,index))
for index in range(1,205632):
setSampleValueAt(canvas,index+205632,getSampleValueAt(Beat1,index))
I just can't figure out how to use the targets and loop it now.
| The original code I posted wasn't indented properly. The for loop doesn't need to be indented under the target = 1 statement. As for your consecutive loops there is no reason to set target to that value because it will already be there. | Bill Leahy |
Links to this Page
- Homeworks-Fall 2004 last edited on 25 January 2005 at 8:25 am by lawn-199-77-209-131.lawn.gatech.edu
- The Chef's FAQ last edited on 29 January 2006 at 7:18 pm by r80h18.res.gatech.edu