Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,382 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
playing a midi file media play question #233787
10/30/08 17:27
10/30/08 17:27
Joined: Feb 2006
Posts: 124
Dallas,TX
Delirium Offline OP
Member
Delirium  Offline OP
Member

Joined: Feb 2006
Posts: 124
Dallas,TX
Please...why doesn't this play the file? It's in the games directory with the prites sounds and models...

media_play("moonlight.mid",null,100);

writing wdl for a game in a6.



Learning to write lite-C -- A8 commercial
Re: playing a midi file media play question [Re: Delirium] #233819
10/30/08 20:15
10/30/08 20:15
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Does the midi sound play when you open it with windows media player? Have you accidentally set midi_vol to 0?


Always learn from history, to be sure you make the same mistakes again...
good file [Re: Delirium] #233823
10/30/08 20:20
10/30/08 20:20
Joined: Feb 2006
Posts: 124
Dallas,TX
Delirium Offline OP
Member
Delirium  Offline OP
Member

Joined: Feb 2006
Posts: 124
Dallas,TX
Yep. Tje mkidi file is good. I always listen to them before using them. I thought the volume is a parameter in media_play. What do you mean? I set it to 100, and the speaker is on and other sounds work. Gee, I've done it before but I don't remember how I did it.


Learning to write lite-C -- A8 commercial
Re: good file [Re: Delirium] #233824
10/30/08 20:22
10/30/08 20:22
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
There is a predefined variable "midi_vol" which gives the overall volume of all midi files played. Just give it a try and place a "midi_vol = 100;" right before the media_play instruction.


Always learn from history, to be sure you make the same mistakes again...
Re: vol [Re: Delirium] #233829
10/30/08 20:37
10/30/08 20:37
Joined: Feb 2006
Posts: 124
Dallas,TX
Delirium Offline OP
Member
Delirium  Offline OP
Member

Joined: Feb 2006
Posts: 124
Dallas,TX
Thanks, I thought maybe I had to define sound = <moonlight.mid>;
before or something.


Learning to write lite-C -- A8 commercial
Re: vol [Re: Delirium] #233831
10/30/08 20:47
10/30/08 20:47
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
No, you don't need to. Please try the following:

Code:
var handle;
handle = media_play("moonlight.mid",null,100);
if (media_playing(handle) != 0)
{
   error("The file is playing but cant be heard.");
}


If that doesn't work check your direct sound capabilities with dxdiag.exe.


Always learn from history, to be sure you make the same mistakes again...
Re: errors [Re: Uhrwerk] #233834
10/30/08 21:14
10/30/08 21:14
Joined: Feb 2006
Posts: 124
Dallas,TX
Delirium Offline OP
Member
Delirium  Offline OP
Member

Joined: Feb 2006
Posts: 124
Dallas,TX
I had to make it a function because it was in main (where I played a wave before and that was okay, it came on with the title screens) but now it gives an error


handle = media_play("moonlight.mid",null,100);

function intro()
{ if (media_playing(handle) != 0) // this is line 54
{
error("The file is playing but cant be heard.");
}
wait(1);
}

function main()
{

intro(); // I used snd_play to plat a wav before)

// the error says "Error 63 parameter unknown handle"


Learning to write lite-C -- A8 commercial
Re: errors [Re: Delirium] #233837
10/30/08 21:18
10/30/08 21:18
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Code:
function intro()
{
  var handle;
  handle = media_play("moonlight.mid",null,100);
  if (media_playing(handle) != 0)
  {
    error("The file is playing but cant be heard.");
  }
}

function main()
{
intro(); // I used snd_play to plat a wav before)
}

you forgot to define the variable.


Always learn from history, to be sure you make the same mistakes again...
Re: errors variable [Re: Uhrwerk] #233858
10/30/08 22:52
10/30/08 22:52
Joined: Feb 2006
Posts: 124
Dallas,TX
Delirium Offline OP
Member
Delirium  Offline OP
Member

Joined: Feb 2006
Posts: 124
Dallas,TX
Ok, thanks. I'll be off line for a while.
Dinner calls (Am in Virginia)

merci Beacoup


Learning to write lite-C -- A8 commercial
Re: All okay [Re: Uhrwerk] #233869
10/30/08 23:32
10/30/08 23:32
Joined: Feb 2006
Posts: 124
Dallas,TX
Delirium Offline OP
Member
Delirium  Offline OP
Member

Joined: Feb 2006
Posts: 124
Dallas,TX

It's running like a Rolls ROyce now, sounds great. Omly problem is while i head the music, it prints an error report that I can't hear it. So I'll take that report out.

Thank you for all your help. I'm doing a demo to advertise a paperback I've written which will be on Amazon.com around Thanksgiving, called "Virtual Pleasures". After the publication I'm going to hold an author event in 2nd life. (The Game Studio graphics look a lot better than 3nd life usually does!)


Learning to write lite-C -- A8 commercial
Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1