Jump to content


Photo

SG Audio DLL


  • Please log in to reply
113 replies to this topic

#61 mads2194

mads2194

    GMC Member

  • GMC Member
  • 368 posts
  • Version:Unknown

Posted 25 August 2011 - 09:35 PM

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


I usually use Audacity for the converting. Just to make sure, I reconverted my sound clips with Audacity 1.3 Beta and they still don`t play properly.
  • 0

#62 Atomhead

Atomhead

    GMC Member

  • GMC Member
  • 37 posts

Posted 26 August 2011 - 12:08 PM

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. :)


Intel i7 920 (quad) @ 2,67GHz, WIN7 x64.
Thanks for your efforts.
  • 0

#63 snake5

snake5

    GMC Member

  • GMC Member
  • 71 posts

Posted 26 August 2011 - 04:26 PM

I usually use Audacity for the converting. Just to make sure, I reconverted my sound clips with Audacity 1.3 Beta and they still don`t play properly.


Perhaps the default codec used for ogg encoding is too new. Had something like this when I was encoding ogg files (with v3, I think) and some players didn't like the files too. While I get to updating the decoder, you could try using some of the older ogg encoders. ;)
  • 0

#64 scorpeti

scorpeti

    GMC Member

  • New Member
  • 15 posts

Posted 22 September 2011 - 10:25 AM

Hello!

I use your dll, it's working nice on my laptop. But when I tried my game on a pc (win xp pro sp3, amd athlon 64 processor 3000+, 2.01 GHz, 1 GB RAM), after playing some 3D sounds with different positions and volume, this error message showed up: "WAV load error: AL error in alBufferData (programmer error" and the game shut down. However, I play many sound effects at the same time in the game and sometimes they are played strange and low. I use different Emitters for every sound effect. On my laptop, the same game works perfect without any error message and strange sounds.
What do you think, what should I do?
  • 0

#65 snake5

snake5

    GMC Member

  • GMC Member
  • 71 posts

Posted 30 September 2011 - 08:48 AM

Finally got some time to check sga_IsPlaying. Didn't notice any performance problems, running in both singlethreaded and multithreaded environments. In case I've accidentally fixed something and because I've really fixed something while working on the engine, I uploaded the SDK with the newest version of the DLL: http://www.box.net/shared/3tzyqjjp9c

What do you think, what should I do?

It's hard to tell. Perhaps there's something wrong with the sound configuration of your PC. Only if other games that use OpenAL run fine, the bug can be somewhere in your project or my DLL.

As to other bugs and requests, I haven't found the time to update and recompile the DLL with newest versions of Ogg SDK so you'll have to keep using old file versions. For custom looping to work, I'd have to switch between looping/non-looping streaming while the stream is running and that offers some difficulties. But hopefully, I should figure something out before the end of this year.

P.S. Extreme error checking is enabled in this version of the DLL. Most of the time, nothing should happen. But whenever something does happen, please let me know the ID of the error and the name of the script that was used, if that's possible.

Edited by snake5, 30 September 2011 - 08:56 AM.

  • 1

#66 scorpeti

scorpeti

    GMC Member

  • New Member
  • 15 posts

Posted 01 October 2011 - 01:26 PM

Finally got some time to check sga_IsPlaying. Didn't notice any performance problems, running in both singlethreaded and multithreaded environments. In case I've accidentally fixed something and because I've really fixed something while working on the engine, I uploaded the SDK with the newest version of the DLL: http://www.box.net/shared/3tzyqjjp9c

What do you think, what should I do?

It's hard to tell. Perhaps there's something wrong with the sound configuration of your PC. Only if other games that use OpenAL run fine, the bug can be somewhere in your project or my DLL.

As to other bugs and requests, I haven't found the time to update and recompile the DLL with newest versions of Ogg SDK so you'll have to keep using old file versions. For custom looping to work, I'd have to switch between looping/non-looping streaming while the stream is running and that offers some difficulties. But hopefully, I should figure something out before the end of this year.

P.S. Extreme error checking is enabled in this version of the DLL. Most of the time, nothing should happen. But whenever something does happen, please let me know the ID of the error and the name of the script that was used, if that's possible.


I checked some popular game using OpenAL and they work fine on this computer. This is the first time I realized this problem.
I downloaded the newest version and put it in the game. The problem is still there, there are strange sounds and an error message. The only difference is in the string of the error window: now shows this: "AL - ERROR - 40961". I pressed OK and the game shut down. On my laptop and on an other (newer) pc the same game and the new dll work absolutely fine without any strange sound or error message.

  • 0

