Jump to content


Photo

Sxms V3.0.6.1 (beta) - Audio Dll


  • Please log in to reply
399 replies to this topic

#271 Shaltif

Shaltif

    The Audio Master

  • Retired Staff
  • 1185 posts

Posted 22 October 2006 - 06:28 PM

Why don't you create that dummy object in the script sxms_create() and store its id?
Does it have to manually be created?

<{POST_SNAPBACK}>

It has to be manually created mainly because I need the object name to referrence to. For instance, if I did object_add(), it would return the object's id. I would then have to store this somewhere, like a global variable, which everything references to. However, if this global variable is somehow overwritten, then we run into problems.

Another reason I perfer the dummy object method is that it gives a user a clear and clean way to reference constants/variables stored inside this object. So instead of doing:

global.sxmsObjectID.FMOD_LOOP_OFF

you can just do

sxms.FMOD_LOOP_OFF

This also allows for fully cleaning up after itself without global variables just sitting in memory (Once mark comes up with some way to delete variables on command, I may change back, but until then, making an instance which holds everything is the best idea).

Currently, I do this with all my extentions (SXMS, SIRC, SVC, etc) and have even updated other extentions I use to follow this route (GMsock Threaded, N_Menu, etc).

Maybe when Game Maker 7.0 comes along, this won't be needed anymore or maybe some other method will present itself. But until then, this appears to be the best way to contain everything releated to an extention in a single area. It allows for easy custom constants without having to worry about resource name overlapping and also allows for me to make custom sub systems that automatically run without the user needing to make them. (For example, SIRC (which is an API I made to allow Game Maker to interface with the IRC protocol) has a sub system which automatically keeps track of ping for the user, and seperates/build received and sent messages accordingly without the user needing to understand the raw IRC protocol).

~Brandon
  • 0

#272 Shaltif

Shaltif

    The Audio Master

  • Retired Staff
  • 1185 posts

Posted 19 November 2006 - 05:55 PM

Update: SXMS - 3.0.6.0 Beta which wrapps Fmod Ex 4.04.47

It sure has been awhile, hasn't it. Today I decided to update and release another build of SXMS. Nothing huge, mainly just updating to latest version of Fmod Ex (this includes many bugs fixes and a few minor changes).

You can view the change log at the following location: Change Log

I recommend looking over the revisions.txt file (included) to see all the changes Fmod Ex has undergone since version 4.04.14. But here is a highlight of the major changes:

- Fix FSBank and FMOD Designer encoding bad ADPCM files making ADPCM based
  banks fail to load.
- Divide by zero fix in FMOD_DSP_PITCHSHIFT filter.
- Fixed memory leak when using a lot of dsp connections.
* Sound::release now blocks if it is non blocking and hasn't finished opening
  yet.
- Removed blocking critical section call in DSP::setParameter for most filters,
  which means performance increase.
- Fixed crash if running out of memory with FSB.
- Fix crash in mod/s3m/xm/it/midi Sound::release.
- Fixed Sound::getSubSound causing 'seeking forever' bug if the function was
  called again while previous non blocking getSubSound was still happening.
+ Optimizations for FMOD_DSP_ITLOWPASS, FMOD_DSP_PARAMEQ.
- Fix crash if out of memory when using FMOD_NONBLOCKING.
- Fix possible stutter when starting FSB streams.
- Fix possible glitch on first time playing FSB streams.
- Fix reverb not being active the first time a channel is played.
- Fix crash in ogg codec if running out of memory.
- Fix memory leak with FMOD_ACCURATETIME, mp3 and FMOD_CREATECOMPRESSEDSAMPLE.
- Fixed virtual voices swapping back to real and looping when they were
  supposed to be one shot.
- Fixed noise in FSB bank compilation for 8bit wav files compressed
  with ADPCM as target format.
- Fixed support for Channel::addDSP with virtual voices.  Sounds that go virtual
  and come back as real will resume their previously added DSP effects as well
  now.

* FMOD_CREATECOMPRESSEDMEMSAMPLE flag changed to a more generic
  FMOD_OPENMEMORY_POINT, which supports .WAV and .FSB based PCM data now as well. 
  To get the same behaviour as FMOD_CREATECOMPRESSEDMEMSAMPLE,
  (FMOD_CREATECOMPRESSEDSAMPLE | FMOD_OPENMEMORY_POINT) must be used.


