sound stopping
Moderators: Shine, Insert_witty_name
-
- Posts: 31
- Joined: Sat Oct 15, 2005 10:56 am
sound stopping
i have a sound clip (.wav) playing. its about 30sec long. problem is i dont know how to stop it. i tried bgmusic:stop() (bgmusic is the var for the file) then it says something to the effect of loop in gettable. i forget exactly what it said. can anyone help me out?
-
- Posts: 31
- Joined: Sat Oct 15, 2005 10:56 am
Yeah i dont like .wav sounds. you can only have like 45 seconds of it. but im too lazy to do it in a different format. and when you do a 3mb mp3, it goes to a 64mb .wav file. it pretty much sux so you have to put it on a really really bad quality. Mine works fine though. only i have this
it works fine. in fact i never even tried sound:stop() because i just use this.
Code: Select all
sound=Sound.load('file.wav', true)
some code goes here
sound = nil
-
- Posts: 31
- Joined: Sat Oct 15, 2005 10:56 am
thanks that works. now i have another sound question. i would like music to play during a race. problem is i have sounds for the engine constantly playing. the music plays for about half a second before it is drowned out by the engine. is the problem that the music isnt load enough or that the constant engine sounds override the music?
heres the code i have for the engine. if i take it out the music plays fine. but i still want to have the other sounds. is there anyway to keep them both?
heres the code i have for the engine. if i take it out the music plays fine. but i still want to have the other sounds. is there anyway to keep them both?
Code: Select all
if rpm < 1500 then
idle:play() end
if rpm > 1500 and rpm < 2000 then
revlow:play() end
if rpm > 2000 and rpm < 4000 then
revlow2:play() end
if rpm > 4000 and rpm < 6000 then
revmid:play() end
if rpm > 6000 and rpm < 9000 then
revhigh:play() end
you need to load music and not all .wav files. make your engine noise .wav and your music .it(best choice i dont know). then do this:
that is the basic idea. i think LUA player only lets one sound play at a time and .wav files are considered sound in LUA's eyes. but you can have "music" and sound playing at the same time. just get a file converter and make some compatible music. i never used anything off of .it because it came with a game.
Code: Select all
Music.playfile( 'filename.it', true)
if rpm < 1500 then
idle:play() end
if rpm > 1500 and rpm < 2000 then
revlow:play() end
if rpm > 2000 and rpm < 4000 then
revlow2:play() end
if rpm > 4000 and rpm < 6000 then
revmid:play() end
if rpm > 6000 and rpm < 9000 then
revhigh:play() end
Music.stop()
-
- Posts: 31
- Joined: Sat Oct 15, 2005 10:56 am
sorry. like i said i only used .wav files. but here are the "music" types supported if you dont know
UNI, IT, XM, S3M, MOD, MTM, STM, DSM, MED, FAR, ULT or 669
but looking around what does this do?
???? does that change the volume of your "sound"? i think it does but im not sure. it would be sweet if lua supported mp3 files. :( while we are on the subject of sound, does lua sound output in stereo or is it just mono?
UNI, IT, XM, S3M, MOD, MTM, STM, DSM, MED, FAR, ULT or 669
but looking around what does this do?
Code: Select all
SoundSystem.SFXVolume( number {0-128} )
-
- Posts: 31
- Joined: Sat Oct 15, 2005 10:56 am
if it was stereo you could make a robot! you see here are my master plans. you take psp apart. rewire the cross button, and others for sensors. then the only out put is sound so connect your speaker wires to a headphone amplifier to pump up the signal. then write some code so if one of the sensors get bumbed, play a diffrent sound or no sound.
record a sound so the balance is all on the right for left turns, record a sound so the balance is all on the left for right turns then make a sound so the balance is equal for straight forward driving. then you make a kill switch sensor so if it goes off of stairs or something no sound would be played and your robot would stop moving.
the robot would have to be 2 wheels because there are only two speakers and you would void your warranty. but it sounds practical but you would have to really make the sound signal strong.
record a sound so the balance is all on the right for left turns, record a sound so the balance is all on the left for right turns then make a sound so the balance is equal for straight forward driving. then you make a kill switch sensor so if it goes off of stairs or something no sound would be played and your robot would stop moving.
the robot would have to be 2 wheels because there are only two speakers and you would void your warranty. but it sounds practical but you would have to really make the sound signal strong.
-
- Posts: 171
- Joined: Mon Nov 14, 2005 1:32 am
- Location: Boston, Massachusetts
- Contact:
-
- Posts: 171
- Joined: Mon Nov 14, 2005 1:32 am
- Location: Boston, Massachusetts
- Contact: