Author Topic: Case Select sound issue  (Read 563 times)

kent79

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
Case Select sound issue
« on: September 25, 2017, 05:14:53 PM »
I would like to add select click sound while selected system, so added code as below. But sound can't run it properly. I suspect the sound is cutting when the theme was changed to game menu. We need to add "holding" control - the sound must play completed and then goto game theme. Anyone can know how to do it? Attachment is  sample code. Please try. Thanks.  :)

Ideal:
Select & click system -> play click sound fully -> goto game menu

Current:
Select & click system -> play click sound not completed -> goto game menu
 

Code: [Select]
case "select":
local bgMusic1 = fe.add_sound("start.mp3")
bgMusic1.playing=true
break;

keilmillerjr

  • Sr. Member
  • ****
  • Posts: 493
    • View Profile
Re: Case Select sound issue
« Reply #1 on: September 25, 2017, 05:41:37 PM »

jedione

  • Sr. Member
  • ****
  • Posts: 439
  • punktoe
    • View Profile
Re: Case Select sound issue
« Reply #2 on: September 25, 2017, 06:18:02 PM »
you could just put a starting sound that is unique upon entrance to each theme..

this is what i have used.

Code: [Select]
function start_theme( ttype, var, ttime ) {
 switch ( ttype ) {
  case Transition.StartLayout:
              local sound = fe.add_sound("intro.mp3");
      sound.playing=true;
  break;
  }
 return false;
}
fe.add_transition_callback( "start_theme" );


i know its not the answer you were looking for butt just another way of getting a similar effect.
help a friend....

jedione

  • Sr. Member
  • ****
  • Posts: 439
  • punktoe
    • View Profile
Re: Case Select sound issue
« Reply #3 on: September 25, 2017, 06:23:55 PM »
on that added note...a selection is technically the end of the system menu

so this should work    .EndLayout



function start_theme( ttype, var, ttime ) {
 switch ( ttype ) {
  case Transition..EndLayout:
              local sound = fe.add_sound("intro.mp3");
         sound.playing=true;
  break;
  }
 return false;
}
fe.add_transition_callback( "start_theme" );
help a friend....

kent79

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
Re: Case Select sound issue
« Reply #4 on: September 25, 2017, 06:33:26 PM »
on that added note...a selection is technically the end of the system menu

so this should work    .EndLayout



function start_theme( ttype, var, ttime ) {
 switch ( ttype ) {
  case Transition..EndLayout:
              local sound = fe.add_sound("intro.mp3");
         sound.playing=true;
  break;
  }
 return false;
}
fe.add_transition_callback( "start_theme" );

Try. But not working

keilmillerjr

  • Sr. Member
  • ****
  • Posts: 493
    • View Profile
Re: Case Select sound issue
« Reply #5 on: September 26, 2017, 04:17:17 AM »
on that added note...a selection is technically the end of the system menu

so this should work    .EndLayout



function start_theme( ttype, var, ttime ) {
 switch ( ttype ) {
  case Transition..EndLayout:
              local sound = fe.add_sound("intro.mp3");
         sound.playing=true;
  break;
  }
 return false;
}
fe.add_transition_callback( "start_theme" );

Transition needs to return false, and return true if sound playing is complete.

jedione

  • Sr. Member
  • ****
  • Posts: 439
  • punktoe
    • View Profile
Re: Case Select sound issue
« Reply #6 on: October 07, 2017, 06:07:20 AM »
well as it apears it is built in to AM allready,
all you need to do is go in to your am.config and add
this one line.


sound
   sound_volume         40
   ambient_volume       20
   movie_volume         30
   select               intro.mp3
   displays_menu        01 - Hey You.mp3


ie: intro.mp3  =  your.mp3 in the layout

and it will play when you select your system or game.
help a friend....