As a final note, this will probably be the last release before Game Maker 7.0. After that, I plan to update SXMS-3 to use the new Extension system. So those sticking with GM 5.x - 6.x in the future, this may be your last compatible build. The reason for this decision is mainly due to the sheer scale of this creation, which has starting to outgrow the old DLL configuration. (I mean, just looking at the amount of scripts this thing takes up alone shows me that this would be better maintained and understood by users using GM's extension system.)

Whether I will maintain the traditional style extension, I don't know yet. But at this current time, there are no plans to do so. However, I will leave this build available for download so those who plan to use older versions of Game Maker have at least something to work with.

The download is available both here: SXMSv3.0.6.0b

And in my signature when updated. Make sure the version number says 3.0.6.0 to get the correct version for this release.

~Brandon
  • 0

#273 Shaltif

Shaltif

    The Audio Master

  • Retired Staff
  • 1185 posts

Posted 24 November 2006 - 05:24 PM

Updated: SXMS - 3.0.6.1 Beta - Fmod 4.04.51

This is a minor update which includes two previously missed functions and some bug fixes on Fmod's part. The download is available via my signature and the changes.txt can be found here: Change Log

~Brandon
  • 0

#274 ¿°¿

¿°¿

    GMC Member

  • New Member
  • 25 posts

Posted 20 December 2006 - 05:25 AM

I know this isn't related to 'extending game maker', but it is related to the dll. I am working on a VB version of my media player. I can't get the dll to work at all in VB6, but in VB2005, it works (if I use out_wave.dll)! The problem is that I can't use the directsound plugin, because it says: "Error setting DirectSound cooperative level; please shutdown other programs using your soundcard. Error code: 80070057"
Isn't that the same problem as in GM6? Maybe it will provide a little insight to what's causing the problem. It's gotta be something that GM6 and VB2005 have in common...

Edit: version 3.0.0.3 of SXMS dll, and 3.0.6.1, out_ds.dll version 2.46

Edited by ¿°¿, 20 December 2006 - 05:38 AM.

  • 0

#275 gmjab

gmjab

    GMC Member

  • New Member
  • 784 posts

Posted 20 December 2006 - 05:33 AM

Just a little advise, GM dll's aren't the same as a normal dll. Dll's for GM have been configured to work with GM. So you cannot use this for Visual Basic.

- Jarred

Edited by gmjab, 20 December 2006 - 05:33 AM.

  • 0

#276 ¿°¿

¿°¿

    GMC Member

  • New Member
  • 25 posts

Posted 20 December 2006 - 05:41 AM

So you cannot use this for Visual Basic.


Au contraire! But it DOES work, just not with the out_ds plugin.

Edit: it also has some problems with access violations if you call functions of the dll too fast. I had to put a dummy function in just to delay it a few microseconds...

Edited by ¿°¿, 21 December 2006 - 10:18 PM.

  • 0

#277 G.L.

G.L.

    GMC Member

  • New Member
  • 306 posts

Posted 23 December 2006 - 07:50 PM

How do you use 'sxfmod_sound_getTag"?
i'm not quite sure about how to run this script...
  • 0

#278 Sharkiedude

Sharkiedude

    GMC Member

  • New Member
  • 813 posts

Posted 02 January 2007 - 11:37 PM

The scripts look great, but your example refuses to work properly. o.o
I placed the dll files in the same file as the example.
The errors contain something like this:
Unknown variable dll_*whatever*_init
There's also a font error for some reason in example 1.
  • 0

#279 AeroGP

AeroGP

    GMC Member

  • GMC Member
  • 38 posts

Posted 03 January 2007 - 12:50 AM

Is there a way you can initialize FMOD channels before use? I want to be able to monitor channel usage without having to play sounds first. Furthermore, I don't know for sure, but when you let FMOD handle channels, it goes over the channel limit set. Either that, or the channel handle keeps changing for no reason...

Edited by AeroGP, 03 January 2007 - 12:54 AM.

  • 0

#280 Dregnought

Dregnought

    Games Squad Admin

  • New Member
  • 740 posts

Posted 03 January 2007 - 04:29 AM

I havent used this in a while, but couldnt you just play like a half a second wave file that has no audio to create the channel?
  • 0

#281 Alex

Alex

    3lite Member

  • New Member
  • 3098 posts

Posted 03 January 2007 - 05:45 AM

Shaltif, how do I play more than one sound with sxeasy?

Here's my code:

sxms_create(working_directory+"\SXMS-3.dll",1);

sxeasy_init(2);

sound1=sxeasy_play("sound1.mp3",sxms.FMOD_ACCURATETIME,0);
sound2=sxeasy_play("sound2.mp3",sxms.FMOD_ACCURATETIME,0);

It only plays the second sound though. I thought the argument in the sxeasy_init was the max number of channels?

Edited by /\lex, 03 January 2007 - 10:13 AM.

  • 0

#282 jass interactive

jass interactive

    http://www.jassinc.com

  • New Member
  • 126 posts

Posted 06 January 2007 - 02:53 AM

This is great as always shaltif- it's working a dream for me at the moment, I'm going to try and tackle making my own visulizations for it shortly but I have a few questions...

I would also like to know what /\lex asked. I tried playing multiple tracks with this and it only played the one.

Also I am unsure with this function sxfmod_sound_getTag(soundIndex,tag,returnType); on what to put in the 'tag' as in I don't know what tags are stored in the files. I will look this up anyway. But it would be handy to have in the dlls help file - which doesn't exist in the version I downloaded. I'd love to have a manual similar to the gamemaker manual with all the functions for the dll and a breif bit of infor about what the function does and how to use it. but looking at all the scripts that could take some time...

Lastly, would it be possible to import files from cd to mp3 or any other format with this?

Cheers
Jason S
  • 0

#283 Dregnought

Dregnought

    Games Squad Admin

  • New Member
  • 740 posts

Posted 06 January 2007 - 06:22 AM

sxms_create(working_directory+"\SXMS-3.dll",1);

sxeasy_init(2);

sound1=sxeasy_play("sound1.mp3",sxms.FMOD_ACCURATETIME,0);
sound2=sxeasy_play("sound2.mp3",sxms.FMOD_ACCURATETIME,0);
That's because you are using the same channel to play the sounds. If there is a sound playing in one channel, and another sound plays on the same channel, the new sound will play.

Straight from the code in sxeasy_play (more so the comment).

sxeasy_play(filename,sxms.FMOD_,channel);
===
argument0 = STRING - Filename of file to play
argument1 = REAL - additional flags: sxms.FMOD_
argument2 = REAL - Channel to play on (or sxms.FMOD_CHANNEL_FREE for any)
===

So change the 0 to
sxms.FMOD_CHANNEL_FREE to fix it. Or, you could use a channel number for more advanced control.

About the help file, as handy as it could be, this is still a work in progress, and as far as I know, Shaltif has no plans to make a manual, atleast until it is complete. The comments in the scripts are good enough for now anyway.

Edited by Dregnought, 06 January 2007 - 06:24 AM.

  • 0

#284 jass interactive

jass interactive

    http://www.jassinc.com

  • New Member
  • 126 posts

Posted 07 January 2007 - 07:32 AM

I tried changing it, I even tried changing 1 to one and the other to 0 but the second one would load but not play and it would stop the first one...

I tried doing the channel codes but they didn't work properly either.
  • 0

#285 Dregnought

Dregnought

    Games Squad Admin

  • New Member
  • 740 posts

Posted 07 January 2007 - 09:00 AM

After trying this myself and finding it does not work, and reading the scripts, I conclude that the sxeasy scripts only seem to support playing one file at a time. This is mainly to do with (I assume) how hard it would become to program if there was multiple sounds. As it is, once the current sound has finished playing, it has to be released.

Of course, from the looks of the coding, implementing arrays wouldn't be too hard and would let you play up to 255 files at once (Reading it, I believe there is a maximum channel number of 255. You shouldn't need so many anyway.)

