.decls for saudio.dll (sound play dll)

Blitz3D Forums/Blitz3D Programming/.decls for saudio.dll (sound play dll)

Mahan(Posted 2009) [#1]
Hi there all,

I found a .dll written by a guy in the GameMaker community (andrewmc) that he wrote to enable playback of various sound formats:

.aif, .aifc, .aiff, .asf, .asx, .au, .avi, .cda, .m1v, .m3u, .mid, .mp2, .mp2v, .mp3, .mpa, .mpe, .mpeg, .mpg, .mpv2, .rmi, .snd, .wav, .wax, .wm, .wma, .wmv, .wmx, .wpl, .wvx

The url to his zip (you need to press the download button on the top left):
http://host-a.net/andrewmc/saudio.zip

andrewmc release post:
http://gmc.yoyogames.com/index.php?showtopic=153450

So i wrote a .decls file to use his .dll from within Blitz3D. It might also work in Blitz+ but I haven't tested yet.

my saudio.decls file:


So far I have tested to playback mp3 and midi files. It supports playing a midi and mp3 simultaneously. Also afaiks the MP3 was not unpacked into memory as seems to be the case in Blitz3D, but the file was played from the disk.

Feel free to try and improve on the .decls file. (I haven't figured out how to get the status, position etc functions to work yet)

Installation:

copy saudio.decls to you userlibs folder under your Blitz3D installation.

copy andrewbc's saudio.dll to a folder that is in you system path. (or keep it in the same folder where your Blitz3D project is)

EDIT: There are some functions to record audio to, but i haven't mapped them, as I didn't have any need for them. Check out andrews .zip-file with the GameMaker code and I'm sure you'll see how to do it, if you need that.

EDIT: Fixed some status functions. Turns out they where string-pointers.


jfk EO-11110(Posted 2009) [#2]
ASF, WMV, MPEG etc. are video formats. Does it support videos? Or only the sound of it?

Anyway, looks very nice. Also nice to see is it's streaming the MP3 from disk. I wonder if you can use a HTTP address as the source.

Thanks for sharing. Don't forget to add it to the code archives.


Mahan(Posted 2009) [#3]

ASF, WMV, MPEG etc. are video formats. Does it support videos? Or only the sound of it?



I just copied the list from andrewmc:s release post. Maybe he meant that the DLL can be fed file-names of video-files and it will play the audio-track of them? I.e. If you give it a mpeg2-file it will play the internal mp3-track(s)?

That's what I guess but I have no idea. I just use this DLL to play some background tunes in my current project. (.midi and .mp3)


I wonder if you can use a HTTP address as the source.



Just test it, I got no clue :-)