volume

How do you set the hardware volume in an iPhone app?

扶醉桌前 提交于 2019-11-28 23:25:46
问题 Some iPhone applications, such as Pandora seem to directly manipulate the hardware volume and respond to physical volume button. How is this done? AudioSessionServices allows you to get the current hardware output volume with the kAudioSessionProperty_CurrentHardwareOutputVolume property, but it is (allegedly) read-only. 回答1: They use the MPVolumeView, simple add it and it's makes the rest when the user touch it. Note: Doesn't work in iPhone Simulator. I think the release note also mentioned

IOS WebAudio only works on headphones

淺唱寂寞╮ 提交于 2019-11-28 22:08:57
I've been running into an issue now for a while where on some ios devices my webaudio system only seems to work with headphones where as other devices (exact same os, model, etc) the audio plays perfectly fine through the speakers or headphones. I've searched for a solution to this but haven't found anything on this exact issue. The only thing I can think of is that maybe it's an audio channel issue or something. I'm stumped. Have any of you ran into this issue and or have any recommendations for fixing it? Thanks! This is likely because the iPhone's side switch is on "mute". It's very

GlusterFs卷类型分析及创建、使用(结合kubernetes集群分析)

纵然是瞬间 提交于 2019-11-28 22:05:18
引言 本文通过对卷类型的分析对比,来帮助读者选取生产环境最符合服务的挂载存储,命令可结合《 glusterfs详解及kubernetes 搭建heketi-glusterfs 》进行实验,下面进入正题 几种卷类型 基础卷:布式卷(distribute)、条带卷(stripe)、复制卷(replica)、纠错卷(Dispersed ) 复合卷:分布式条带卷(distribute stripe)、分布式复制卷(distribute replica)、条带复制卷(stripe replica)、分布式条带复制卷(distribute stripe) 一、基础卷 以下创建挂载卷,均可通过以下命令进行查看、启用、停止、删除 #查看已创建挂载卷 gluster volume info #启动挂载卷 gluster volume start gv0 #删除前,先停止挂载卷 gluster volume stop gv0 #删除挂载卷 gluster volume delete gv0 1. 布式卷(distribute voulme) 分布式模式,既DHT,是GlusterFS的默认模式,在创建卷时,默认选项是创建分布式卷。在该模式下,并没有对文件进行分块处理,而是通过hash算法分布到所有brick server上,只是扩大了磁盘空间,类似window中的跨区卷 distribute

glusterfs详解及kubernetes 搭建heketi-glusterfs

蹲街弑〆低调 提交于 2019-11-28 20:10:00
本文包含: gluster各存储卷详解、创建及使用 gluster-kubernetes搭建glusterfs存储 前言 传统的运维中,往往需要管理员手动先在存储集群分配空间,然后才能挂载到应用中去。Kubernetes 的最新版中,dynamic provisioning 升级到了 beta ,并支持多种存储服务的动态预配置,从而可以更有效地利用存储环境中的存储容量,达到按需使用存储空间的目的。本文将介绍 dynamic provisioning 这一特性,并以 GlusterFS 为例,说明存储服务与 k8s 的对接。 简介               ⚠️熟悉的小伙伴直接跳过啦 dynamic provisioning:  存储是容器编排中非常重要的一部分。Kubernetes 从 v1.2 开始,提供了 dynamic provisioning 这一强大的特性,可以给集群提供按需分配的存储,并能支持包括 AWS-EBS、GCE-PD、Cinder-Openstack、Ceph、GlusterFS 等多种云存储。非官方支持的存储也可以通过编写 plugin 方式支持。   在没有 dynamic provisioning 时,容器为了使用 Volume,需要预先在存储端分配好,这个过程往往是管理员手动的。在引入 dynamic provisioning 之后

How do I reproduce this heart-shaped mesh in MATLAB?

爱⌒轻易说出口 提交于 2019-11-28 17:18:54
I want to plot a heart shape wireframe as shown in the following image ( source ): I have tried to make it by using this MATLAB program: n=100; x=linspace(-3,3,n); y=linspace(-3,3,n); z=linspace(-3,3,n); [X,Y,Z]=ndgrid(x,y,z); F=((-(X.^2) .* (Z.^3) -(9/80).*(Y.^2).*(Z.^3)) + ((X.^2) + (9/4).* (Y.^2) + (Z.^2)-1).^3); isosurface(F,0) lighting phong caxis axis equal colormap('flag'); view([55 34]); But I didn't get the desired shape of framework as shown in the figure. I have identified the problem: to create a wireframe we usually use the command mesh() . But this plotting facility only allow us

十三、LVM 逻辑卷管理

