Issue playing MIDI files

This forum is meant for requesting technical support or reporting bugs.

Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support

Issue playing MIDI files

Postby JMC002 Neil » Mon May 12, 2008 7:00 pm

I'm still learning about Adventure Maker! As part of this, I created a simple plugin that is just a set of useful functions and procedures. Some of them deal with playing audio files using Media Player controls. My "test project" currently plays a mixture of .wav, .mp3 and .mid files. When it is ran from Adventure Maker, all of the audio files play correctly. However, when I create an executable and install from that then run it, I get errors. The WAV & MP3 files play OK but, whenever the application attempts to play a MIDI (.MID) file, I get an "automation error". Experimentation has shown that enabling the option "Do not encrypt the file extensions" before I create the .exe file, all sound files play OK, including the .mid files. I assume that something is going wrong preparing the encrypted files for Media Player, and that the "automation error" is because the Media Player control is unable to find (or load) the .mid files.
JMC002 Neil D.
Peace through Superior Firepower
Image
JMC002 Neil
Member
 
Posts: 22
Joined: Fri May 02, 2008 12:44 pm
Location: United Kingdom

Postby GM-Support » Mon May 12, 2008 8:06 pm

Thanks for the info.

I will look into it asap.
GM-Support
Forum Admin and Games Page admin
 
Posts: 2221
Joined: Thu Jun 05, 2003 7:52 pm

Postby Lyberodoggy » Tue May 13, 2008 7:50 am

The problem is probably based on this: wav, mp3s, oggs, rms etc are just sound codecs, which are automatically detected when a media player is trying to play the music, independently from the extention. Midi files yet are not encoded musci files, but commands to the midi mapper and synth of the pc (which are lockated on the sound card), therefore hardware handlers rather than software ones... So if somebody encrypts the extention, the files cannot auto detect the way the should be played.

That's my opinion. Could be wrong.
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby Chromegloss55 » Tue May 13, 2008 11:40 am

To avoid this download a MIDI-converter.

Google 'MIDI Converter Studio'...
_________________
Health forums
Last edited by Chromegloss55 on Tue Feb 24, 2009 3:14 pm, edited 1 time in total.
Chromegloss55
Forum Master
 
Posts: 630
Joined: Sat Nov 03, 2007 2:49 pm
Location: God Knows!

Postby JMC002 Neil » Tue May 13, 2008 2:35 pm

Lyberodoggy wrote:The problem is probably based on this: wav, mp3s, oggs, rms etc are just sound codecs, which are automatically detected when a media player is trying to play the music, independently from the extention. Midi files yet are not encoded musci files, but commands to the midi mapper and synth of the pc (which are lockated on the sound card), therefore hardware handlers rather than software ones... So if somebody encrypts the extention, the files cannot auto detect the way the should be played.

That's my opinion. Could be wrong.


Sounds reasonable. Indeed, when I tried renaming a .WAV file to .WAP - and edited my code accordingly - the sound still played when the frame was tested. However, when I subsequently tried renaming a .MID file to .MIN and changed the code to match, that played OK too. I tried creating an executable with the renamed MIDI file and it plays OK from the installed game! So a MIDI file with the correct extension doesn't work when the extension is encrypted but a MIDI file with the wrong extension plays correctly! :shock:
JMC002 Neil D.
Peace through Superior Firepower
Image
JMC002 Neil
Member
 
Posts: 22
Joined: Fri May 02, 2008 12:44 pm
Location: United Kingdom

Postby JMC002 Neil » Tue May 13, 2008 2:36 pm

Chromegloss55 wrote:To avoid this download a MIDI-converter.

Google 'MIDI Converter Studio'...


Interesting. I'll have to take a look at that. For now, I can simply give my MIDI files incorrect extensions. Then they play OK! :o
JMC002 Neil D.
Peace through Superior Firepower
Image
JMC002 Neil
Member
 
Posts: 22
Joined: Fri May 02, 2008 12:44 pm
Location: United Kingdom

Postby Mystery » Tue May 13, 2008 2:42 pm

JMC002 Neil wrote: Indeed, when I tried renaming a .WAV file to .WAP - and edited my code accordingly - the sound still played when the frame was tested. However, when I subsequently tried renaming a .MID file to .MIN and changed the code to match, that played OK too. I tried creating an executable with the renamed MIDI file and it plays OK from the installed game! So a MIDI file with the correct extension doesn't work when the extension is encrypted but a MIDI file with the wrong extension plays correctly! :shock:


Really?!? :shock: Lol, that sounds strange... :lol:
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby Lyberodoggy » Tue May 13, 2008 6:12 pm

Then, I can only blame encryption (since another algorythm should be used for encrypting midi files for the reasons described before). If your plugin ever comes out, I 'll check your code...
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby JMC002 Neil » Tue May 13, 2008 6:17 pm

