Help with playing sound.

Post Reply
tarrant
Posts: 49
Joined: Thu Apr 15, 2010 10:36 pm

Help with playing sound.

Post by tarrant »

Hi,
Code: [show] | [select all] lua
playSoundFile("Users/myhome/Documents/Mudlet/Ding.wav")
i want to play the above .wav file.

i created an alias to test this, but it doesn't seem to be working and i'm not too sure what the manual means.

Thanks.

Iocun
Posts: 174
Joined: Wed Dec 02, 2009 1:45 am

Re: Help with playing sound.

Post by Iocun »

What operating system?

tarrant
Posts: 49
Joined: Thu Apr 15, 2010 10:36 pm

Re: Help with playing sound.

Post by tarrant »

oh yeah sorry, knew i should have added more info.
mac snow leopard 10.6.5.

Iocun
Posts: 174
Joined: Wed Dec 02, 2009 1:45 am

Re: Help with playing sound.

Post by Iocun »

Try putting a / before "Users":
playSoundFile("/Users/myhome/Documents/Mudlet/Ding.wav")

tarrant
Posts: 49
Joined: Thu Apr 15, 2010 10:36 pm

Re: Help with playing sound.

Post by tarrant »

awesome. thank you!

Yetzederixx
Posts: 186
Joined: Sun Nov 14, 2010 5:57 am

Re: Help with playing sound.

Post by Yetzederixx »

getMudletHomeDir() will get the path to your profile, it's a pain in windows since to put the sound files into the same directory you have to manually go there because of the .config crap (ie, C:\Documents and Settings\Jared\.config\mudlet\profiles\DSL) but it might be better on other os's.

Denarii
Posts: 111
Joined: Thu Dec 03, 2009 10:54 pm

Re: Help with playing sound.

Post by Denarii »

I just put the sound files into the mudlet install directory rather than the profile. Then I can just do playSoundFile("x.wav")

Yetzederixx
Posts: 186
Joined: Sun Nov 14, 2010 5:57 am

Re: Help with playing sound.

Post by Yetzederixx »

I don't like cluttering up the install dir with stuff, but could you just dump them into a new dir in the install and use a relative path?

playSoundFile("/sounds/x.wav")

Denarii
Posts: 111
Joined: Thu Dec 03, 2009 10:54 pm

Re: Help with playing sound.

Post by Denarii »

sounds/x.wav or ./sounds/x.wav

Post Reply