Jump to content


Photo

Saudio Dll V1.0 Updated 9/10


  • Please log in to reply
272 replies to this topic

#261 SPLN

SPLN

    GMC Member

  • GMC Member
  • 14 posts

Posted 26 September 2012 - 12:16 PM

You can try it. I made it because I always got the "error define an external function" error randomly. So I made this .gex/.gml (1st post of this page) with the GM internal MCI function instead of using the DLL to call MCI function. But if it broke with Saudio I don't think it would work with SaudioPlus. Perhaps it will work who know? If it doesn't work with SaudioPlus replace the original code saud_load() with :
#define saud_load
//saud_load(file,id)
var dev, dev2, file, check, buffer, c, get_dev;
//Device
//--- TEST to solve 600 wav problem
//dev[1] = "MPEGVideo";//*(vista/seven)codec
//dev[2] = "WaveAudio";//*.wav
//--- TEST to solve 600 wav problem

dev[1] = "WaveAudio";//*.wav
dev[2] = "MPEGVideo";//*(vista/seven)codec
dev[3] = "Sequencer";//*.mid
dev[4] = "AVIVideo";//*.avi
dev[5] = "DigitalVideo";//*video?
dev[6] = "Overlay";//*video?
dev[7] = "MMMovie";//*video?
dev[8] = "DAT";//*audio?
dev[9] = "Other";//*???

//file
file = argument0;

//c (counter)
c = 1;
get_dev = "ERROR";
check = 0;

do
{
buffer = MCI_command('open "'+file+'" type '+dev[c]+" alias SPLN");
MCI_command("close SPLN");
if real(buffer) >= 1
{
get_dev = dev[c];
check = 1;
}
c+=1;
}until (check = 1) or (c > 9)

//RETURN
dev2 = get_dev;
/*****/
if dev2!= "ERROR"
{return MCI_command('open "'+argument0+'" type '+dev2+" style overlapped alias "+string(argument1))}
else {return -1;}
You can get SaudioPlus here. I know it's in French, my native language :vP
Don't copy-paste the Saudio Plus GML Code from my posts above because it's not the most recent version. There are a GML script version and a GEX version with example :vP.

Edited by SPLN, 26 September 2012 - 12:18 PM.

  • 0

#262 killerheath

killerheath

    GMC Member

  • GMC Member
  • 209 posts
  • Version:GM8

Posted 26 September 2012 - 01:21 PM

With the GEX version, it breaks at 600 still, i don't know what immeant to dop with the script you gave me, i tried it, and it returned blank every time.
  • 0

#263 SPLN

SPLN

    GMC Member

  • GMC Member
  • 14 posts

Posted 26 September 2012 - 01:24 PM

Replace the GEX version by the GML one. Then import GML scripts and replace the saud_load code with the one I made above. Does it break after that?
  • 0

#264 killerheath

killerheath

    GMC Member

  • GMC Member
  • 209 posts
  • Version:GM8

Posted 26 September 2012 - 01:38 PM

Ok, i used the gml scripts and replaced saud_load.

Every single file gets 0

None of the sounds seem to play with saud_play.

Edited by killerheath, 26 September 2012 - 01:40 PM.

  • 0

#265 SPLN

SPLN

    GMC Member

  • GMC Member
  • 14 posts

Posted 26 September 2012 - 01:43 PM

Does the GEX is removed? Because I've checked this code and it return the same result as saud_load() original script...
  • 0

#266 killerheath

killerheath

    GMC Member

  • GMC Member
  • 209 posts
  • Version:GM8

Posted 26 September 2012 - 01:45 PM

Does the GEX is removed? Because I've checked this code and it return the same result as saud_load() original script...


That made no sense, ill try to answer it anyways.

I am not using the gex, it is removed.

You know what, nevermind this, ill keep using mp3s :P

Edited by killerheath, 26 September 2012 - 01:46 PM.

  • 0

#267 SPLN

SPLN

    GMC Member

  • GMC Member
  • 14 posts

Posted 26 September 2012 - 02:03 PM

When i made the GEX Version I forgot to remove GML scripts and all my functions return 0 that's why I asked it ^^'. So if it's not the case, that's fine.
So let's retry from the begin.
- Does the GML SaudioPlus example work and load a sound properly?
- If you replace the saud_load() function with the new one, is still working?
- Do you import the new script with a text file or a paste in the script editor?
If you pasted it remove the first line "#define blabla..."

