Author Topic: Mute volume when attract mode starts or on a timeout? Please help? other ideas?  (Read 6476 times)

thejsn

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
I've spent a lot of time customizing retroFE for a free-to-play arcade machine for our students, but have now realized its going to drive people in the lounge crazy with attract mode sound playing all the time?  Is there any way to mute volume of videos after a specific timeout or perhaps when attract mode takes over?

I've tried every form of muting software incuding many different AHK type scripts but, it seems either the virtual joystick drivers I'm using won't prevent it from idling? or the virtual joysticks can never bring it out of idle to unmute it.  Seems the only solution is within retrofe itself.

I'm totally open to ideas, but if I can't mute the sound, it looks like I'll need to remove the audio of every video mp4 I have in retrofe :(
« Last Edit: September 19, 2019, 05:26:16 AM by thejsn »

johnm

  • Newbie
  • *
  • Posts: 32
  • Karma: +2/-0
    • View Profile

Have you tried task scheduler to activate a program called nircmd.exe on idle and set it to mute or unmute. I haven't tried this myself but seems to be what you're looking for

thejsn

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Hi John thanks for getting back to me the problem is, the Windows System does not see Joystick input as being a valid input device to count as idle.  Since the arcade machine has no keyboard or mouse, and joysticks aren't registering as a physical input.  The system idles out then mutes even when the joysticks are in use and playing a game.   The input from a joystick never then brings the system out of idle, which means we can never unmute.   

Unless I'm doing something completely wrong, We have to use x360ce drivers for our USB encoders.

johnm

  • Newbie
  • *
  • Posts: 32
  • Karma: +2/-0
    • View Profile

Have you tried using a keyboard encoder and then mapping controls to keyboard buttons. There was a project a few years ago called kade that gave the option of flashing an arduino with firmware compatible with consoles, hid joystick or mame compatible keyboard. As you are using this as a project then something like could be part of the learning process

DukeRom

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
I saw recently that the volume parameter of the videos can be set or animated - will that work?

thejsn

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
I saw recently that the volume parameter of the videos can be set or animated - will that work?

I think I may be able to set the volume control to be zero for all clips, which would save me re-encoding all videos to silence, but I don't think there is enough logic to determine if it's timed out or in attract mode.   I couldn't find instructions on how to use the new volume control feature. 
Are there instructions anywhere on how I could use this feature to achieve what i want to?

thejsn

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile

Have you tried using a keyboard encoder and then mapping controls to keyboard buttons. There was a project a few years ago called kade that gave the option of flashing an arduino with firmware compatible with consoles, hid joystick or mame compatible keyboard. As you are using this as a project then something like could be part of the learning process

I haven't yet since i bought USB encoders, sounds like i may need to , although i've also been reading that in windows 7, joystick input can break idle, but in windows 10 the system has locked that out.  So I'm not sure.  I tried using joytokey that converts my joystick to keyboard inputs, but the apps i've used need the physical input and don't un-idle from a virtual input.  I may need to change out hardware if this will work, unless the developer could simply add a toggle that allows us to set volume to 0 when attract mode runs. Then it could use the new volume functionality and just override it to 0 based on the configuration file toggle.  That would be much easier.

Pieter Hulshoff

  • Administrator
  • Hero Member
  • *****
  • Posts: 1543
  • Karma: +46/-14
    • View Profile
    • Towel 42
I'm looking into it; I'll either figure it out or write a patch for it.

Sent from my SM-G950F using Tapatalk


thejsn

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
I'm looking into it; I'll either figure it out or write a patch for it.

Sent from my SM-G950F using Tapatalk
Amazing thanks so much!  I'll send you pics of the machine once we get it installed!

Pieter Hulshoff

  • Administrator
  • Hero Member
  • *****
  • Posts: 1543
  • Karma: +46/-14
    • View Profile
    • Towel 42
It looks like I’ll have to add animation types for attract mode; I can’t do it as is without interfering with normal behavior.

Pieter Hulshoff

  • Administrator
  • Hero Member
  • *****
  • Posts: 1543
  • Karma: +46/-14
    • View Profile
    • Towel 42
Ok, this version (largely untested, so please keep your old executable as well) adds onAttractEnter, onAttract, and onAttractExit animation types. You can use this to set your volume to 0 using onAttractEnter and back to 1 using onAttractExit animations. Do keep in mind that the other animations still work in attract mode, so if you use volume control to fade-out/in volume during game change this will also happen during attract mode.
Something like:
    <onAttractEnter><set duration=".2"><animate type="volume" to="0"/></set></onAttractEnter>
    <onAttractExit><set duration=".2"><animate type="volume" to="1"/></set></onAttractExit>
« Last Edit: October 13, 2019, 09:15:47 PM by Pieter Hulshoff »

thejsn

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
I just tested this, its mostly working!  Thanks so much. 
The only time audio pops back in, is when attract mode changes to a different playlist. then it has sound for the first video clip, and then silent as soon as it selects the next game.   So audio only on the first game of an attract mode playlist switch.
« Last Edit: October 20, 2019, 02:40:07 AM by thejsn »

Pieter Hulshoff

  • Administrator
  • Hero Member
  • *****
  • Posts: 1543
  • Karma: +46/-14
    • View Profile
    • Towel 42
I generally have that feature turned off; I don’t see a need for switching playlists in attract mode.
Does the playlist change animation have volume by chance?

thejsn

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
I think its just the first clip of the playlist that plays audio, no switch sound, but I'll just default the playlist to all and have it attract mode from there.  Thanks so much for your help!

Pieter Hulshoff

  • Administrator
  • Hero Member
  • *****
  • Posts: 1543
  • Karma: +46/-14
    • View Profile
    • Towel 42
Can you upload your layout.xml? I can have a look to see if I can find the issue.

Sent from my SM-G950F using Tapatalk