Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Stop currently playing sound

If you have a question or need help, this is the place to be.
Post Reply
skribb
Experienced User
Posts: 228
Joined: Thu Feb 12, 2015 7:22 pm
Location: Win7 64bit

Stop currently playing sound

Post by skribb »

Is there a way to Stop currently playing sound within EG? thanks :D
Automation is life.

Win7 64bit
EG: v0.5.0-rc4
blaher
Experienced User
Posts: 487
Joined: Thu Nov 17, 2011 1:27 am

Re: Stop currently playing sound

Post by blaher »

From what source?
skribb
Experienced User
Posts: 228
Joined: Thu Feb 12, 2015 7:22 pm
Location: Win7 64bit

Re: Stop currently playing sound

Post by skribb »

blaher wrote:From what source?
eventghost:
system > sound card > play sound
Automation is life.

Win7 64bit
EG: v0.5.0-rc4
blaher
Experienced User
Posts: 487
Joined: Thu Nov 17, 2011 1:27 am

Re: Stop currently playing sound

Post by blaher »

You could press mute using the same part of EventGhost, but I'm not sure how to abort it there. You could always use another external program that can be controlled like winamp, or foobar, and stop it instead.
skribb
Experienced User
Posts: 228
Joined: Thu Feb 12, 2015 7:22 pm
Location: Win7 64bit

Re: Stop currently playing sound

Post by skribb »

blaher wrote:You could press mute using the same part of EventGhost, but I'm not sure how to abort it there. You could always use another external program that can be controlled like winamp, or foobar, and stop it instead.
Well I have tried with AutoHotkey which would be the most ideal solution but I can't make sound work there for some reason. i don't fancy the idea of having to open a program with a UI just to play a sound file. :cry:
Automation is life.

Win7 64bit
EG: v0.5.0-rc4
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Stop currently playing sound

Post by Pako »

I suggest you use CrystalWolf Audio Player. This is a very small, but very good audio player.
StopSound.png
StopSound.png (7.9 KiB) Viewed 3462 times
Remarks :
  • The path to the file to be played can be specified as Command line options:. It can be also "{eg.event.payload}" (including the quotation marks !).
  • In the combo box you can select Window options: Minimized, so it can be invisible.
Pako
You know flattr ? You can Image
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Stop currently playing sound

Post by Pako »

skribb wrote:i don't fancy the idea of having to open a program with a UI just to play a sound file. :cry:
If it is a big problem, you can use (for example) command line player DLC.
StopSoundDLC.png
StopSoundDLC.png (5.05 KiB) Viewed 3456 times
Note:
Command line options may be, for example -w "{eg.event.payload}" (including the quotation marks !).
Contents of Python Script:

Code: Select all

from win32com.client import GetObject
from win32api import OpenProcess, TerminateProcess, CloseHandle
PROCESS_TERMINATE = 1
WMI = GetObject('winmgmts:')
processes = WMI.InstancesOf('Win32_Process')
p = WMI.ExecQuery('select * from Win32_Process where Name="dlc.exe"')
pid = p[0].Properties_('ProcessId').Value

handle = OpenProcess(PROCESS_TERMINATE, False, pid)
TerminateProcess(handle, -1)
CloseHandle(handle)
Pako
You know flattr ? You can Image
skribb
Experienced User
Posts: 228
Joined: Thu Feb 12, 2015 7:22 pm
Location: Win7 64bit

Re: Stop currently playing sound

Post by skribb »

Thank you for the tips
Automation is life.

Win7 64bit
EG: v0.5.0-rc4
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Stop currently playing sound

Post by Pako »

skribb wrote:Thank you for the tips
This is obviously intended for all users who will solve a similar problem.
It would be nice if you posted your final solution.

Pako
You know flattr ? You can Image
skribb
Experienced User
Posts: 228
Joined: Thu Feb 12, 2015 7:22 pm
Location: Win7 64bit

Re: Stop currently playing sound

Post by skribb »

Pako wrote:
skribb wrote:Thank you for the tips
This is obviously intended for all users who will solve a similar problem.
It would be nice if you posted your final solution.

Pako
I like the way you think.

Concerning my solution, I always have like 100 projects simultaneously, so I probably won't get thru with this for several months :P My automation setup is growing all the time, so much to keep track of :roll:
Automation is life.

Win7 64bit
EG: v0.5.0-rc4
Post Reply