This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuQuote from: Snarky on Thu 21/05/2015 17:45:33
Thank you! (It was actually your turn anyway, so take it away!)
Quote from: geork on Sat 02/05/2015 16:01:32
It makes sense that if your code is moved to repeatedly_execute(), then it won't play whenever a command is executed which "blocks" the script (eBlock). You'd want to keep the audio code in repeatedly_execute_always(), since it always runs regardless.
Quote from: georkI don't think I'm hitting the 5 channel limit. I have the footsteps audioclip occupying a channel and then I can't call even one additional audioclip unless it's a music or Ambient Sound type.
How many channels do you have going? AGS has a limit of 5 channels, with an additional 1 channel set aside for Music, Ambient Sound and Voice respectively. I've never hit the channel cap, but maybe that's what's causing these issues? That's not to say that you can't HAVE more than 5 Channels, but you can't have more than 5 ACTIVE at any one time.
if(player.Moving==true){
if(Walking==null||Walking.IsPlaying==false){//IsPlaying==false){
Walking=aFootsteps.Play();
Walking.SetRoomLocation(Room.Width/2, Room.Height);
}
}else{
player.SetWalkSpeed(player.GetProperty("DefaultWalkSpeed"),player.GetProperty("DefaultWalkSpeed"));
if(Walking!=null)Walking.Stop();
}
function StartAmbientSound(){
int RoomAmbientSoundType=Room.GetProperty("AmbientSoundType");
if (RoomAmbientSoundType==LastRoomAmbientSoundType){
return; // no need to do anything
}
LastRoomAmbientSoundType=RoomAmbientSoundType;
//Stop Current Sound
if((AmbientSound!=null)&&(AmbientSound.IsPlaying)){
AmbientSound.Stop();
}
if(RoomAmbientSoundType==eQuiet){
}else if(RoomAmbientSoundType==eBirds){
Display("this code is seen");
AmbientSound=aBirds.Play(eAudioPriorityHigh);
}
}
Quote from: Crimson Wizard on Mon 20/04/2015 09:08:09
Regarding the problem, do I understand this right, that your ambient sound plays, but music stops?
Please tell, what audio types do those sounds belong, and how many available channels did you set for those types in their properties.
IS AmbientSound a global variable, and how precisely it is declared?
if((AmbientSound!=null)||(AmbientSound.IsPlaying)){
enum AmbientSounds{
eQuiet=0,
eBirds=1,
eBeach=2
};
import function StartAmbientSound();
function StartAmbientSound(){
if((AmbientSound==null)||(AmbientSound.IsPlaying==false)){
int atmosphere=Room.GetProperty("AmbientSound");
if(atmosphere==eQuiet){//Don't play a sound
}else if(atmosphere==eBirds){
AmbientSound=aBirds.Play();
}
}else{
int atmosphere=Room.GetProperty("AmbientSound");
if(atmosphere==eQuiet){
AmbientSound.Stop();
}else if(atmosphere==eBirds){
AmbientSound=aBirds.Play();
}
}
}
function room_Load()
{
StartAmbientSound();
}
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.031 seconds with 14 queries.