Jump to content


Photo

SG Audio DLL


  • Please log in to reply
113 replies to this topic

#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
  • 659 posts
  • Version:GM8.1

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
  • 116 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
  • 16839 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
  • 37 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
  • 54 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
  • 368 posts
  • Version:Unknown

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
  • 368 posts
  • Version:Unknown

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

  • Global Moderators
  • 14397 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