Lyberodoggy wrote:Then, I can only blame encryption (since another algorythm should be used for encrypting midi files for the reasons described before). If your plugin ever comes out, I 'll check your code...


I am fairly confident that there isn't anything wrong with the code. After all, it works for other media files, and it isn't even complicated.
JMC002 Neil D.
Peace through Superior Firepower
Image
JMC002 Neil
Member
 
Posts: 22
Joined: Fri May 02, 2008 12:44 pm
Location: United Kingdom

Postby Lyberodoggy » Tue May 13, 2008 6:23 pm

Just curious... :P
User avatar
Lyberodoggy
Administrator
 
Posts: 2526
Joined: Sat Feb 17, 2007 3:31 pm
Location: Athens

Postby JMC002 Neil » Tue May 13, 2008 6:30 pm

Lyberodoggy wrote:Just curious... :P


That's OK! :) I do plan on "releasing" the plugin once there's enough in it to make it (hopefully) worth having. It's certainly making it easier for me to start new projects at the moment! :)
JMC002 Neil D.
Peace through Superior Firepower
Image
JMC002 Neil
Member
 
Posts: 22
Joined: Fri May 02, 2008 12:44 pm
Location: United Kingdom

Postby GM-Support » Tue May 13, 2008 9:55 pm

JMC002 Neil wrote:Indeed, when I tried renaming a .WAV file to .WAP - and edited my code accordingly - the sound still played when the frame was tested. However, when I subsequently tried renaming a .MID file to .MIN and changed the code to match, that played OK too. I tried creating an executable with the renamed MIDI file and it plays OK from the installed game! So a MIDI file with the correct extension doesn't work when the extension is encrypted but a MIDI file with the wrong extension plays correctly! :shock:



If is possible that it works when the extension contains only letters and it doesn't work when the extension is a 3-digit number?

That's the only difference I can see... :?
GM-Support
Forum Admin and Games Page admin
 
Posts: 2221
Joined: Thu Jun 05, 2003 7:52 pm

Postby JMC002 Neil » Tue May 13, 2008 10:04 pm

GM-Support wrote:If is possible that it works when the extension contains only letters and it doesn't work when the extension is a 3-digit number?

That's the only difference I can see... :?


It is certainly true that the "wrong" MIDI extension is not altered by the extension encryption, and stays ".MIN", so you could be right!
JMC002 Neil D.
Peace through Superior Firepower
Image
JMC002 Neil
Member
 
Posts: 22
Joined: Fri May 02, 2008 12:44 pm
Location: United Kingdom

Postby JMC002 Neil » Tue May 13, 2008 10:13 pm

Hmmm.... I tried actually changing the extension of a MIDI file from .MID to .123 (and edited the code accordingly), just to see what would happen. When I tested the frame, the MIDI file played OK!
JMC002 Neil D.
Peace through Superior Firepower
Image
JMC002 Neil
Member
 
Posts: 22
Joined: Fri May 02, 2008 12:44 pm
Location: United Kingdom

Postby GM-Support » Wed May 14, 2008 1:16 am

JMC002 Neil wrote:Hmmm.... I tried actually changing the extension of a MIDI file from .MID to .123 (and edited the code accordingly), just to see what would happen. When I tested the frame, the MIDI file played OK!



Surprising! :!: :shock:
GM-Support
Forum Admin and Games Page admin
 
Posts: 2221
Joined: Thu Jun 05, 2003 7:52 pm

Postby JMC002 Neil » Wed May 14, 2008 1:26 am

Sure is an interesting mystery!
JMC002 Neil D.
Peace through Superior Firepower
Image
JMC002 Neil
Member
 
Posts: 22
Joined: Fri May 02, 2008 12:44 pm
Location: United Kingdom

Postby Mystery » Wed May 14, 2008 5:14 pm

For a moment I thought you were talking to me :lol:

Yes, seems to be a strange "computer logic" :wink:
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby GM-Support » Wed May 14, 2008 9:31 pm

The default behaviour of the encryption changed in AM 4.5.2.
GM-Support
Forum Admin and Games Page admin
 
Posts: 2221
Joined: Thu Jun 05, 2003 7:52 pm

Postby JMC002 Neil » Wed May 14, 2008 9:38 pm

GM-Support wrote:The default behaviour of the encryption changed in AM 4.5.2.


Cool! 8)
JMC002 Neil D.
Peace through Superior Firepower
Image
JMC002 Neil
Member
 
Posts: 22
Joined: Fri May 02, 2008 12:44 pm
Location: United Kingdom


Return to Adventure Maker Technical Support and Bug Reports

Who is online

Users browsing this forum: No registered users and 0 guests