问题标签 [volume]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
iphone - 使用 UIslider Iphone 控制音量?
我正在创建一个应用程序,其中按下按钮时播放声音并使用可以调节音量的 UISlider。有时声音的音量太高,有时甚至在将 iphone 的音量增加到最大之后也太低。我怎样才能将音量保持在高位?将系统音量与滑块音量集成在一起的任何可能方式?我猜使用 MPVolumview 会拒绝我的应用程序。我在按钮触摸上使用的代码是这样的
}
iphone - iPhone OS4,无法使用 SystemSounds 调整音量设置
我正在使用 SystemSound 的框架在我的应用程序中播放声音。对于带有 IOS3 的设备,它可以正常工作。但是最近我将操作系统更新到了 IOS4,但我遇到了一个奇怪的音量问题。现在我无法在游戏过程中改变声音的音量,似乎这个框架正在使用铃声音量,我无法在应用程序中改变这个音量。我对此有几个问题。
- 这是预期的行为还是我的代码可能有问题?
- 首先,为什么 IOS4 设备会发生这种情况,而不是早期版本。
- 是否有任何解决方法可以在不必使用其他框架的情况下修复它?
我正在使用的代码是这样的:
我将衷心感谢您的帮助!
谢谢,
胡安·巴勃罗
macos - 如何从 Core-Audio 中的输入设备获取音量数据?
我正在尝试使用 Core-Audio 获取输入设备听到的音频音量。
到目前为止,我已经使用AudioDeviceAddIOProc
andAudioDeviceStart
和我的函数以包含sAudioDeviceIOProc
的形式获取输入数据。AudioBufferList
AudioBuffer
如何从 中获取数据量AudioBuffer
?或者我会以完全错误的方式解决这个问题?
delphi - vista/xp中如何调整主音量
我想以编程方式调整音量,如 vista 和 xp 中的 Get/SetMasterVolume?使用 mmsystem 单元?
macos - 如何在 Mac OS X 上使用可可更改卷名
我正在尝试更改闪存 (USB) 驱动器上的卷名称。我尝试了不同的方法:
- 磁盘仲裁框架
- 只需使用 NSFileManager 重命名
提前致谢, 弗拉基米尔
android - Android 通知和铃声音量,一个问题
Android手机有一个设置,允许您强制通知音量与铃声音量相匹配,我似乎在SDK中的任何地方都找不到该设置,有人可以帮我找出如何获取和设置该特定设置吗?
iphone - Volume control in MPMoviePlayerController
I am trying to figure out how to adjust the volume of a movie played with MPMoviePlayerController on the iPhone without using the slider or the volume buttons on the side of the phone. Is it even possible to do this with code in a Apple approved way? I haven't been able to find anything in the APIs that relate to changing or setting the volume during movie playback.
I know a similar question was asked a little over a year ago (Is there a way to adjust volume in MPMoviePlayer Controller by program?), but I wanted to know if anyone had found a way to change the volume in MPMoviePlayerController since then.
android - 触发系统音量条
是否可以通过按我的按钮Activity
使音量条出现?音量条是您按下任一硬件音量按钮时出现的视图。
是否有 API 函数可以执行此操作,还是我必须手动重新创建该视图?
c++ - 如何比较 2 卷并列出修改后的文件?
我有 2 个硬盘卷(一个是另一个的备份映像),我想比较这些卷并列出所有修改过的文件,以便用户可以选择他/她想要回滚的那些。
目前我正在遍历新卷并将每个文件的时间戳与旧卷的文件进行比较(如果它们在旧卷中)。显然,这是一种错误的做法。这既耗时又错误!
有没有一种有效的方法来做到这一点?
编辑:
- 我正在使用 FindFirstFile 并且喜欢递归卷,并收集每个文件的信息(不是很慢,只需几分钟)。
- 我正在使用卷影复制进行备份。
- 备份卷是远程的,所以我无法持续监控实际卷。
ios - How to get audio volume level, and volume changed notifications on iOS?
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 implemented in my ViewController
where said button is used. I've tested this with an iPhone 4 running iOS 4.0.1 and 4.0.2 as well as an iPhone 3G running 4.0.1. Built with iOS SDK 4.0.2 with llvm 1.5. (Using gcc or llvm-gcc doesn't improve anything.) There are no issues during build implementing either way, neither errors nor warnings. Static analyzer is happy as well.
Here is what I've tried so far, all without any success.
Following Apple's audio services documentation I should register an AudioSessionAddPropertyListener
for kAudioSessionProperty_CurrentHardwareOutputVolume
which should work like this:
returnvalue
is 0
, which means that registering the callback worked.
Sadly, I never get a callback to my function audioVolumeChangeListenerCallback
when I press the volume buttons on my device, the headset clicker or flip the ringer-silent switch.
When using the exact same code for registering for kAudioSessionProperty_AudioRouteChange
(which is used as an analogous sample project in WWDC videos, Developer documentation and on numerous sites on the interwebs) I actually do get a callback when changing the audio route (by plugging in/out a headset or docking the device).
A user named Doug opened a thread titled iPhone volume changed event for volume already max where he claimed that he is sucessfully using this way (unless the volume would not actually change because it is already set to maximum). Still, it doesn't work for me.
Another way I have tried is to register at NSNotificationCenter
like this.
This should notify my method volumeChanged
of any SystemVolume
changes but it doesn't actually do so.
Since common belief tells me that if one is working too hard to achieve something with Cocoa one is doing something fundamentally wrong I'm expecting to miss something here. It's hard to believe that there is no simple way to get the current volume level, yet I haven't been able to find one using Apple's documentation, sample code, Google, Apple Developer Forums or by watching WWDC 2010 videos.