volume

Get Master Sound Volume in c#

眉间皱痕 提交于 2019-11-26 08:19:34
问题 I need to get the current volume of the output to the sound card. Any ideas how? 回答1: You can get at these values using IAudioMeterInformation in the CoreAudio APIs in Vista and Win 7. Managed wrappers are available in NAudio (get at the AudioMeterInformation from the MMDevice). 回答2: static int PlayerVolume() { RecordPlayer rp = new RecordPlayer(); rp.PlayerID = -1; int playerVolume = rp.PlayerVolume; return playerVolume; } from modified Microphone Volume in c# article 回答3: Look in MSDN

Is there a broadcast action for volume changes?

心已入冬 提交于 2019-11-26 06:41:55
I'm programming a small widget that needs to be updated whenever the user changes the ringer volume or the vibrate settings. Capturing android.media.VIBRATE_SETTING_CHANGED works just fine for the vibrate settings, but I haven't found any way of getting notified when the ringer volume changes and although I could try to capture when the user presses the volume up/volume down physical keys, there are many other options for changing the volume without using these keys. Do you know if there's any broadcast action defined for this or any way to create one or to solve the problem without it? Nathan

How to get audio volume level, and volume changed notifications on iOS?

北城以北 提交于 2019-11-26 06:17:46
问题 I\'m writing a very simple application that plays a sound when pressing a button. Since that button does not make a lot of sense when the device is set to silence I want to disable it when the device\'s audio volume is zero. (And subsequently reenable it when the volume is cranked up again.) I am seeking a working (and AppStore safe) way to detect the current volume setting and get a notification/callback when the volume level changes. I do not want to alter the volume setting. All this is

Changing master volume level

╄→尐↘猪︶ㄣ 提交于 2019-11-26 06:03:15
问题 How can I change the master volume level? Using this code [DllImport (\"winmm.dll\")] public static extern int waveOutSetVolume (IntPtr hwo, uint dwVolume); waveOutSetVolume (IntPtr.Zero, (((uint)uint.MaxValue & 0x0000ffff) | ((uint)uint.MaxValue << 16))); I can set the wave volume but if the master volume is too low this won\'t have any effect. Thanks for any help. 回答1: Okay, here goes: const int MAXPNAMELEN = 32; const int MIXER_SHORT_NAME_CHARS = 16; const int MIXER_LONG_NAME_CHARS = 64;

Cleanest way of capturing volume up/down button press on iOS 8

隐身守侯 提交于 2019-11-26 05:34:10
问题 What\'s the best/cleanest way of capturing volume up/down button presses on iOS 8 ? Ideally I\'d like to capture the keypress and also prevent the system volume from changing (or at the very least, prevent the volume change HUD from showing). There are some old answers going around which use deprecated methods and don\'t seem to work at all on iOS 8. This iOS 8 specific one didn\'t work either. This RBVolumeButtons open source class doesn\'t seem to work on iOS 8 either. 回答1: For Swift you

Using SeekBar to Control Volume in android?

那年仲夏 提交于 2019-11-26 05:22:25
问题 How can I accurately change the volume of my app using a seekbar without controlling the volume by the volume buttons on my android device? I have seperate function on the Volume keys on my android that\'s why I want to use a seekbar to control the volume. Can Anyone please help me? 回答1: Please look at below code . It solves your problem. import android.app.Activity; import android.content.Context; import android.media.AudioManager; import android.os.Bundle; import android.widget.SeekBar;

iOS 7: MPMusicPlayerController volume deprecated. How to change device volume now?

若如初见. 提交于 2019-11-26 04:39:11
问题 MPMusicPlayerController setVolume is deprecated since iOS 7 Is there any other way to change system music volume? Preferably without user interaction. Its important feature: to increase volume automatically for any alarm clock from AppStore. 回答1: To answer you question exactly: Yes there is other way to change system volume without user interaction. Until recent times I used to think that changing volume using MPVolumeView programmatically is possible only using private API . But I have just

Android: MediaPlayer setVolume function

China☆狼群 提交于 2019-11-26 04:38:49
问题 about the params Set what to make the player no sound and full sound Thanks 回答1: This function is actualy wonderful. Thanks to it you can create a volume scale with any number of steps! Let's assume you want 50 steps: int maxVolume = 50; Then to set setVolume to any value in this range (0-49) you do this: float log1=(float)(Math.log(maxVolume-currVolume)/Math.log(maxVolume)); yourMediaPlayer.setVolume(log1,log1); //set volume takes two paramater Nice and easy! And DON'T use AudioManager to

How to calculate the volume of a 3D mesh object the surface of which is made up triangles

谁都会走 提交于 2019-11-26 03:33:17
问题 I want to calculate the volume of a 3D mesh object having a surface made up triangles. 回答1: Reading this paper, it is actually a pretty simple calculation. The trick is to calculate the signed volume of a tetrahedron - based on your triangle and topped off at the origin. The sign of the volume comes from whether your triangle is pointing in the direction of the origin. (The normal of the triangle is itself dependent upon the order of your vertices, which is why you don't see it explicitly

Is there a broadcast action for volume changes?

╄→гoц情女王★ 提交于 2019-11-26 01:57:33
问题 I\'m programming a small widget that needs to be updated whenever the user changes the ringer volume or the vibrate settings. Capturing android.media.VIBRATE_SETTING_CHANGED works just fine for the vibrate settings, but I haven\'t found any way of getting notified when the ringer volume changes and although I could try to capture when the user presses the volume up/volume down physical keys, there are many other options for changing the volume without using these keys. Do you know if there\'s