mute

Android: How to get app to remember if mute button has been pressed or not

南楼画角 提交于 2019-12-02 10:23:06
I have successfully created a button that mute my button press sound if wanted. The problem I am having is that when I leave the page or close the app and return sound a returned to the default of being on. I am trying to achieve this through preferences but it is not working. I have used preferences before to successfully store high scores but I can get it to work this time as I intend. Here is my sound code: import java.io.IOException; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.content

How to mute an iframe?

与世无争的帅哥 提交于 2019-12-01 03:20:31
I need to mute an iframe, but I don't know how to do it. Here is an example of what I have: http://www.codecademy.com/en/bitAce74593/codebits/nW7U9b Here you can hear the music from the website on the iframe, I need to automatically mute that audio. Hope that someone knows how to do it. Thanks you can mute it by js, example: just put this in your page: <script type="text/javascript"> myVid=document.getElementById("video1"); myVid.muted=true; </script> you should replace "video1" by the id of your iframe, if the iframe don't have any id add an id to it as follow: <iframe width="820" height="390

Mute audio tracks of live streams using AVPlayer

北战南征 提交于 2019-11-30 22:16:30
I am using AVPlayer to play live stream (m3U8 file). It plays perfectly using AVPlayer but I am not able to mute it. I am using following code to mute the audio. NSMutableArray *allAudioParams = [NSMutableArray array]; for (AVPlayerItemTrack *track in _player.currentItem.tracks) { if ([track.assetTrack.mediaType isEqual:AVMediaTypeAudio]) { AVMutableAudioMixInputParameters *audioInputParams = [AVMutableAudioMixInputParameters audioMixInputParameters]; [audioInputParams setVolume:0.0 atTime:kCMTimeZero]; [audioInputParams setTrackID:[track.assetTrack trackID]]; [allAudioParams addObject

A way to mute an iframe using jQuery or CSS?

匆匆过客 提交于 2019-11-30 21:54:00
Is there a way to mute the audio of an iframe using jQuery or CSS? This is the iframe I need to mute <iframe src="http://player.vimeo.com/video/4415083?api=1;title=0&byline=0&portrait=0&color=d01e2f&autoplay=1" width="500" height="281" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe> Include this library in your page: https://github.com/vimeo/player-api/tree/master/javascript like this <script src="//f.vimeocdn.com/js/froogaloop2.min.js"></script> This code will send an API call to vimeo player to set the volume to 0 once the player is ready, based on http:/

How to mute microphone in Windows 7 with C/C++?

白昼怎懂夜的黑 提交于 2019-11-30 14:20:58
问题 I made a program to mute microphone using WinAPI and it seems to work perfectly in Windows XP but doesn't do a thing in Windows 7. Is it possible to control microphone volume or mute with WinAPI in Windows 7? void setVolume(DWORD volume) { HMIXER mixer; if (mixerOpen(&mixer, 0, 0, 0, 0) != MMSYSERR_NOERROR) { MessageBoxW(NULL, L"Error: mixerOpen()", NULL, MB_ICONHAND); return; } // Get the line info MIXERCAPS mixcaps; MIXERLINE mixerLine; mixerGetDevCaps(0, &mixcaps, sizeof(MIXERCAPS));

How to mute microphone in Windows 7 with C/C++?

混江龙づ霸主 提交于 2019-11-30 10:24:20
I made a program to mute microphone using WinAPI and it seems to work perfectly in Windows XP but doesn't do a thing in Windows 7. Is it possible to control microphone volume or mute with WinAPI in Windows 7? void setVolume(DWORD volume) { HMIXER mixer; if (mixerOpen(&mixer, 0, 0, 0, 0) != MMSYSERR_NOERROR) { MessageBoxW(NULL, L"Error: mixerOpen()", NULL, MB_ICONHAND); return; } // Get the line info MIXERCAPS mixcaps; MIXERLINE mixerLine; mixerGetDevCaps(0, &mixcaps, sizeof(MIXERCAPS)); mixerLine.cbStruct = sizeof(MIXERLINE); mixerLine.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_WAVEIN;

How to create a mute option

感情迁移 提交于 2019-11-30 09:58:57
How do I create a function that toggles mute for the whole java application? Actually all the sound comes from an external applet I load in the application. The code for loading the applet is here: https://github.com/Tyilo/RS2Lite/blob/master/src/com/rs2lite/loader/GameAppletLoader.java There is the Port which gives you access to the computer's mixer, but muting sound there would mute all sound of the computer. So that's probably not a good option. Other than that, I believe that you require the class instance of the Clip or SourceDataLine that currently plays. Most probably, however, the

Detecting iPhone mute switch in iOS 5

痞子三分冷 提交于 2019-11-29 14:50:51
问题 I know that Apple does not provide a way to detect the state of the iPhone mute/silence switch in iOS 5 . However, I have I tried a technique mentioned elsewhere to detect this by playing an audio file and measuring its runtime. However, even though my iPhone was muted, the audio file still played the entire duration. I'm using [AVAudioPlayer play] and computing the time before audioPlayerDidFinishPlaying is called. Do you know of a trick to play an audio file, which will complete early

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

北战南征 提交于 2019-11-28 21:54:24
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]; [session setCategory:AVAudioSessionCategoryPlayback error:&error]; [session setActive:YES error:nil];

Muting an embedded vimeo video

你。 提交于 2019-11-28 20:23:12
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="http://player.vimeo.com/video/4415083? title=0&byline=0&portrait=0&color=d01e2f&autoplay=1" width="500"