On my side I'll try to see if I did something wrong with the code. I'll probably read some MCI stuff too.
  • 0

#268 killerheath

killerheath

    GMC Member

  • GMC Member
  • 209 posts
  • Version:GM8

Posted 26 September 2012 - 02:30 PM

I exported the scripts from the example gmk in the saudioplus GMK.

It may work if i use 599- files, but i didn't try.

No, if i replace saud_load it returns 0 and no sound plays when i use saud_play.


Look im ditching this problem, im just going to stick with mp3.
  • 0

#269 SPLN

SPLN

    GMC Member

  • GMC Member
  • 14 posts

Posted 26 September 2012 - 02:46 PM

I found it ! ><' This bug happen when an extra parameter is added to the MCI function and it's not fully compatible.

Try this code, I think I fixed it correctly this time :vP
// saud_load(path,id)
// Load a file from path and assign it an id
var dev, dev2, file, check, buffer, c, get_dev;
//Device
dev[1] = "WaveAudio";//*.wav
dev[2] = "MPEGVideo";//*(vista/seven)codec
dev[3] = "Sequencer";//*.mid
dev[4] = "AVIVideo";//*.avi
dev[5] = "DigitalVideo";//*video?
dev[6] = "Overlay";//*video?
dev[7] = "MMMovie";//*video?
dev[8] = "DAT";//*audio?
dev[9] = "Other";//*???

//file
file = argument0;

//c (counter)
c = 1;
get_dev = "ERROR";
check = 0;

do
{
buffer = MCI_command('open "'+file+'" type '+dev[c]+" alias SPLN");
MCI_command("close SPLN");
if real(buffer) >= 1
{
show_debug_message(dev[c])
get_dev = dev[c];
check = 1;
}
c+=1;
}until (check = 1) or (c > 9)

//RETURN
dev2 = get_dev;
/*****/
if ( dev2 == "WaveAudio" ) { return MCI_command('open "'+file+'" type '+dev2+" alias "+string(argument1)); }
if dev2!= "ERROR"
{return MCI_command('open "'+argument0+'" type '+dev2+" style overlapped alias "+string(argument1))}
else {return -1;}

EDIT: Erf... I figured out when you load a sound with the "WaveAudio" device type instead of "MPEGVideo" you loose the ability to adjust the sound volume.

Edited by SPLN, 26 September 2012 - 02:50 PM.

  • 0

#270 killerheath

killerheath

    GMC Member

  • GMC Member
  • 209 posts
  • Version:GM8

Posted 28 September 2012 - 03:50 AM

Already finished the program, i just kept the mp3s :P
  • 0

#271 DuTchEr95

DuTchEr95

    GMC Member

  • GMC Member
  • 54 posts
  • Version:GM8

Posted 02 November 2012 - 07:48 PM

Link is down? it says file not found.
  • 0

#272 SPLN

SPLN

    GMC Member

  • GMC Member
  • 14 posts

Posted 04 November 2012 - 12:32 PM

Strange... The link is broken but the file is still there :
- Host-a (andrewmc)
- Saudio.zip

You can also try my extension based on Game Maker's MCI functions : SaudioPlus
( Example (gex) ; Example (gml) ; GEX )
It does the same as Saudio but with speed and volume support. And you can choose where the video is played : in-game window or not. Perhaps there are some bugs left.

There is an alternative way to add these features with the original Saudio.dll without my extension. Look into the SaudioPlus gmk and pick up the functions you'll use. The saudio.dll works with MCI functions and Game Maker can use them with the "MCI_command" GML function. So you can use DLL and Game Maker functions on the same media loaded. Ex:
saud_load("my_snd.wav","My_ID") ; MCI_command("play My_ID") // does the same thing as 
saud_load("my_snd.wav","My_ID") ; saud_play("My_ID")

  • 0

#273 BetaProductions

BetaProductions

    GMC Member

  • New Member
  • 3 posts
  • Version:GM8.1

Posted 03 March 2013 - 09:36 PM

I'm having difficulty loading a file using working_directory. Nothing I put in the load function will work unless I put in the exact location of the file. I've tried everything:

working_directory+"\music\w1.mp3"
working_directory&"\music\w1.mp3"
working_directory&&"\music\w1.mp3"
working_directory and "\music\w1.mp3"
working_directory"\music\w1.mp3"
and all the above without quotes

I can draw the file's location by using draw variable to draw working_directory+"\music\w1.mp3", but the load function won't load this. Does anyone have any advice?
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users