volume

Change Volume on Mac programmatically

最后都变了- 提交于 2019-11-29 10:44:13
I'm looking for a not applescript way to change the system volume on Mac OS X programmatically. I just couldn't find a solution. Anyone any ideas? Take a look at this class: https://github.com/InerziaSoft/ISSoundAdditions It can change system volume and make use of CoreAudio API. An example of usage should look like this: [NSSound setSystemVolume:0.5] 来源: https://stackoverflow.com/questions/6278589/change-volume-on-mac-programmatically

Check volume button usage when screen is off

微笑、不失礼 提交于 2019-11-29 09:21:33
For this question I'm going to quote another user who got no response to their question: I've written an Andoid app that uses the hardware Volume buttons for another purpose. It works fine if the app is running and visible, but when I turn the screen off or let it time out, the button clicks don't get into my handlers. Does anyone know if there is a way to detect these button clicks when the screen is off? Source: AV695's question I'm working on an app myself that makes use of the volume buttons, but as this user also noted, the normal behavior of checking buttons with onKeyPress stops working

How to take a photo on the volume-up event when using UIImagePickerController with custom camera controls?

我怕爱的太早我们不能终老 提交于 2019-11-29 08:47:53
In iOS 5, the volume-up button will now take a photo in the camera app, and on a UIImagePickerController instance where .showsCameraControlls == YES . Happy days. However, when I set showsCameraControlls to NO , and supply my own (which in turn triggers takePicture method), the volume-up button will no longer work. How can I detect the volume event while the UIImagePickerController is showing? The old way to detect volume changes was like so: AudioSessionSetActive(true); [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(volumeChanged:) name:@"AVSystemController

k8s volume存储卷

那年仲夏 提交于 2019-11-29 08:37:34
volume存储卷是Pod中能够被多个容器访问的共享目录,kubernetes的volume概念,用途和目的与docker的volume比较类似,但两者不能等价,首先,kubernetes中的volume被定义在Pod上,然后被一个Pod里的多个容器挂在到具体的文件目录下;其次,kubenetes中的volume与Pod的生命周期相同,但与容器生命周期不相关,当容器终止或者重启时,volume中的数据也不会丢失,最后Volume支持多种数据类型,比如:GlusterFS,Ceph等吸纳进的分布式文件系统 volume的使用也比较简单,在大多数情况下,我们先在Pod生命一个Volume,然后在容器里引用该Volume并挂载到容器里的某个目录上,比如,我们在一个Pod中定义2个容器,一个容器运行nginx,一个容器运行busybox,然后我们在这个Pod上定义一个共享存储卷,里面的内容两个容器应该都可以看得到,如下: 以下标红的要注意,共享卷的名字要一致 [root@master ~]# cat test.yaml apiVersion: v1 kind: Service metadata: name: serivce-mynginx namespace: default spec: type: NodePort selector: app: mynginx ports: - name

Swift: how to set the iphone volume programmatically [duplicate]

徘徊边缘 提交于 2019-11-29 04:21:26
This question already has an answer here: How to change device Volume on iOS - not music volume 8 answers How to change an iOS device volume programmatically? 4 answers I am trying to create an alarm app and I have noticed that apps like Sleep Cycle will set your volume to max right before the alarm goes off, even if you had the volume at very low. I have tried using AVAudioPlayer and all I have seen with MPVolumeView is that the user must do it. Is there any way I can turn it up without the user having to do it? Thank you for your help. If I could please get the code in swift You just need to

Change the volume of a wav file in python

﹥>﹥吖頭↗ 提交于 2019-11-29 03:46:42
问题 I have a 2 seconds 16bit single channel 8khz wav file and I need to change its volume. It should be quite straightforward, because changing the volume is the same as changing the amplitude of the signal, and I just need to attenuate it, that is to multiply it for a number between 0 and 1. But it doesn't work: the new sound is lower but VERY full of noise. What am I doing wrong? Here is my code: import wave, numpy, struct # Open w = wave.open("input.wav","rb") p = w.getparams() f = p[3] #

kubernetes pod解析

旧街凉风 提交于 2019-11-29 03:05:36
pod 是kubernetes中可以创建的最小部署单元。 什么是pod: 尽管kubernetes支持多种容器运行时,但是Docker依然是最常用的运行时环境,我们可以使用Docker的术语和规则来定义Pod。 Pod中共享的环境包括Linux的namespace,cgroup和其他可能的隔绝环境,这一点跟Docker容器一致。在Pod的环境中,每个容器中可能还有更小的子隔离环境。 Pod中的容器共享IP地址和端口号,它们之间可以通过 localhost 互相发现。它们之间可以通过进程间通信,例如 SystemV 信号或者POSIX共享内存。不同Pod之间的容器具有不同的IP地址,不能直接通过IPC通信。 Pod中的容器也有访问共享volume的权限,这些volume会被定义成pod的一部分并挂载到应用容器的文件系统中。 根据Docker的结构,Pod中的容器共享namespace和volume,不支持共享PID的namespace。 就像每个应用容器,pod被认为是临时(非持久的)实体。在Pod的生命周期中讨论过,pod被创建后,被分配一个唯一的ID(UID),调度到节点上,并一致维持期望的状态直到被终结(根据重启策略)或者被删除。如果node死掉了,分配到了这个node上的pod,在经过一个超时时间后会被重新调度到其他node节点上。一个给定的pod(如UID定义的)不会被

Where is kube-apiserver located

匆匆过客 提交于 2019-11-29 02:48:38
问题 Base question: When I try to use kube-apiserver on my master node, I get command not found error. How I can install/configure kube-apiserver? Any link to example will help. $ kube-apiserver --enable-admission-plugins DefaultStorageClass -bash: kube-apiserver: command not found Details: I am new to Kubernetes and Docker and was trying to create StatefulSet with volumeClaimTemplates. My problem is that the automatic PVs are not created and I get this message in the PVC log: "persistentvolume

Audio Processing: Playing with volume level

ⅰ亾dé卋堺 提交于 2019-11-29 01:42:26
问题 I want to read a sound file from application bundle, copy it, play with its maximum volume level(Gain value or peak power, I'm not sure about the technical name of it), and then write it as another file to the bundle again. I did the copying and writing part. Resulting file is identical to input file. I use AudioFileReadBytes() and AudioFileWriteBytes() functions of AudioFile services in AudioToolbox framework to do that. So, I have the input file's bytes and also its audio data format(via

Android: Detect Do Not Disturb status?

可紊 提交于 2019-11-29 00:43:21
问题 I was just wondering if there's a way to check if an Android device (21+) is in Do Not Disturb mode? I know there's AudioManager.RINGER_MODE_SILENT , but I was wondering if that pertains to this situation, or if there's a better way to check? 回答1: I'm bringing the necro with this post, but was just searching for a solution to the same problem and came past this post as I did, so am leaving a solution for future ref. I couldn't find an "official" way to do this, but did find a value that can