ID:167277
 
Does byond support .wav files
Yes.

Next!
In response to Jp
ok how do i make a verb that if i click it, it plays the wav once
In response to Mxjerrett
mob
verb
verb_name()
usr<<'file.wav'

hope that helps
In response to TheLunarWolf
whats wrong here

            SAY_Command()
set category = "Admin"
usr << 'VOC001.WAV'
In response to Mxjerrett
mob/verb/sounds()
usr<<sound('sound.wav')

did this at school so indention is probly wrong.
In response to National Guardsmen
That should be "src" and not "usr". The lot of you <.<
In response to Tiberath
But it's a verb! Shouldn't it be usr?
In response to KirbyRules
Usr should never be used unless there isn't an alternative. That's what I was taught.
If it was a verb inside a custom datum, for instance, say an Admin datum. Then it should be usr, because src would refer to the Admin datum itself. However, because it's inside the mob, src being the mob, which the client is connected directaly to. src would be the best choice to use.
Of coarse, anyone with more knowledge in DM is free to correct me if I have anything mixed up. But I know for sure, src is better to use.
In response to KirbyRules
No. I'm not going to say that it should not be usr either though. But no, using usr is no more correct than using anything else.
In response to KirbyRules
KirbyRules wrote:
But it's a verb! Shouldn't it be usr?

It *could* be usr, but src is better. Usr is safe in verbs, except for when you're calling the verb from outside.

But in this case, both src and use are correct.

O-matic
In response to Tiberath
My personal preference agrees. The only time I ever use usr is in a verb that does not belong to usr; and sometimes in mouse-related functions, though I don't even always use it there either.

With the functions where usr is alright, such as in atom/Click, I still sometimes override the client version so that I don't need usr.
client/Click(object, location)
object.Click(location, mob)

atom/Click(location, mob/M)
M << "You clicked [name]."
In response to Tiberath
Although that is a decent rule of thumb, very often, usr is the right thing to use. usr is the one who calls the proc, which is sometimes who you want to refer to. Sometimes you start a proc on someone who is not yourself.

In cases like that, I normally try to pass the usr off in a variable defined by me, to ensure that usr is who I expect it to be. That does not change the fact that usr has it's place, and should be used when needed.

src is good because it is a constant, we know that src is the one holding the proc, so even if the usr and src should equal the same thing, it is best to just go with src.
In response to KirbyRules
KirbyRules wrote:
But it's a verb! Shouldn't it be usr?

It CAN be usr.
In response to Tiberath
Same here. I try to stay away from usr. Hopefully, it will prevent me from overlooking any future usr abuse. It's been like this for a while now. I'll only use usr when it's needed.
In response to CaptFalcon33035
            SAY_Command()
set category = "Admin"
src << 'VOC001.WAV'



why wont it work. When i click the verb nothing happens








In response to Mxjerrett
No one has solved the problem eh? Ok, first off make sure your SPEAKERS are ON. Then, do it like this.

usr << sound('file.wav')//since its a verb, usr is ok.
//to make this repeat, put ,1 after 'file.wav')
usr << sound('file.wav',1) //repeats
In response to Pyro_dragons
nver mind but i got another file to play but why wont my wav file play
In response to Mxjerrett
File names are case-sensitive. Make sure it has the same capitalization. (Perhaps .wav instead of .WAV)

Also check that you did not disable sounds. That can be checked in Options - Preferences / Client

I'm sure you do have speakers on and not muted...
In response to JackGuy
i went to options but there is no preferences just code preferences
Page: 1 2