In other worse, if/until Shaltif implements this feature, the sxeasy scripts will only support one audio file at a time.
  • 0

#286 Shaltif

Shaltif

    The Audio Master

  • Retired Staff
  • 1185 posts

Posted 09 January 2007 - 06:31 PM

Sorry for not keeping up with the topic, as I haven't had much time lately.

Shaltif, how do I play more than one sound with sxeasy?

The sxeasy functions were designed to only play a single file for ease of use. I got a lot of people who just wanted to use SXMS for playing a single background song, so this seemed like the best option for simplicity over power/control.

Saying that, you still have the full sxfmod library to work from if you need that support.

jass interactive, you would use the get total number of tags function first, then the tag number is the tag you want to pull. So example, if your song says it has 14 tags, then you know you can pull information from tag 0 to tag 13.

As for lack of documentation, this will be fixed in the next release which is going the Extension route. For the time being, you'll have to use the comments placed in all the scripts and/or look at the Fmod Ex documentation supplied for advanced features.

-----
Something to note here, the example doesn't do this as I only recently understood what is going on, but make sure to use sxfmod_system_update() once a step if using the sxfmod or sxeasy api. This is because this function handles the internal channel system to correctly release a channel when playback has finished along with other channel/3d management (this used to be something done automatically in previous versions of Fmod that I overlooked).

