volume

Hardware Volume buttons change in app volume

心已入冬 提交于 2019-12-04 19:53:58
So in my app i would like to change the in app volume leves for an alarm by the use of the hardware buttons but whenever i use the buttons to turn up or down the volume it ONLY changes the "ringer" volume wich does NOT effect my in app volume. Under Settings -> Sounds the "change with buttons" switch is ON and everything works fine if i turn it off but most users will want to have it on as well. So when im in my app i want the volume buttons to change the app volume not the ringer volume. Hope it makes sense Thanks By default the hardware buttons will change the alarm volume unless you have an

Visualizing volume of PCM samples

穿精又带淫゛_ 提交于 2019-12-04 19:35:13
I have several chunks of PCM audio (G.711) in my C++ application. I would like to visualize the different audio volume in each of these chunks. My first attempt was to calculate the average of the sample values for each chunk and use that as an a volume indicator, but this doesn't work well. I do get 0 for chunks with silence and differing values for chunks with audio, but the values only differ slighly and don't seem to resemble the actual volume. What would be a better algorithem calculate the volume ? I hear G.711 audio is logarithmic PCM. How should I take that into account ? Note, I haven

如何使用docker数据卷?

帅比萌擦擦* 提交于 2019-12-04 19:00:18
开始之前 如果你有一些需要持续更新的数据并且希望 持久化数据 ,或者需要在不同的容器之间 共享数据 ,再者需要主机与容器之间共享数据,那么你可以使用数据卷来满足这些需求。 数据卷定义 数据卷是一个可供一个或多个容器使用的特殊目录,它绕过 UFS ,可以提供很多有用的特性: 数据卷可以在容器之间共享和重用。 对数据卷的修改会立马生效。 数据卷默认会一直存在,即使容器被删除。 使用数据卷 数据卷有两种创建方式一是创建容器时创建数据卷,二是先创建好数据卷,在创建容器时挂载这个数据卷,两种方式均可以。 创建一个数据卷 docker volume create demo-data demo-data 创建容器使用-v(--volume)参数来挂载数据卷 docker run --name demo1 -d \ -v demo-data:/var/www/html nginx:alpine docker run --name demo2 -d \ -v demo-data:/var/www/html nginx:alpine 列出数据卷 docker volume ls DRIVER VOLUME NAME local demo-data 查看数据卷详细信息 docker volume inspect demo-data [ { "Driver": "local", "Labels": {},

How do you get/set media volume (spotify) and TTS in Android?

只愿长相守 提交于 2019-12-04 18:16:22
Decrease the stream volume and Increase TTS volume at the same time I had this Android application that talk with TTS every time and uses streaming music (spotify). So, I need to decrease the volume and increase the TTS I use this code but this decrease the tts as well. AudioManager audioManager = (AudioManager)getSystemService(Context.AUDIO_SERVICE); audioManager.setStreamVolume(AudioManager.STREAM_MUSIC,[int value],[if desired a flag]); Any way to decrease only spotify like stream music . in Java/android. What you want to do is know as 'audio ducking' Here's some sample code: /** * Our {

Audio: Change Volume of samples in byte array

纵饮孤独 提交于 2019-12-04 17:42:13
问题 I'm reading a wav-file to a byte array using this method (shown below). Now that I have it stored inside my byte array, I want to change the sounds volume. private byte[] getAudioFileData(final String filePath) { byte[] data = null; try { final ByteArrayOutputStream baout = new ByteArrayOutputStream(); final File file = new File(filePath); final AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(file); byte[] buffer = new byte[4096]; int c; while ((c = audioInputStream.read

How to adjust speaker volume from Java program?

岁酱吖の 提交于 2019-12-04 17:31:43
I'm running Win Vista, at the lower right side of the window there is a speaker icon next to the clock, I can click on it and adjust the volume, I wonder if there is a way in my Java program to do this automatically? For instance, when my Java program starts, it turns the volume to 80, and when the program exits, it changes the volume back to the original level. I don't mind using Runtime.getRuntime().exec() if there is a way to achieve this effect. Ravi Wallau One of the main premises of Java is that an application written on it should work in any platform. That's why they dropped the support

iphone - MPMoviePlayerController - How can I decrease volume of the video programmatically

大憨熊 提交于 2019-12-04 17:18:38
I'm using MPMoviePlayerController to play a video which has audio as well. It's working fine. I'm hiding the default controls. So no controls are showing on the video. I want to place a slider on the video (I successfully placed a slider as well over the video). With the slider, I want to control the volume of the video that is being played. How can I control volume of video? See the documentation for MPVolumeView. Here is a sample code that I use in my view controller. MPVolumeView *systemVolumeSlider = [[MPVolumeView alloc] initWithFrame: CGRectMake(10, 10, 200, 40)]; [self.view addSubview:

iOS xcode microphone volume detection?

做~自己de王妃 提交于 2019-12-04 13:38:48
问题 What frameworks are required to detect how loud someone is talking into a microphone... Also, can anyone tell me what to search for in the documentation or google so I can create some code... What line of code would be commonly used when detecting volume levels of noise through the microphone? Thanks! 回答1: This seems to be a duplicate of: Realtime microphone sound level monitoring However, that question is old and the accepted answer links to a deprecated library. They now recommend that you

Docker 中卷组管理

时间秒杀一切 提交于 2019-12-04 13:06:02
一.概念       数据卷是一个可供一个或多个容器使用的特殊目录实现让容器的一个目录和宿主机中的一个文件或者目录进行绑定。数据卷 是被设计用来持久化数据的,对于数据卷你可以理解为NFS中的哪个分享出来的挂载点,指宿主机共享的目录。 二.功能和特性   容器中数据的持久存储   容器间的资源共享   容器的迁移(分布式)   对数据卷的修改会立马生效   对数据卷的更新,不会影响镜像   数据卷默认会一直存在,即使容器被删除 (注意docker自主管理的会被删除,容器删除前一定要对数据卷进行备份) 三.作用   实现了宿主机之间的文件共享 并且实现了数据的持久化 四.使用     -v 选项 注意:-v 后面的目录如果在宿主机及docker当中不存在时,都会自动创建 指定的宿主机目录会覆盖容器目录内容 /tian:/usr/local/apache2 宿主机目录:容器web目录 第一类:指定宿主机目录 #实现web网站数据持久化 docker run -d -p 88:80 -v /tian:/usr/local/apache2/htdocs httpd 验证数据持久化: docker rm -f $(docker ps -aq) docker run -d -p 89:80 -v /tmp/tian:/usr/local/apache2/htdocs httpd 第二类

Mute IPhone prorammatically is legal?

落花浮王杯 提交于 2019-12-04 12:00:44
I gonna start working on an app that have basic functionality to mute phone(no sound from any app, ring tone). I searched over net and found some private api's to do what I want. Mute iPhone programatically https://github.com/forensix/BBSettings But found some articles saying that Apple will not approve such kind of apps. And when I searched over store I got an app link below https://itunes.apple.com/us/app/autosilent/id474777148?mt=8 This is auto silent app, that put iphone to mute state. So now I want all my seniors to let me know whether I can do this app or not? The application that you