Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4772
Location: Pensacola, FL, USA

PostPosted: Sun Jul 10, 2011 6:20 pm   

#PLAY web files?
 
Is it possible to play sounds off a websight instead of off a local drive?

Say if i wanted to play this sound file.

Other that throwing out a #URL, cause that would get sloppy with tabs on he browser.
_________________
Discord: Shalimarwildcat
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4772
Location: Pensacola, FL, USA

PostPosted: Sun Jul 10, 2011 7:54 pm   
 
Oddly enough, if you have the file locally (like i do with the above) the URL address will fire it, but if you dont, such as in the following example, it wont.

#PLAY "http://soundfxnow.com/soundfx/sheep-baa.mp3"
_________________
Discord: Shalimarwildcat
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Jul 11, 2011 3:42 pm   
 
Sorry but the #PLAY command just calls the Windows DirectSound API. It doesn't have any built-in way to play a remote sound. You'll need to use #URL to run your browser which knows how to play remote files. Although keep in mind that the browser is still usually downloading the file to a temp directory before playing it anyway.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4772
Location: Pensacola, FL, USA

PostPosted: Mon Jul 11, 2011 3:52 pm   
 
Any chance that the above code could attempt to download said file into the appropriate local MUD folder?

Since it already plays the file if it is located locally, this would make it easier to host sound files for use in packages distributed in the package library.

With a prompt to the user of course: The file "blah.blah" was not found locally, would you like to download it?
_________________
Discord: Shalimarwildcat
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Wed Jul 13, 2011 5:27 am   
 
You might try playing around with MSP syntax. You can use the #SHOW command to display a MSP command and using the URL argument you might get it to download and play the file.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4772
Location: Pensacola, FL, USA

PostPosted: Wed Jul 13, 2011 6:06 pm   
 
The help files really give no examples on how to do this... could you?
Searching the forum had no results on MSP.

http://www.zuggsoft.com/zmud/msp.htm

That suggests that only .wav or .midi files are suppoerted.
_________________
Discord: Shalimarwildcat
Reply with quote
Fizgar
Magician


Joined: 07 Feb 2002
Posts: 333
Location: Central Virginia

PostPosted: Wed Jul 13, 2011 6:43 pm   
 
to play the above file example you gave type this on the command line.
Code:
!!SOUND(Sheep-baa.mp3 u=http://soundfxnow.com/soundfx/sheep-baa.mp3)


EDIT: I forgot to include the #show command.
Code:
#show {!!SOUND(Sheep-baa.mp3 u=http://soundfxnow.com/soundfx/sheep-baa.mp3)


I've tried with several sounds from that website and they all seem to download and play fine. Once downloaded
Code:
#show {!!SOUND(Sheep-baa.mp3)}

will play it back.
_________________
Windows Vista Home Premium SP2 32-bit
AMD Athlon Dual Core 4400+ 2.31 GHz
3 GB RAM
CMUD 3.34
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4772
Location: Pensacola, FL, USA

PostPosted: Wed Jul 13, 2011 7:06 pm   
 
Sweet, thanks a ton.
According to the documentation it will only download if its not local anyway, so using the long version everywhere should be just fine, right?
_________________
Discord: Shalimarwildcat
Reply with quote
Fizgar
Magician


Joined: 07 Feb 2002
Posts: 333
Location: Central Virginia

PostPosted: Wed Jul 13, 2011 7:08 pm   
 
I see no problem with using the long version everywhere. it still plays the sound just fine it seems.
_________________
Windows Vista Home Premium SP2 32-bit
AMD Athlon Dual Core 4400+ 2.31 GHz
3 GB RAM
CMUD 3.34
Reply with quote
Fizgar
Magician


Joined: 07 Feb 2002
Posts: 333
Location: Central Virginia

PostPosted: Wed Jul 13, 2011 7:15 pm   
 
Also if you are going to put this sort of thing in a shared package where you don't know what other users MSP settings may be you should probably include the following two commands in the onConnect event or somewhere.
Code:
#call %pref(DoMSP,1)
#call %pref(DownloadSound,1)

That will make sure MSP is enabled and that the option to download sounds is checked aswell.
_________________
Windows Vista Home Premium SP2 32-bit
AMD Athlon Dual Core 4400+ 2.31 GHz
3 GB RAM
CMUD 3.34
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4772
Location: Pensacola, FL, USA

PostPosted: Wed Jul 13, 2011 7:21 pm   
 
Odd, i cant get subsequent uses of the long command to work.
_________________
Discord: Shalimarwildcat
Reply with quote
Fizgar
Magician


Joined: 07 Feb 2002
Posts: 333
Location: Central Virginia

PostPosted: Wed Jul 13, 2011 7:25 pm   
 
Not sure what's going on there. It works fine for me, and I don't see any MSP pref options that seem to make it not work. I even shut CMUD down and restarted and the long format still seems to work fine.
_________________
Windows Vista Home Premium SP2 32-bit
AMD Athlon Dual Core 4400+ 2.31 GHz
3 GB RAM
CMUD 3.34
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4772
Location: Pensacola, FL, USA

PostPosted: Wed Jul 13, 2011 7:30 pm   
 
I reboot my system and now it works fine.
_________________
Discord: Shalimarwildcat
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net