#67 norisak

norisak

    GMC Member

  • GMC Member
  • 130 posts
  • Version:GM8

Posted 01 October 2011 - 05:32 PM

A .ogg song only plays once. I have to restart the executable to make it play again. Also one of my .ogg sound effect play fine the first time, but the rest of the times it only plays the second half and if the sound effect is played like 6-7 times in 10 second, it automatically loops for some seconds. I used the PlayFX and it worked fine.

Edited by norisak, 01 October 2011 - 05:51 PM.

  • 0

#68 snake5

snake5

    GMC Member

  • GMC Member
  • 71 posts

Posted 02 October 2011 - 02:41 PM

The only difference is in the string of the error window: now shows this: "AL - ERROR - 40961".

It's AL_INVALID_NAME which would mean that a buffer/source ID that I passed was not generated by OpenAL.
If that happens at all, in perfect circumstances that should happen on all computers. And that means you should try to remove the included versions of the OpenAL DLLs. Perhaps they're outdated or not suited to the hardware/software that you use.

A .ogg song only plays once. I have to restart the executable to make it play again.

There's a script that enables looping on an emitter. There's also an argument for that in the track playing script.

Edited by snake5, 02 October 2011 - 02:42 PM.

  • 1

#69 sagez

sagez

    GMC Member

  • GMC Member
  • 17 posts

Posted 05 October 2011 - 12:45 AM

sga_IsPlaying seems to still return 1 despite the fact that the song has finished.

It would be great if you could add a function to return the length of the sound.

Edited by sagez, 05 October 2011 - 11:49 PM.

  • 1

#70 scorpeti

scorpeti

    GMC Member

  • New Member
  • 15 posts

Posted 05 October 2011 - 10:17 AM

It's AL_INVALID_NAME which would mean that a buffer/source ID that I passed was not generated by OpenAL.
If that happens at all, in perfect circumstances that should happen on all computers. And that means you should try to remove the included versions of the OpenAL DLLs. Perhaps they're outdated or not suited to the hardware/software that you use.

Ok, I'll check it, thanks for help.
I just wonder if my OpenAL is outdated why this problem shows up only in my game, not in ut2004 and other popular ones...

Edited by scorpeti, 05 October 2011 - 10:21 AM.

  • 0

#71 Hiric

Hiric

    GMC Member

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

Posted 05 October 2011 - 06:50 PM

Finally got some time to check sga_IsPlaying. Didn't notice any performance problems, running in both singlethreaded and multithreaded environments.


Thanks for checking!
I tested the previous version in both enviroments as well and the game still crashed, so I'm using a single emitter for the music at the moment, and manually keeping track of the last music played (all looping) to determine which song is playing.
I will test if something changed with the old code and the new version as soon as possible.

Anyway, I'm now testing the new version and only now I'm experiencing this issue (I'm pretty sure I didn't change a single comma on my side):

Now, whenever I call

[music is playing now]
sga_Stop(MusicEmitter);
and then
MusicEmitter = sga_TrackPlay(MusicEmitter, ds_map_find_value(MusicFilenames, argument0), 1, 0);
I get a 40963 OpenAL error. Previous version didn't fire this exception and everything was going (apparently) fine.

The arguments are all valid, and the very same function gets called several times with no problem, exception made for this particular case.

I googled it and found this article (yes, it's not about GameMaker, but I thought it could be handy, since the posters seemed to have fixed the issue. Again, I have no idea of how you wrapped the OpenAL library, so I'm blindly posting the link, don't know if the classes are the same)
http://www.cocos2d-i...orum/topic/2578

What is this error about? Thank you for your time!

EDIT:
I probably managed to circumvent this issue by changing my "musicStopAll" script to

sga_Stop(MusicEmitter);
MusicEmitter = -1;

The small description of the sga_TrackPlay function states:

//// This script plays a track
// Arguments: emitter ID or -1 for the first time, File name, Looping mode (0/1), Type flags


We actually have to set it to -1 every time the emitter gets stopped or has never been played, right?
Or, is it because I'm using the same emitter to play different tracks? Will the behavior of this function change to take this case in account?

Edited by Hiric, 05 October 2011 - 07:25 PM.

  • 0

#72 sagez

sagez

    GMC Member

  • GMC Member
  • 17 posts

Posted 05 October 2011 - 11:42 PM

I get a 40963 OpenAL error

I get the same error and I'm using different emitters for the music.

Edited by sagez, 05 October 2011 - 11:47 PM.

  • 0

#73 banov

banov

    GMC Member

  • GMC Member
  • 1160 posts
  • Version:Unknown

Posted 10 October 2011 - 03:12 AM

Hey, I'm working on a big project using supersound and I'm very very far along. But it's in GM8.1 which I think has some minor issues with ssound. Sometimes when my game quits even though it unloads the sounds from supersound (and I have a debug message in the unload script that shows a message when the script is run so I KNOW it's not skipping), the game will continue to run unseen and eats a LOT of memory. Speaking of, to do some things with ssound I have to have all my sounds loaded into memory when the game starts and it makes the game quite resource-heavy and I think causes some other issues.

