Jump to content


Photo

SG Audio DLL


  • Please log in to reply
134 replies to this topic

#31 Dom83

Dom83

    GMC Member

  • GMC Member
  • 138 posts

Posted 01 May 2011 - 01:54 PM

I included your dlls to my game as ressources and told it to put them in temp folder, then I changed paths in script to
temp_directory + "\SGAudio.dll"
But no change, I still have the error though when I create an exe it works.

To report bugs : http://bugs.yoyogame.../login_page.php but it seems that I am the only one having this problem so they may not be able to recreate this bug.
  • 0

#32 snake5

snake5

    GMC Member

  • GMC Member
  • 71 posts

Posted 01 May 2011 - 03:19 PM

I think you should still report it, with all the specific data about your software configuration - someone has to start looking into it and it looks like we cannot do anything from here. :(
  • 0

#33 thomasderoo

thomasderoo

    GMC Member

  • New Member
  • 54 posts

Posted 18 May 2011 - 07:44 AM

saved my ass right there,

I was using fmod when i found out i needed a license to sell anything i make with it. i found this and im sooo happy :). it works almost the same so porting was not a big problem :)

thank you,
  • 0

#34 thomasderoo

thomasderoo

    GMC Member

  • New Member
  • 54 posts

Posted 20 May 2011 - 09:37 AM

and also, all of the dlls can be placed in an external folder. with fmod, the fmodex.dll needs to be in the working directory, else it wouldnt work. thats just one more reason to use this instead of fmod
  • 0

#35 Jaycliff

Jaycliff

    GMC Member

  • New Member
  • 8 posts

Posted 30 May 2011 - 04:43 AM

This dll will completely replace the default gm sound system if it features sound effects like reverb, chorus, multishot sounds, etc. :)
  • 0

#36 DackR

DackR

    GMC Member

  • New Member
  • 7 posts

Posted 01 June 2011 - 12:15 AM

Big thanks to snake5 for making and compiling this DLL package. I've been able to map a lot of the functions I was using with SuperSound over to SG Audio.

I've started using your module since there are yet issues with GM8.1 and SS, I haven't come across any problems with SG Audio in GM 8.1. Though, I haven't been able to mirror the full functionality of SuperSound yet.

It would be great if you added more functions to return the current audio settings for an emitter (other than GetVol, GetType, IsPlaying, GetPlayOffset -- which are great). Matching functions for all of the 'Set' commands (like GetPanning, IsLooping, GetPitch, etc) would be a great way for those still using SuperSound to make the switch easier. Maybe I'll even post my GML that maps the SG Audio Functions with the matching 'SS_' function. Soo...If you make an updated version, I'll help to ease the transition for other SuperSound users. :)

Just a thought.


Oh- one more thing. I got an error message stating that 'alut.dll' cannot be found. (I even got this error after downloading your SDK.) To fix it, I grabbed the dll from the latest FreeSL package... I'm sure it's available elsewhere as well. Just wanted to make sure you were aware... Thanks again.

Edited by DackR, 01 June 2011 - 12:39 AM.

  • 0

#37 snake5

snake5

    GMC Member

  • GMC Member
  • 71 posts

Posted 01 June 2011 - 01:35 AM

This dll will completely replace the default gm sound system if it features sound effects like reverb, chorus, multishot sounds, etc.

Multishot is planned to be a part of the SG Audio Utility Toolkit scripts. I could probably implement effects like reverb and the low pass filter some day but I can't guarantee that it will happen anytime soon.

It would be great if you added more functions to return the current audio settings for an emitter

There's a good reason why I haven't done that. Panning is a cheap hack and is not guaranteed to work in every situation. It works by setting 3D data with special algorithms that emulate panning. Due to the current limitations of OpenAL, I couldn't implement it naturally. Therefore, the returned panning value can be misleading. I didn't implement IsLooping because this helps the developer to develop a healthy habit of making sure that the sound is initialized properly. Though if I find a situation where checking if looping is enabled actually helps, I will implement it. It's similar with GetPitch in the way that pitch is usually controlled by something else and that thing is usually correlated to the pitch of the sound and thus there's usually no need to retrieve the same data from the DLL. That's a lot of assumptions but they all come from my experience. :D