大城市里の小女人 提交于 2019-11-28 16:11:17
http://note.youdao.com/noteshare?id=0252cd5dcf7f2e5f11de5b3672779201&sub=ED011464ADA3467D94242717C8996048 LVM2 逻辑卷管理器第二版,Logical Volume Manager Version 2,   dm:device mapper 将一个或多个底层块设备组织成一个逻辑设备的模块。   创建后逻辑卷的路径(lvpath) 原始路径:/dev/dm-# 其链接文件有: 1)/dev/mapper/VGNAME-LVNAME 2)/dev/VGNAME/LVNAME   1、纯软件实现的虚拟层次上的软设备lvm2   2、磁盘损坏时,数据恢复困难。人为损坏数据,恢复困难。 一、基础概念 LVM是 Logical Volume Manager(逻辑卷管理)的简写,它是Linux环境下对磁盘分区进行管理的一种机制。 是一种将一个或多个硬盘的分区在逻辑上集合,相当于一个大硬盘来使用,当硬盘的空间不够使用的时候,可以继续将其它的硬盘的 分区加入其中,这样可以实现一种磁盘空间的动态管理,相对于普通的磁盘分区有很大的灵活性。LVM还能通过快照在备份的过程中保证日志文件和表空间文件在同一时间点的一致性。 PE(Physical Extend):卷的最小单位,可配置,默认4M大小

AVAudioPlayer fade volume out

孤街醉人 提交于 2019-11-28 15:21:15
I have an AVAudioPlayer playing some audio (duh!) The audio is initiated when the user presses a button. When they release it I want the audio to fade out. I am using Interface builder...so I am trying to hook up a function on "touch up inside" that fades the audio out over 1 sec then stops. Any ideas? Thanks Here's how I'm doing it: -(void)doVolumeFade { if (self.player.volume > 0.1) { self.player.volume = self.player.volume - 0.1; [self performSelector:@selector(doVolumeFade) withObject:nil afterDelay:0.1]; } else { // Stop and get the sound ready for playing again [self.player stop]; self

Python Change Master/Application Volume

若如初见. 提交于 2019-11-28 14:02:29
How do I change it? I'm looking for something like: SetMasterVolume(0.5) SetAppVolume('FooBar',0.5) I tried using ctypes.windll.winmm, but I can't find much documentation on how to use it. Thanks in advance. I'd hope after 5 years this is no longer a problem for you, but I've just had to do the same thing. It's possible using the PyCaw library. Simple proof of concept, based on PyCaw's examples from __future__ import print_function from pycaw.pycaw import AudioUtilities, ISimpleAudioVolume def main(): sessions = AudioUtilities.GetAllSessions() for session in sessions: volume = session._ctl

K8s 存储

隐身守侯 提交于 2019-11-28 13:25:05
Docker Volume 是针对容器层面的存储抽象,其volume的生命周期是通过docker engine来维护的。K8s Volume 则是应用层面的存储抽象,在K8s中通过Pod的概念将一组具有超亲密关系的容器组合到了一起形成了一个服务实例,为了保证一个Pod中某一个容器异常退出,被kubelet重建拉起旧容器产生的重要数据不丢,以及同一个Pod的多个容器可以共享数据,K8s在Pod层面定义了存储卷,也即通过 .spec.volumes 来声明Pod所要使用的volume类型。 而且K8s通过CRI接口解耦和docker engine的耦合关系,所以K8s的volume的生命周期理所当然由K8s来管理,因此K8s本身也有自己的volume plugin扩展机制。Pod .spec.volumes 中的Volume类型做一个分类: 本地存储:emptydir/hostpath等,主要使用Pod运行的node上的本地存储 网络存储:in-tree(内置): awsElasticBlockStore/gcePersistentDisk/nfs等,存储插件的实现代码是放在k8s代码仓库中的;out-of-tree(外置): flexvolume/csi等网络存储inline volume plugins,存储插件单独实现,特别是CSI是volume扩展机制的核心发展方向。

k8s存储

我是研究僧i 提交于 2019-11-28 13:24:44
· 几种存储类型 1) emptyDir emptyDir Volume 的生命周期与 Pod 一致, Pod 中的所有容器都可以共享 Volume ,它们可以指定各自的 mount 路径,当 Pod 从节点删除时, Volume 的内容也会被删除。他所创建的空目录会在 Pod 的命名空间里的 volumes 下。 2 ) hostPath hostPath Volume 的作用是将 Docker Host 文件系统中已经存在的目录 mount 给 Pod 的容器。如果 Pod 被销毁了, hostPath 对应的目录也还会被保留,持久性比 emptyDir 强,但是灵活性不足,增加了 Pod 与 Host 的耦合性,一般不建议使用。 3) 静态创建 基于 NFS 的 pv 此种 Volume 类型的最大特点就是不依赖 Kubernetes , Volume 的底层基础设施由独立的存储系统管理,与 Kubernetes 集群是分离的,数据被持久化后,即使整个 Kubernetes 崩溃也不会受损 ,但是手动创建增加了管理员工作量,降低了效率。 3) 自动创建基于 NFS 的 pv 此种类型 volume ,如果没有满足 PVC 条件的 PV ,会动态创建 PV 。相比静态供给,动态供给有明显的优势,不需要提前创建 PV ,减少了管理员的工作量,效率高。 · PV