So this seems like it could be worth switching into. But I have some q's about its capabilities before I go headlong into replacing everything.

All my sound playing is through one object, and this game is an RPG. One of the most important functions I need is to be able to PAUSE music, go to a different room in which a different bgm plays (the battle screen), and then have the previous sound RESUME when I return to the prior screen. Can SGA do that? For SS to do that I have to have all music preloaded into memory when the game starts, would that be the same case for SGA?
  • 0

#74 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14391 posts
  • Version:GM:Studio

Posted 10 October 2011 - 04:37 AM

...



First off, make sure you dont use ogg sounds for sound effects.

Second, your background music, if you have many, say one for each room, you should load it on the room_start event and stop it and free it on room end, except for the one you paused.


Mainly, your issues are probably due to management of the content.

On my end, I had users load sounds on create in a room they would repeatedly go to... reloading the sounds over and over...


Tactic:
Make a boot room (first room), put a persistent controller in it.

Controller On Game Start
Load the dll
load your sounds
room_goto_next();

Controller On Game End
unload/free your sounds
Unload the dll

Controller On Room Start
<optional> load sounds used by the room based on room id
select the sound to play based on room id

Controller On Room end
Stop the sounds used by room based on room id
<optional> unload/free sounds used by the room based on room id



The controller will follow through each room because it's persistent and manage the sound resources properly. Just make sure you never go back to the boot room by any other mean than game_restart(), which will cause all the event to trigger, freeing everything including the dll and reloading everything again.
  • 0

#75 banov

banov

    GMC Member

  • GMC Member
  • 1160 posts
  • Version:Unknown

Posted 10 October 2011 - 05:40 AM

Okay. My question was if SGA had the capability, and if it could do it using less memory. I guess that answered it.
  • 0

#76 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14391 posts
  • Version:GM:Studio

Posted 10 October 2011 - 05:55 AM

Okay. My question was if SGA had the capability, and if it could do it using less memory. I guess that answered it.

Main post says: OGG streaming support

So if the api needs for you to set argument to load it streamed, you should use it for ogg

Possibly it's the Type flags argument? No document on it in the comments
  • 0

#77 scorpeti

scorpeti

    GMC Member

  • New Member
  • 15 posts

Posted 16 November 2011 - 08:13 AM

Hi!

I have the problem with playing too many sounds at the same time and got this error message in a short time when the game freezes: "AL - ERROR - 40961". I just updated OpenAL to version 2.1 on this computer, I think this is the newest one. But I still get this error message and the game still freezes. Do you have any idea, what should I do?
  • 0

#78 Loaf

Loaf

    Just loafing around

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

Posted 29 November 2011 - 02:37 AM

This has such little documentation its ridiculous.
  • 0

#79 Ronchon le Nain

Ronchon le Nain

    GMC Member

  • GMC Member
  • 87 posts
  • Version:GM8

Posted 01 December 2011 - 05:08 PM

Same...
And i get random crashes at room endings when destroying emitters.
Also, i was unable to find any doc or exemple to set a basic 3D effect sound. Moving on...
  • 0

#80 Hiric

Hiric

    GMC Member

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

Posted 20 January 2012 - 08:11 PM

For some reason initializing the DLL within the room creation event with GM 8.1.141 crashes the game and prevents it from running.
This only happens with the last GM update, I pointed it out in the official GM updates thread (http://gmc.yoyogames...dpost&p=3893761)

Edited by Hiric, 20 January 2012 - 08:12 PM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users