3

Hey so I was using Spotify yesterday and I noticed while an ad was playing that any time I mute my volume or drop the volume to zero, spotify pauses the ad and doesn't resume until you turn the volume back up. I started thinking about that and got curious, how exactly does that work? Could I theoretically make a java program that prints "false" every time I hit the mute button on my laptop? What are the topics to look up if I was interested in learning more about this? Would this have to do with assembly at all?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
  • Yes that is possible I did that allready in C# but I have no idea how that could work in Java. If I remember correctly the trick was to hook the keyboard events. – rekire Dec 01 '12 at 14:11
  • Perhaps it checks the system volume periodically. – John Dvorak Dec 01 '12 at 14:11
  • Hmm. This is interesting. :) – tckmn Dec 01 '12 at 14:14
  • 2
    Spotify pauses the ad whenever the volume hits 0. I don't think they detect presses to 'mute', but rather monitor the mixer. – Laurent Perrin Dec 01 '12 at 14:27
  • I am interested by your code, and I would like to collaborate on the little sample/snippet, can you please create a github ... –  Dec 01 '12 at 14:28

1 Answers1

0

I've never done something like that, but after a quick research on the web, I guess it can be achieved via the The AudioSystem Class. You can find a tutorial here.

Luigi Massa Gallerano
  • 2,347
  • 4
  • 23
  • 25