DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • June 24, 2018, 05:45:17 AM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: Playing a midi file  (Read 3268 times)
0 Members and 1 Guest are viewing this topic.
Mindbender
Member
Captain of the Guard
***
Offline Offline

Posts: 190

I don't mind, so what.


View Profile
« on: November 20, 2005, 04:08:21 PM »

Hi all,

in 0.9.7 it was pretty easy to let a midi file play whenever something happened or the player reached something.
If I remember right and copied it correct Wink
It was something like this here:

Code:
output("<embed src=\"media/win.mid\" width=10 height=10 autostart=true loop=false hidden=true volume=100>",true);

Is this actually possible that easy?
Can you please point me to how I would achieve something like that in 1.0.+ ?

Thank you and cheers

Mindbender
Logged
Sichae
iMod God
SVN Users
Mod God
*
Offline Offline

Posts: 3458


If ya didn't get it by now... you're hopeless...


View Profile WWW
« Reply #1 on: November 20, 2005, 04:09:31 PM »

I recently did this actually. Use a rawoutput (for translation purposes) and it should work just fine. Make sure you have the directory setup correctly.

Code:
rawoutput("<embed src='dir/file.format' autostart='true'>");
// Add whatever arguments you want to it.
« Last Edit: November 20, 2005, 04:10:32 PM by Sichae » Logged

If you didn't understand anything in the above post, don't try to attempt anything suggested.

Dannic
Guest
« Reply #2 on: November 20, 2005, 04:13:36 PM »

this might help.

Not sure why you would want to translate a midi file.

Code:
$midicode = "<embed src=\"media/win.mid\" width=10 height=10 autostart=true loop=false hidden=true volume=100>";

if (!isset($args['headerad'])) {
         
               $args['headerad'] = array();
            
            } elseif (!is_array($args['headerad'])) {
                  
               $args['headerad'] = array($args['headerad']);
            }
            array_push($args['headerad'], $midicode);

You could make this a module and pull from a list of midi files to play on seperate pages even.
Logged
Sichae
iMod God
SVN Users
Mod God
*
Offline Offline

Posts: 3458


If ya didn't get it by now... you're hopeless...


View Profile WWW
« Reply #3 on: November 20, 2005, 04:14:52 PM »

Dannic, using output("...",true); creates a translation space that can't be translated, as HTML doesn't really change amongst languages.

The problem with doing this, is that the song (or short .wav file) will start over everytime you leave a page and start a new one. Perhaps using the fabled "popup" is in order or making a person have some text to read while they listen. Wink
« Last Edit: November 20, 2005, 04:17:38 PM by Sichae » Logged

If you didn't understand anything in the above post, don't try to attempt anything suggested.

Dannic
Guest
« Reply #4 on: November 20, 2005, 04:17:35 PM »

depends on where it is placed.  sure. every-footer will cause it to be played on every single page.  even all of the combat ones.  There are ways to make it play on only certain pages.  I didn't bother posting that.  

I just posted the easiest way to do it imho. Smiley

I hate popups.
Logged
Talisman
Administrator
Mod God
*****
Offline Offline

Posts: 5479



View Profile WWW
« Reply #5 on: November 20, 2005, 05:14:02 PM »

Another way of finding out whether or not something like this would work is to actually try it, in a test module, on your test server...then any speculation will end!
Logged

Play the latest beta version here on DragonPrime
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Welcome to DragonPrime - The LoGD Resource Community!

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
47 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search