Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   Bugs and Troubleshooting (http://www.alice.org/community/forumdisplay.php?f=18)
-   -   sound cuts off early when looping (http://www.alice.org/community/showthread.php?t=7051)

Dj Tech42 08-04-2011 11:04 PM

sound cuts off early when looping
 
I have a certain sound I want looped in my world, and I have made sure that the sound doesn't cut off when I am editing it. But, in Alice, it keeps cutting off before starting the sound again. (It goes through the sound, then there is a pause, and then it starts it again) :confused: Is it cutting off because it is loading the sound? If so, is there a way I can set it up so it doesn't have to load the sound over and over again?

David B 08-05-2011 08:44 AM

[QUOTE=Dj Tech42;40305]I have a certain sound I want looped in my world, and I have made sure that the sound doesn't cut off when I am editing it. But, in Alice, it keeps cutting off before starting the sound again. (It goes through the sound, then there is a pause, and then it starts it again) :confused: Is it cutting off because it is loading the sound? If so, is there a way I can set it up so it doesn't have to load the sound over and over again?[/QUOTE]

Your lucky! Most people can't even get sound to play in Alice in the first place. The only way that I know how to fix this is to use Audacity to smash the sound together. I recommend doing it five times. This way the sound will cut off every five times instead. It doesn't fix the problem, but makes it less obvious.

Dj Tech42 08-05-2011 12:17 PM

That is a good solution. However, I want the sound to change volume according to the distance from the camera to the object. If I made the sound longer, the volume wouldn't "refresh" frequently enough. (The volume wouldn't change until the play sound method is run again) Is there a way the sound can change volume while playing?

zero00 08-05-2011 12:37 PM

I did an experiment like that once. I'll post it when I find it.

Edit: I can't find it. Perhaps this will help?

[B]To change volume while the sound is playing:[/B][list=1][*] Set the volume of sound you're playing to a variable (VolumeLevel = World.SoundVolume, for example)[*] As the sound plays, you can change the variable and the volume will change accordingly (If you set "SoundVolume" to 0.5, the sound will play at half its volume)[/list][B]
As for changing volume based on range[/B], multiply that "SoundVolume" variable by a percentage of how close you are to something. If you're 50% within range, multiply the variable by 0.5 (or 0.25 if you're 75% away from the object)

Dj Tech42 08-05-2011 01:40 PM

[QUOTE=zero00;40328]
[B]To change volume while the sound is playing:[/B][list=1][*] Set the volume of sound you're playing to a variable (VolumeLevel = World.SoundVolume, for example)[*] As the sound plays, you can change the variable and the volume will change accordingly (If you set "SoundVolume" to 0.5, the sound will play at half its volume)[/list][B]
As for changing volume based on range[/B], multiply that "SoundVolume" variable by a percentage of how close you are to something. If you're 50% within range, multiply the variable by 0.5 (or 0.25 if you're 75% away from the object)[/QUOTE]

Well, I understand how to do that. It's in my flight simulator if you want to see (Flight Simulator with AI thread). I did it with the gunshots, which was okay because they don't loop and the sound is very short. But, I also want to add a jet engine sound, which is longer. If I change the variable, it doesn't change the volume while the sound is playing. It does when the sound stops and plays again. That's the problem.

It also keeps pausing before starting again. I'm guessing it has to do with the sound loading again. Is there any way to program it so it doesn't load the sound over and over again?

zero00 08-05-2011 04:14 PM

Can you post the jet engine sound?

Dj Tech42 08-05-2011 04:20 PM

Yeah. It will sound weird because it is meant for looping. I have made sure that there is no space at the end of the file.

[url]http://www.mediafire.com/file/jau57ah4u338y18/Jet%20Engine%20Loop.mp3[/url]

zero00 08-05-2011 05:23 PM

Personally, I would recommend looping it in Audacity first. I would repeat the sound enough times to last several minutes.
I tried to loop the sound, but I couldn't do it in a way that sounded good. It still looped though :D

I have altered your world slightly so a sound plays as your ship moves. If you think it sounds a bit weird, its because I decided to just mangle the sound and put it into a loop. :rolleyes:

The sound you gave me had a very brief pauses at the beginning and end. You would need to cut those (and likely a little of the sound) for the loop to sound more seamless.

I'm uploading the modified world into my mediafire account. One moment...

Edit: [URL="http://www.mediafire.com/file/51rjz5lfqchllmq/Flight%20Simulator%206.5%20-%20Zero00.a2w"]Here it is![/URL] I hope this helps! :D

Dj Tech42 08-05-2011 05:43 PM

Thanks! This works perfectly! I copied over my "volume-distance formula" and everything works fine. Huge thanks!

zero00 08-05-2011 05:44 PM

Glad I could help! :D


All times are GMT -5. The time now is 03:18 AM.

Copyright ©2019, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.