I made this DLL specifically with games in mind - they use everything OpenAL has to offer, they don't care about panning, they have high volume control requirements and sound management is supposed to be simple. That means three things: 1) if someone wants to make a music player out of this DLL, there's probably a better one for that kind of work out there; 2) true panning will not be implemented at least until the developers of OpenAL decide that it's necessary; 3) this DLL will probably never be a perfect replacement for the SuperSound DLL.

I got an error message stating that 'alut.dll' cannot be found.

There's something seriously wrong. I removed ALUT a long time ago and I have never linked my DLL to the DLL version of that library. And Dependency Viewer doesn't show any links to alut.dll here. Is there any chance that the error came from something else? (including any specialized versions of OpenAL renderers you might have installed..)
  • 0

#38 DackR

DackR

    GMC Member

  • New Member
  • 7 posts

Posted 01 June 2011 - 04:00 AM

I got an error message stating that 'alut.dll' cannot be found.

There's something seriously wrong. I removed ALUT a long time ago and I have never linked my DLL to the DLL version of that library. And Dependency Viewer doesn't show any links to alut.dll here. Is there any chance that the error came from something else? (including any specialized versions of OpenAL renderers you might have installed..)


Thanks for the quick response. I found the problem. Looks like I had another version of OpenAL.dll installed in the windows\system32 folder and it was taking control. I removed it and now I don't need alut.dll. ;) Sorry to alarm you for nothing.

About the emitter state return functions: I'm glad you've thought this out so well. :) I'm sure if anyone 'really' needed those functions, they could manage it in their own code. I completely agree, no need to implement features that will only serve to mislead or confuse.

I have no further suggestions, only my complements!

Cheers!

Edited by DackR, 01 June 2011 - 04:09 AM.

  • 0

#39 Tkachov

Tkachov

    GMC Member

  • GMC Member
  • 22 posts

Posted 13 June 2011 - 03:29 PM

Hello =)
I've found this dll today, 'cos I've searched to an alternative for supersound.dll. I've added it to my game, and it works great...
But I need to change playing position (really, I just write position to a file and then load it; and music must begin from this position).
I've tried to use sga_SetPlayOffset() script, but instead playing music it just looping one small (about one second duration) piece of music.

This code loop beginning of music:
//LoopTrack(filename, pos);
sga_TrackPlay(global.music, argument0, 1, 0);
if(argument_count>1){sga_SetPlayOffset(global.music,argument1);}

This code loop small piece, that begin at <pos>:
//LoopTrack(filename, pos);
sga_TrackPlay(global.music, argument0, 1, 0);
sga_Stop(global.music);
if(argument_count>1){sga_SetPlayOffset(global.music,argument1);}
sga_Play(global.music);

So, how should I use this script to run sound from specific position?

Edited by Tkachov, 13 June 2011 - 04:08 PM.

  • 0

#40 Bleed

Bleed

    Chevalier

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

Posted 13 June 2011 - 06:46 PM

So i did another test and came up with a few more issues:
-First of all, cpu ussage when using the dll increases by at least 4%, it skyrockets to +15-20% when playing a sound, its probably OpenAL's fault, so not sure you have much control over that, it could just be for small length files only.
-Second the sga_SetGroupVol(master_team0,vol) doesn't work.

Tested on 7SP1,P4 3.0 and GM8.0

P.S : The bug i reported seems to have been fixed, awesome work on that.

Good work on developing this dll i really like it, good alternative over Super Sound that stopped receiving updates a long time ago, and it still had some crucial bugs in it.
  • 0

#41 snake5

snake5

    GMC Member

  • GMC Member
  • 71 posts

Posted 14 June 2011 - 09:19 AM

I'll check CPU usage after some time. It shouldn't be a problem though since that's not a really big increase. I think the same increase will happen if you play 10 sounds instead of one. In that case, it's just the sound mixer doing its job. If you get 100% CPU usage and stuttering sounds, that might be a better reason to investigate.

And about that second problem... are you sure you're using it correctly? It's quite simple to make a mistake with group flags in which case something definitely isn't going to sound right.
  • 0

#42 Bleed

Bleed

    Chevalier

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

Posted 14 June 2011 - 01:58 PM

I use it like this:

my_fx = sga_CreateFX(sound_path,0);
sga_SetGroupVol(0,0.5);
Flag 0 is the master flag that controls volume for all sounds right?


Well cpu utilization might not be a problem for p4 and later but since i'm developing games targeted for older computers, it might get noticeable on them.