~Brandon
  • 0

#287 BlaXun

BlaXun

    Slime Online Creator

  • GMC Member
  • 2715 posts
  • Version:GM:Studio

Posted 10 January 2007 - 06:38 AM

Hey there, I just tried the latest version of SXMS on my PC with GM 7 beta 2 installed.
When it asked me what tutorial I'd like to see I selected "1".
Now, whenever I tried to load a file it tells me UNSUPPORTED FORMAT...any ideas?

mp3's run fine, but *.mod *.it *.xm *.s3m all give me that error!

Edited by BlaXun, 10 January 2007 - 06:44 AM.

  • 0

#288 hotshotscott

hotshotscott

    GMC Member

  • New Member
  • 3483 posts

Posted 10 January 2007 - 10:51 AM

Would it be possible if this thing could tell the pitch from a sound directly through a microphone? I have the pitch which my sound is meant to be, and then when i make the sound through the microphone i need it to show the sound (coming through the microphone) pitch! Any ideas how to do this?
Scotty
  • 0

#289 Shaltif

Shaltif

    The Audio Master

  • Retired Staff
  • 1185 posts

Posted 10 January 2007 - 03:42 PM

Hey there, I just tried the latest version of SXMS on my PC with GM 7 beta 2 installed.
When it asked me what tutorial I'd like to see I selected "1".
Now, whenever I tried to load a file it tells me UNSUPPORTED FORMAT...any ideas?

mp3's run fine, but *.mod *.it *.xm *.s3m all give me that error!

<{POST_SNAPBACK}>


Can you link me to the files in question? You would get this error in only 3 cases: 1) The files are some unknown format (even if the filename does end in .mod, it could be something else) or 2) They are corrupt or badly encoded versions of these formats or 3) A protection algorithm (such as DRM on wma) is used.

Since it plays mp3's fine, and seeing how Fmod Ex treats all files the same way, something leads me to believe that there is an issue with the files themselves.

For a final check, I just used the example on the following formats (using multiple files for each extension):

WAV, MP3, WMA, OGG, FLAC, S3M, MOD, IT, XM, MIDI, CDA, and all played fine on my end. (I even loaded up some shoutcast and icecast net streams just to be sure everything was working).


Would it be possible if this thing could tell the pitch from a sound directly through a microphone? I have the pitch which my sound is meant to be, and then when i make the sound through the microphone i need it to show the sound (coming through the microphone) pitch! Any ideas how to do this?
Scotty


I read this question a lot on the Fmod Ex forum, and to my understanding, it is possible. However, I am not exactly sure of the setup used. The only experience I have is using a line-in/mic/stereo mix source, recording it and playing it while it was recording (playback had a 100ms delay so as to not get ahead of the record 'pointer') and then used visualization on the playback. So I would assume a slightly modified version of this setup would accomplish the task you are asking.

~Brandon
  • 0

#290 BlaXun

BlaXun

    Slime Online Creator

  • GMC Member
  • 2715 posts
  • Version:GM:Studio

Posted 10 January 2007 - 05:12 PM

and r u sure u used GM7 for testing? Me, and some other people, tried it in GM7 and it didnt work. If you test ed in GM7 and pm me ya mail I'll send u the files Im tryin to run.
  • 0

#291 Shaltif

Shaltif

    The Audio Master

  • Retired Staff
  • 1185 posts

Posted 11 January 2007 - 02:07 AM

and r u sure u used GM7 for testing? Me, and some other people, tried it in GM7 and it didnt work. If you test ed in GM7 and pm me ya mail I'll send u the files Im tryin to run.

<{POST_SNAPBACK}>

I am quite positive, as the example boots up with the annoying 'you are using a beta version' message box every time it's run.

Check your PM for further information.

