How to mute the sound of a Delphi Chromium Embedded (TChromium) component?

久未见 提交于 2019-12-05 21:13:42

问题


I need to mute the sound of a TChromium component to make a silent browser. The main problem is on Windows XP where when I mute the sound of a browser, it mute the overall system sound.

Is there a way how to mute the sound of a TChromium component ?


回答1:


I have succeeded with the following code:

procedure CustomCommandLine (const processType: ustring; const commandLine: ICefCommandLine);
begin
    commandLine.AppendSwitch('--mute-audio');
end;    


begin
    CefOnBeforeCommandLineProcessing := CustomCommandLine;

    Application.Initialize;
    Application.CreateForm(TMainForm, MainForm);
    Application.Run;
end.

Other parameters: Examples




回答2:


Windows XP doesn't allow to mute only one application in particular.
Check this discussion here:
http://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/0b4d2919-1b48-4f55-8120-cedd22bea0c5/how-to-programmatically-mute-volume-of-selected-app-in-volume-mixer-windows-7?forum=windowspro-audiodevelopment
There's this software (didn't try it): http://www.indievolume.com/ to allow that kind of procedure, but this isn't the best choice.
Can't you just process the HTML and ignore the audio tags ?!
I've been looking at the TChromium source and also didn't found anything related to audio :(



来源:https://stackoverflow.com/questions/14514606/how-to-mute-the-sound-of-a-delphi-chromium-embedded-tchromium-component

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!