I'll check CPU usage after some time. It shouldn't be a problem though since that's not a really big increase. I think the same increase will happen if you play 10 sounds instead of one. In that case, it's just the sound mixer doing its job. If you get 100% CPU usage and stuttering sounds, that might be a better reason to investigate.

And about that second problem... are you sure you're using it correctly? It's quite simple to make a mistake with group flags in which case something definitely isn't going to sound right.


  • 0

#43 Tkachov

Tkachov

    GMC Member

  • GMC Member
  • 22 posts

Posted 14 June 2011 - 03:17 PM

You've ignored me. <_<

There are some question about sga_SetPlayOffset();
I'm trying to use it, and instead playing whole track from specified position it playing small piece of this track.
(You can view code examples on previous page.)
  • 0

#44 snake5

snake5

    GMC Member

  • GMC Member
  • 71 posts

Posted 17 June 2011 - 02:52 PM

sga_SetGroupVol(0,0.5);

Found the bug, thanks. Will be fixed and uploaded soon. You can work around that and add your own master volume group for now.

You've ignored me.

Sorry, didn't notice your post. Looking at it now.

I'm trying to use it, and instead playing whole track from specified position it playing small piece of this track.

It's quite possible that there are bugs (more than one) in those offset functions. I'll try to fix them soon.

There is a problem though. I cannot work on the bugs at the moment because I'm trying to start selling software and the faster I succeed, the faster I can get back to fixing all these bugs.
In case you're interested, you'll find more info about the tool that I'm going to sell here: http://cragegames.co...exture-designer
  • 0

#45 Tkachov

Tkachov

    GMC Member

  • GMC Member
  • 22 posts

Posted 19 June 2011 - 02:20 AM

OK, I'm waiting for updates.
  • 0

#46 grugin

grugin

    GMC Member

  • GMC Member
  • 127 posts

Posted 22 June 2011 - 08:55 AM

Hello, there is a way to add a reverb effect on one sound or a group ? Thanks in advance !
  • 0

#47 Nocturne

Nocturne

    Nocturne Games

  • Administrators
  • 22269 posts
  • Version:GM:Studio

Posted 22 June 2011 - 09:21 AM

Great dll this and replaces the obsolete (and sadly missed) Supersound dll. It's great that it is 8.1 compatible too! May I make a feature request? Can you add pitch change capabilities as that is a great way to add variety and doppler effects to sounds. Anyway, good work and I hope your venture into selling software works out and you can dedicate a little more time to this great dll.
  • 0

#48 snake5

snake5

    GMC Member

  • GMC Member
  • 71 posts

Posted 23 June 2011 - 08:37 AM

Pitch change might not be possible to implement with pure OpenAL but Doppler effects and Reverb seem to be quite possible.
  • 0

#49 qwertybub3

qwertybub3

    GMC Member

  • GMC Member
  • 8 posts

Posted 05 July 2011 - 02:53 AM

How do I use sga_IsPlaying ?

Whenever I try to use it the game hogs the CPU.

Edited by qwertybub3, 06 July 2011 - 03:07 AM.

  • 0

#50 snake5

snake5

    GMC Member

  • GMC Member
  • 71 posts

Posted 08 July 2011 - 10:53 PM

You can try to use it less often. It shouldn't really do that though.
  • 0

#51 Atomhead

Atomhead

    GMC Member

  • GMC Member
  • 41 posts

Posted 16 July 2011 - 10:17 PM

I'm having the same problem with sga_IsPlaying()

Here's what i do to crash my game:

if(!sga_IsPlaying("snd/title.ogg")){
e_music = sga_TrackPlay( -1, "snd/title.ogg", 1, 0 );
}

it does work without the sga_IsPlaying()...

*edit*
i've also tried to create e_music first and used it like this:
if(sga_IsPlaying(e_music)){}
...same problem.

Edited by Atomhead, 17 July 2011 - 12:51 AM.

  • 0

#52 Armisticdoom

Armisticdoom

    GMC Member

  • New Member
  • 73 posts

Posted 27 July 2011 - 01:58 PM

does this support more than one of the same 3d sound playing at once?
  • 0

#53 thomasderoo

thomasderoo

    GMC Member

  • New Member
  • 54 posts

Posted 02 August 2011 - 06:31 AM

im having a hard time trying to get 3d sound to work. im using GMOgre3D as an engine, and SGAudio for the sound. However, my 3d sounds dont get damped if they go farther into the distance(ive linked my sound to play from where i click on the terrain). panning doesnt seem to change either when clicking left or right.

