Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Janik on Thu 20/10/2005 01:43:14

Title: AGSE_AUDIODECODE not supported?
Post by: Janik on Thu 20/10/2005 01:43:14
I am trying to make a plugin where you can control how much sound plays in the left/right speakers (to make the effect of sound shifting from left to right as you pass by). I am using AGS 2.71.624 (beta)

The code I used is:


engine->RequestEventHook (AGSE_AUDIODECODE);

// and

int AGS_EngineAudioHook(int channel, char *buffer,
int len, int freq, int bits, int stereo)
{
//Rest of code goes here
}


But I get a message saying "Error: Plugin requested AUDIODECODE, which is no longer supported". I don't quite get it, the AudioHook seems to have been introduced not so long ago, (v.2.61), and it is still in the plugin documentation - why is it not supported anymore? Is there another way to use AGS_EngineAudioHook in the current version?

Thanks!

Title: Re: AGSE_AUDIODECODE not supported?
Post by: Pumaman on Thu 20/10/2005 19:42:58
AUDIODECODE was supported briefly for about 1 AGS version, but it didn't prove very useful, and caused performance problems and other issues and was then removed. Sorry.
Title: Re: AGSE_AUDIODECODE not supported?
Post by: Janik on Thu 20/10/2005 19:50:11
Fair enough, thanks for clearing that up.

Would it be possible for me to work around it in another way - namely by using the GetDirectSound() call? I don't want to use DisableSound() and take over all audio functions; but could I add an extra sound using the DirectSound functions, while AGS does the rest of the audio handling?
Title: Re: AGSE_AUDIODECODE not supported?
Post by: modgeulator on Fri 21/10/2005 06:55:22
Janik, I'd be very interested to see how to do that too. I spent a couple of weeks trying to make an audio plugin that worked alongside the AGS sound without success.

One thing you can do (on Windows 2000 / XP only) is set the AGS sound output to WaveOut and then your DirectSound based plugin can do it's thing at the same time. That's a bit of a kludge though, and it won't work on computers running older versions of Windows...
Title: Re: AGSE_AUDIODECODE not supported?
Post by: Pumaman on Fri 21/10/2005 19:21:45
You could try using the directsound object to play sounds yourself, it should work I guess but to be honest I'm not sure if it would.
Title: Re: AGSE_AUDIODECODE not supported?
Post by: Janik on Fri 21/10/2005 22:25:56
Quote from: modgeulator on Fri 21/10/2005 06:55:22
Janik, I'd be very interested to see how to do that too. I spent a couple of weeks trying to make an audio plugin that worked alongside the AGS sound without success.
What did you try? Did you use DirectSound?

I'll have to read up more on DirectX and DirectSound before trying. I imagine it's possible. There is even "3D" sounds, using the forward/back channels in addition to left/right, that would be cool to have (though this wouldn't make so much sense in a 2D Game ;D). I will give it a shot.
Title: Re: AGSE_AUDIODECODE not supported?
Post by: Elliott Hird on Sat 22/10/2005 10:38:03
Never mind blooming 3d sound when you can have 3d graphics, LOL!