Blynk virtuel button - music

My problem is, when is start music with a virtual button like that:

var v3 = new blynk.VirtualPin(3);
v3.on('write', function(param) {
childProcess.spawn('mpg123 ~/Music/Numb.mp3', { shell: true });
});

the song is played twice at one time.
There is a small time difference, because of that I can hear it.
Whats wrong? how can I fix that?
I also tried that with the program “sox” like that:

var v3 = new blynk.VirtualPin(3);
v3.on('write', function(param) {
  childProcess.spawn('play ~/Music/Numb.mp3', { shell: true });
});

Thanks for helping!

That is becasue you are running the same process on the button PUSH and RELEASE :wink:

You need some button state checking…

BlynkButton.on('write', function(param) {  // Watches for virtual button
  if (param == 1) {  // If Button ON
		// run
		} else if (param == 0) {  // If Button OFF
			// stop
			}
});

Ahhhh okay, I got it.
Thank you!!