audio

XAudio2 - Play generated sine, when changing frequency clicking sound

三世轮回 提交于 2021-02-08 04:57:28
问题 I want to develop an app to match your tinnitus frequency : A frequency is played and the user decrease or increase the freqency by pressing a plus or minus button. (see part of the codes, based on some coding from stackoverflow thx :-)) public static short[] BufferSamples = new short[44100 * 1 * 2]; private SourceVoice sourceVoice; private AudioBuffer buffer; private int Tfreq; public MatchTinn() { InitializeComponent(); Loaded += MatchTinn_Loaded; TFreq = 5000; } private void MatchTinn

Spring-MVC : How to stream mp3 file from controller

。_饼干妹妹 提交于 2021-02-08 04:28:10
问题 I am working on a Spring-MVC application in which I am trying to stream mp3 data. Unfortunately, it's directly triggering a download whenever a byte-array of information is sent in response. I found a few other links, but most of them are tied to an user-interface, so not much useful. What are the requirements for streaming a mp3 file? Here is the download code I have. @RequestMapping(value = "/getsong/{token}") public ResponseEntity<byte[]> getsong(@PathVariable("token") String token,

Determine which application is using audio device

一个人想着一个人 提交于 2021-02-08 04:01:21
问题 I'm currently using CoreAudio in macOS to determine if a specific audio input device is in use. I'm trying to find a little more information about what's going on with that device if it is in use, but struggling to find any information on how to do this. 1) Is it possible to find the application that is currently using a specific audio input device? 2) Is it possible to determine if an application is using an audio device (input or output) and has the device currently muted in that specific

Determine which application is using audio device

廉价感情. 提交于 2021-02-08 04:01:19
问题 I'm currently using CoreAudio in macOS to determine if a specific audio input device is in use. I'm trying to find a little more information about what's going on with that device if it is in use, but struggling to find any information on how to do this. 1) Is it possible to find the application that is currently using a specific audio input device? 2) Is it possible to determine if an application is using an audio device (input or output) and has the device currently muted in that specific

How to use ffmpeg in a python function

≯℡__Kan透↙ 提交于 2021-02-08 03:34:10
问题 I have tried to use a ffmpeg to extract an audio from a video file and this is my code import io import os import subprocess def extract_audio(video,output): command = "ffmpeg -i '{video}' -ac 1 -f flac -vn '{output}'" subprocess.call(command,shell=True) extract_audio('dm.MOV','dm-new.flac') And I got no error after compiled. By doing this I should get a new file which is 'dm-new.flac'. But there is no such a flac file created after I compile the script. I think there are something wrong with

How to use ffmpeg in a python function

半腔热情 提交于 2021-02-08 03:34:08
问题 I have tried to use a ffmpeg to extract an audio from a video file and this is my code import io import os import subprocess def extract_audio(video,output): command = "ffmpeg -i '{video}' -ac 1 -f flac -vn '{output}'" subprocess.call(command,shell=True) extract_audio('dm.MOV','dm-new.flac') And I got no error after compiled. By doing this I should get a new file which is 'dm-new.flac'. But there is no such a flac file created after I compile the script. I think there are something wrong with

SoundPool doesn`t play sound after clicking several times

北慕城南 提交于 2021-02-07 23:41:24
问题 When i click button plays sound on my app, but keep clicking for a while doesn`t play anymore. Maybe it is memory issue? Could you solve me my issue? Here is implemented play sound via SoundPool: when i click button i called play method: and play method works background thread private void play(int resId) { soundPool = buildBeforeAPI21();//TODO: refactor with deprecated constructor soundPool.load(activity, Integer.parseInt(resId), 1); } public SoundPool buildBeforeAPI21() { if (soundPool ==

SoundPool doesn`t play sound after clicking several times

杀马特。学长 韩版系。学妹 提交于 2021-02-07 23:41:21
问题 When i click button plays sound on my app, but keep clicking for a while doesn`t play anymore. Maybe it is memory issue? Could you solve me my issue? Here is implemented play sound via SoundPool: when i click button i called play method: and play method works background thread private void play(int resId) { soundPool = buildBeforeAPI21();//TODO: refactor with deprecated constructor soundPool.load(activity, Integer.parseInt(resId), 1); } public SoundPool buildBeforeAPI21() { if (soundPool ==

Android: AudioTrack makes a click sound at beginning

妖精的绣舞 提交于 2021-02-07 20:59:21
问题 I'm working on an Android app and I would like to play some short sounds(~ 2s). I tried Soundpool but it doesn't really suit for me since it can't check if a sounds is already playing. So I decided to use AudioTrack. It works quite good BUT most of the time, when it begins to play a sound there is a "click" sound. I checked my audiofiles and they are clean. I use audiotrack on stream mode. I saw that static mode is better for short sounds but after many searchs I still don't understand how to

Android: AudioTrack makes a click sound at beginning

烈酒焚心 提交于 2021-02-07 20:54:13
问题 I'm working on an Android app and I would like to play some short sounds(~ 2s). I tried Soundpool but it doesn't really suit for me since it can't check if a sounds is already playing. So I decided to use AudioTrack. It works quite good BUT most of the time, when it begins to play a sound there is a "click" sound. I checked my audiofiles and they are clean. I use audiotrack on stream mode. I saw that static mode is better for short sounds but after many searchs I still don't understand how to