[Gambas-user] gb3: gb.sdl.sound disallows more than 8 sounds/channels at once

Benoît Minisini gambas at ...1...
Sun Jul 24 16:43:43 CEST 2011


> 
> ' General declarations.
> Public Struct Effect  ' Structure containing an individual sound
> effect's data.
>    Sample As Sound       ' Waveform data (file).
>    Chan As Channel       ' Default channel to play on.
>    AmpCurrent As Single  ' Current amplitude.
>    AmpTarget As Single   ' Target amplitude.
>    AmpScale As Single    ' Target amplitude multiplier.
> End Struct
> Public Environment[16] As Struct Effect ' Environmental sound effects.
> 
> Public Sub Initialize()
> 
>    ' Start basic environmental sound effects.
> 
>    Channels.Count = 32
> 

Can you print the value of Channels.Count after having set it?

Anyway it's strange : you say that the 9th sound starts playing (so it has a 
channel), but the Play() method returns no channel !

Otherwise, in revision #3947, I added support for fade in and fade out while 
playing sound:

	...Sample.Play(-1, 1.5) ' Fade in during 1500 milliseconds.

	..Chan.Stop(4) ' Fade out during 4000 milliseconds.

Maybe you will find some use for that.

Regards,

-- 
Benoît Minisini




More information about the User mailing list