EDIT: To give a follow up to others reading this topic. The error ended up being oddly encoded module files. After re-saving them in Modplug tracker, I was able to get the music to load and play fine. Before my next SXMS update, I will contact Fmod Ex's creators to see if there is a more technical reason as to why these files won't load (since Modplug tracker seems to have no issue loading them in their current state).

~Brandon
  • 0

#292 Topaze22

Topaze22

    GMC Member

  • GMC Member
  • 58 posts

Posted 21 January 2007 - 01:16 PM

Hi! Very good job :D
What "plug in" and "plug out" must we load to play SPC file (with SXMS2) in "winamp suport" in the exemple?
I'm french so forgive me for my langages's mistake <_<
  • 0

#293 Copy X

Copy X

    GMC Member

  • GMC Member
  • 55 posts

Posted 21 January 2007 - 08:06 PM

How can I get the winamp player to continuously play a file, as if it was on repeat? There doesn't seem to be a function for it. Maybe I could get it to see what position the song is in the reset it to the beginning?

This is a great application by the way. One of (if not the only) best audio dlls out there. 10/10

Edited by Copy X, 21 January 2007 - 08:08 PM.

  • 0

#294 Ghostkeeper

Ghostkeeper

    That's Logic

  • New Member
  • 189 posts

Posted 21 January 2007 - 10:03 PM

Copy X, you just found yourself the answer to your question. Make a seperate variable that contains whether the sound is playing or not. Then in a step event:
if(sound_playing and !sxwamp_isPlaying()){sxwamp_play(filename)};
Fairly simple, if your variable says the sound is playing but actually it's not, that means it must have stopped playing, so it's done. Then just play again.
  • 0

#295 Topaze22

Topaze22

    GMC Member

  • GMC Member
  • 58 posts

Posted 21 January 2007 - 11:00 PM

I manage to read spc file!
I just didn't read that we must load plug out first and then plug in...
Plug out: out_ds.ddl
Plug in : in_spc.dll
Real thank you Brandon for your Email!
Now, the biggest French community will use your system for MP3 , SPC and oser.
Traduction : you win 5 french users <_<
One day , when I finish my project, I will send you an Email, I guess you will be really surprise :D
  • 0

#296 Copy X

Copy X

    GMC Member

  • GMC Member
  • 55 posts

Posted 22 January 2007 - 06:10 AM

Copy X, you just found yourself the answer to your question. Make a seperate variable that contains whether the sound is playing or not. Then in a step event:

if(sound_playing and !sxwamp_isPlaying()){sxwamp_play(filename)};
Fairly simple, if your variable says the sound is playing but actually it's not, that means it must have stopped playing, so it's done. Then just play again.

<{POST_SNAPBACK}>


Yes, I just tried it out right when I posted it and it worked. Thanks though! :)
  • 0

#297 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Retired Staff
  • 15729 posts
  • Version:GM:Studio

Posted 16 March 2007 - 03:43 AM

Can I play multiple instances of the same sound at different volumes? So I can hear distance gun shots and close gun shots and the same time but at different levels or even settings like phaze shifted.
  • 0

#298 Shaltif

Shaltif

    The Audio Master

  • Retired Staff
  • 1185 posts

Posted 16 March 2007 - 03:15 PM

Can I play multiple instances of the same sound at different volumes? So I can hear distance gun shots and close gun shots and the same time but at different levels or even settings like phaze shifted.

<{POST_SNAPBACK}>

Yes

~Brandon
  • 0

#299 digitalwar

digitalwar

    GMC Member

  • New Member
  • 321 posts

Posted 31 March 2007 - 10:37 AM

Hello my friends . I just tryed SXMS becouse I need a better way to play MP3 in my game . Now , I have a problem . SXMS is pretty complex, but I just want to play MP3 and also se the PAN (balance) of the sounds . Can someone give me an easy script (that I can use with sxeasy) that will set the pan ? Thank you, I hope you can help
  • 0

#300 Volvagia356

Volvagia356

    GMC Member

  • New Member
  • 1 posts

Posted 14 April 2007 - 09:22 AM

I need help using SXMS.
I am using the WinAmp part.
I am using GM6.1
When I executed the demo and selected 2, I go an error.
After I try to load a plugin, i got an error.
When I try to play the file, I got another error.
I had modified the scripts and it says "Unexpected error"
I even stripped down the scripts and I still get "Unexpected Error"
Help Please?
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users