volume

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 Windows Volume using C#

邮差的信 提交于 2019-11-27 07:39:47
Anyone know how to programmatically mute the Windows XP Volume using C#? Declare this for P/Invoke: private const int APPCOMMAND_VOLUME_MUTE = 0x80000; private const int WM_APPCOMMAND = 0x319; [DllImport("user32.dll")] public static extern IntPtr SendMessageW(IntPtr hWnd, int Msg, IntPtr wParam, IntPtr lParam); And then use this line to mute/unmute the sound. SendMessageW(this.Handle, WM_APPCOMMAND, this.Handle, (IntPtr) APPCOMMAND_VOLUME_MUTE); Mike de Klerk What you can use for Windows Vista/7 and probably 8 too: You can use NAudio . Download the latest version. Extract the DLLs and

How to control volume in android?

余生颓废 提交于 2019-11-27 07:07:39
问题 Android has the Hardware button for controlling volume (increase/decrease). I want to same functionality by using buttons in my application with visual volume control and it should be disappeared after some time (in sec). 回答1: You need to use the AudioManager class. Developer doc is here. Depending on which volume you want to adjust (ringer/media) you may need to change the audiomode via AudioManager . Finally, to make the buttons disappear just use View.GONE on them. I would create a

HTML5 <audio> playback with fade in and fade out

只谈情不闲聊 提交于 2019-11-27 06:49:14
I'd like to start and stop HTML5 playback in a random position with fade in and fade out periods to smooth the listening experience. What kind of mechanisms exists for this? Manually ramp up the volume with setTimeout()? The jQuery way... $audio.animate({volume: newVolume}, 1000); Edit: where $audio is a jQuery-wrapped audio element and newVolume is a double between 0 and 1. Edit: The element's effective media volume is volume, interpreted relative to the range 0.0 to 1.0, with 0.0 being silent, and 1.0 being the loudest setting, values in between increasing in loudness. The range need not be

22. docker 数据持久化 Data Volume

血红的双手。 提交于 2019-11-27 05:39:01
1 . 使用场景   在docker 容器被删除的时候 希望数据不丢失 2 . Volume 的使用   创建一个 mysql 的container   sudo docker run -d --name mysql1 -e MYSQL_ALLOW_EMPTY_PASSWORD=true mysql   sudo docker logs mysql1 查看 mysql1 的日志   查看 volume 使用情况 即可看到 mysql volume 使用情况   sudo docker volume ls      sudo docker volume rm [VOLUME NAME 上面 VOLUME 的全名]   查看 volume 详情   docker volume inspect [VOLUME NAME 上面 VOLUME 的全名]      其中 红线部分为 数据挂载的地方      创建 第二个 mysql container   sudo docker run -d --name mysql2 -e MYSQL_ALLOW_EMPTY_PASSWORD=true mysql   查看 volume 列表   sudo docker volume ls   查看 第二个 volume 详情   sudo docker volume inspect [VOLUME

Android BroadCastReceiver for volume key up and down

时光怂恿深爱的人放手 提交于 2019-11-27 04:52:27
If a user presses volume key up or down is it possible to detect it in my broadcast receiver? I need the full code. Here is my Intent filter IntentFilter filter = new IntentFilter(); filter.addAction("android.media.VOLUME_CHANGED_ACTION"); and my onReceive method is public void onReceive(Context arg0, Intent intent) { KeyEvent ke = (KeyEvent)intent.getExtras().get(Intent.EXTRA_KEY_EVENT); if (ke .getKeyCode() == KeyEvent.KEYCODE_VOLUME_UP) { System.out.println("I got volume up event"); }else if (ke .getKeyCode() == KeyEvent.KEYCODE_VOLUME_DOWN) { System.out.println("I got volume key down event

applicationMusicPlayer volume notification

馋奶兔 提交于 2019-11-27 03:40:45
I am using an applicationMusicPlayer and when i try to change the volume appear the visual notification, as shown in the picture. Here the code I am using: [MPMusicPlayerController applicationMusicPlayer] setVolume:newVolune]; Anyone knows how to hide this notification? I don't know where the docs says so, but if you add a MPVolumeView view to your app the system volume overlay goes away. Even if it is not visible: - (void) viewDidLoad { [super viewDidLoad]; MPVolumeView *volumeView = [[MPVolumeView alloc] initWithFrame: CGRectZero]; [self.view addSubview: volumeView]; [volumeView release]; ..

controlling volume in MediaPlayer

强颜欢笑 提交于 2019-11-27 03:38:03
问题 I'm playing audio (narration) in an audiobook. The audio files are in .ogg format, between 10 and 15 seconds long each. Edit to add: I'm using Android 2.2, API 8, and I have this in my Manifest: <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /> I've got setVolumeControlStream(AudioManager.STREAM_MUSIC); in my onCreate() method. My sounds are being played via code similar to this: mp = MediaPlayer.create(mContext, resource); mp.setOnCompletionListener(this); mp.seekTo

How to show Android system volume control programmatically [duplicate]

回眸只為那壹抹淺笑 提交于 2019-11-27 03:33:16
问题 This question already has an answer here : Closed 6 years ago . Possible Duplicate: How to control volume in android? How to show Android system volume control programmatically? As if the physical volume+/- button is pressed. On Android 4.x 回答1: Try setStreamVolume() method. There are a lot of options available, check this link: http://developer.android.com/reference/android/media/AudioManager.html#FLAG_SHOW_UI 来源: https://stackoverflow.com/questions/13732904/how-to-show-android-system-volume