0 registered members (),
1,382
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
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
OP
Member
|
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
Expert
|
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
OP
Member
|
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
Expert
|
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
OP
Member
|
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
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
No, you don't need to. Please try the following: 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
OP
Member
|
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
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
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
OP
Member
|
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
OP
Member
|
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
|
|
|
|