mute

How to mute and unmute it on the onPause and onResume

核能气质少年 提交于 2019-11-28 09:51:25
问题 I'm having a problem when I set the audio to Mute on the onPause() and in the onResume() I try to unmute it but without success. Code: protected void onPause() { super.onPause(); Log.d(TAG, "onPause"); setStreamMute(true); } protected void onResume() { super.onResume(); Log.d(TAG, "onResume"); setStreamMute(false); } public void setStreamMute (boolean state){ Log.d(TAG,"SetMute: "+state); myAudioManager = (AudioManager)getSystemService(Context.AUDIO_SERVICE); myAudioManager.setStreamMute

How to control Windows system volume using JScript or VBScript?

强颜欢笑 提交于 2019-11-28 08:40:47
I want to control the volume of my Windows system from a JScript or VBScript script. Any ideas? Also, can I unmute the system volume if it is muted? Helen To mute or unmute the system volume, you can simulate the Mute key press using the WshShell.SendKeys method: var oShell = new ActiveXObject("WScript.Shell"); oShell.SendKeys(Chr(&HAD)); As for changing the volume level from a script, there's a solution that involves some Windows automation, such as launching the System Volume applet and simulating the appropriate keyboard shortcuts in it, but I don't think it's reliable. Therefore I

How to mute/unmute audio when playing video using MPMoviePlayerController?

孤街浪徒 提交于 2019-11-27 20:16:55
I've created my own custom controls for use with the MPMoviePlayerController . So far everything works except the mute button control. I've configured the AVAudioSession using the following code before I create my instance of the MPMoviePlayerController . NSError *modeError = nil; [self.audioSession setMode:AVAudioSessionModeMoviePlayback error:&modeError]; if (modeError != nil) { NSLog(@"Error setting mode for AVAudioSession: %@", modeError); } NSError *categoryError = nil; [self.audioSession setCategory:AVAudioSessionCategoryPlayback error:&categoryError]; if (categoryError != nil) { NSLog(@

Android mute/unmute phone

我只是一个虾纸丫 提交于 2019-11-27 19:24:39
My goal is to support 2 operations: mute phone (possibly with vibrations enabled/disabled), so when a call or sms is received it won't make noise unmute phone and restore the volume to the state before muting phone How can I do this? What permissions are required in AndroidManifest? This is the permission for vibrate into the manifest file <uses-permission android:name="android.permission.VIBRATE" /> this is for to put the device in silent mode with vibrate AudioManager audioManager = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE); audioManager.setRingerMode(AudioManager.RINGER

Video mute/unmute with jQuery

故事扮演 提交于 2019-11-27 17:22:47
问题 I'd like to make a mute/unmute button in jQuery. I've done some searching on Stackoverflow and this is what I managed to do so far: $("video").prop('muted', true); $("#mute-video").click( function (){ if( $("video").prop('muted', true) ) { $("video").prop('muted', false); } else { $("video").prop('muted', true); } }); but for some reason it's only able to unmute, not to mute back. Any idea what's wrong with the code? 回答1: When you're doing if( $("video").prop('muted', true) ) you're both

Audio Player play in background and should work based off of hardware mute switch

丶灬走出姿态 提交于 2019-11-27 14:07:44
问题 I want to play audio file in the foreground, background and it should work with mute switch i.e. if mute switch is on, then it should not play, if mute switch is off should play audio. **I'm developing an SIP call application. App should play sound/ringtone when user receives a call. It should play if app is in background/foreground, it should mute/unmute if hardware mute switch is ON/OFF. For this I used AVPlyaer with below code. AVAudioSession *session = [AVAudioSession sharedInstance];

Muting an embedded vimeo video

若如初见. 提交于 2019-11-27 12:53:31
问题 On a website I am building I have a vimeo video embedded. The client needs to keep the sound on the video obviously for people that find it on vimeo. However for her website the sound is just plain annoying. So I need to find a way to mute the audio within the code for the embed. I have googled it but can't seem to find anything legible. As you can see from my code below, I have used the autoplay command within the link I was hoping I could do a similar thing to mute the sound. <iframe src=

Mute/Silence an iOS device programmatically?

六眼飞鱼酱① 提交于 2019-11-27 09:20:46
I'm trying to mute the device's ringer from within my app, but for some reason using AVSystemController like in this answer ( How to disable iOS System Sounds ) won't let me silence the device ALL the way down.. it drops it to a volume of 1 bar, but not completely silent. I know it can be done, probably with a private API like AVSystemController, and I know that Apple will still approve the app if the user expects this kind of functionality from the app (since there are already 2 apps I found in the App Store which mutes the device programmatically with no need of jailbreaking or anything like

How can I mute/unmute my sound from PowerShell

半腔热情 提交于 2019-11-27 08:04:05
Trying to write a PowerShell cmdlet that will mute the sound at start, unless already muted, and un-mute it at the end (only if it wasn't muted to begin with). Couldn't find any PoweShell or WMI object I could use. I was toying with using Win32 functions like auxGetVolume or auxSetVolume , but couldn't quite get it to work (how to read the values from an IntPtr?). I'm using V2 CTP2. Any ideas folks? Thanks! There does not seem to be a quick and easy way to adjust the volume.. If you have c++ experience, you could do something with this blog post , where Larry Osterman describes how to call the

mute and unmute button toggle html5 audio

▼魔方 西西 提交于 2019-11-27 07:17:09
问题 I've understood how to mute an <audio> sound object by putting this code : <a href="#" onclick="document.getElementById('ambiance').muted = true; return false"> mute sound </a> Now I'm searching how to mute/unmute my sound using the same button with the option to toggle it ? Can anyone give me directions? 回答1: var audioElm = document.getElementById('ambiance'); audioElm.muted = !audioElm.muted; 回答2: Try this: .unmute { background-image: url(http://franriavilla.in/images/unmute.png);