If its of any importance, my camera height is 60, so a regular person is about 64 units high.

Am i doing something wrong with the distance factor?
  • 0

#54 Hiric

Hiric

    GMC Member

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

Posted 03 August 2011 - 02:34 PM

Thanks, for the great DLL snake5, I'm already using it in my current project! (in the signature)

As other users pointed out, in my experience the sga_IsPlaying function doesn't behave properly. In my case, it is literally hanging the game.


It's in a small 5 cycles loop right after the sga_Init() in the room creation event code. It ensures that a specific track isn't playing, and if it isn't, starts looping it. I'm initializing 5 emitters one after another.
The call seems to hang the game randomly on one of the 5 steps inside the loop.

I'm now trying to isolate the problem, I suspect it may be something like an unhandled exception, maybe caused that it gets called when the emitter hasn't been initialized yet OR there's some problem with a specific OGG file format. The fact is, I re-encoded every MP3 track in OGG format by using the same encoder.

To override the problem I'm using a single emitter, and keeping track of the last played music in a separate data structure but... well, I feel the sga_IsPlaying function really has something wrong, I have no idea if it's the wrapper or what :P


May you please doublecheck the function when possible? :)

Edited by Hiric, 03 August 2011 - 02:34 PM.

  • 0

#55 thomasderoo

thomasderoo

    GMC Member

  • New Member
  • 54 posts

Posted 09 August 2011 - 07:56 AM

should i count on multishot support anytime soon, or do i need to write my own system with a buffer consisting of multiple emitters of the same sound?
  • 0

#56 spicydeath82

spicydeath82

    Awesomesauce

  • New Member
  • 138 posts
  • Version:GM8

Posted 14 August 2011 - 04:11 AM

is no news good news? are you still working on this as i have a project i'd like to use this in, but not if it's being abandoned...
  • 0

#57 mads2194

mads2194

    GMC Member

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

Posted 21 August 2011 - 09:15 PM

Does it only support wavs for sound effects? I have problems using .ogg files for sound effects.

Edited by mads2194, 25 August 2011 - 07:24 PM.

  • 0

#58 snake5

snake5

    GMC Member

  • GMC Member
  • 71 posts

Posted 25 August 2011 - 08:36 PM

I'm back.. kind of.
I will have to disappear for a while but as soon as I resolve some problems of personal nature (expected to happen in 2 weeks / 2 months), I will add some bugs and fix some features... (or is it the other way around? :D ) I'm not working on the project at the moment but I hope to get back to it soon enough.

AFAIK, Ogg files can also be used for sound effects but at the moment it is impossible to determine their potential to stall the game while streaming the file from disk.

Armisticdoom: yes, but you have to make them all yourself.
thomasderoo:
#1 - remember that stereo sounds don't work together with 3D.
#2 - if you want it soon, I cannot implement that myself unfortunately and you will probably have to do that yourself, all I could do is throw some ideas about the design.

As far as I can tell at the moment, sga_IsPlaying should not eat up CPU time because it's basically an OpenAL call, just like many other functions. If some of the playing functions do something similar, I might have a clue as to where the problem might be, otherwise I will have none. There's one thing to remember though - sga_IsPlaying requires a valid ID of the emitter. Should just return 0 with everything else though...

While I'm solving my problems, perhaps you (those who have problems with sga_IsPlaying) could help me find the bug - all you need to do is to say how many cores/CPUs you're using and which OS. :)
  • 0

#59 mads2194

mads2194

    GMC Member

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

Posted 25 August 2011 - 08:55 PM

AFAIK, Ogg files can also be used for sound effects but at the moment it is impossible to determine their potential to stall the game while streaming the file from disk.


Sadly, they don`t play correctly for me :(

They either don`t play at all or sound weird.

Edited by mads2194, 25 August 2011 - 08:57 PM.

  • 0

#60 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 16179 posts
  • Version:GM:Studio

Posted 25 August 2011 - 09:20 PM


AFAIK, Ogg files can also be used for sound effects but at the moment it is impossible to determine their potential to stall the game while streaming the file from disk.


Sadly, they don`t play correctly for me :(

They either don`t play at all or sound weird.


Use Audacity to verify the ogg is proper. I got a few on my end who converted mp3 to ogg with a defective converter. Use audacity for conversion
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users