pcm

ios10 iphone5s voip siphon pjsip2.5.5 Error opening sound device

匿名 (未验证) 提交于 2019-12-03 09:06:55
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Someone could tell me why this happen? iOS10, iPhone5s, VOIP Siphon pjsip2.5.5. These issue was not appear every time,it came sometimes when you want to make call or answer call (add at:20161226). Error opening sound device: 14:06:03.137742 pjsua_aud.c ....Set sound device: capture=-1, playback=-2 14:06:03.137775 pjsua_aud.c .....Opening sound device (speaker + mic) PCM@16000/1/20ms 14:06:03.137837 coreaudio_dev. ......Using VoiceProcessingIO audio unit 14:06:03.147404 acquire_call enter,call_id:2 14:06:03.233365 level:4,msg:14:06:03.233

ALSA: Ways to prevent underrun for speaker

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am playing a single channel audio in non-interleaved mode. I am getting underrun when I am writing aduio data into speaker : ALSA lib pcm.c:7339:(snd_pcm_recover) underrun occurred Here is how I write: printf("%d",snd_pcm_avail (spkhandle)); ret = snd_pcm_writen(spkhandle, pSpeakerBuf , framesIn18Millisec); if(ret < 0) { snd_pcm_recover(spkhandle, ret, 0); } What are the different ways/parameter configurations to prevent ALSA under run ? (I am using Linux 3.0, ARM ) Edit: Here is a buffer measurement using snd_pcm_avail() API snd_pcm_avail

How can I get frequency data from PCM using FFT

孤街醉人 提交于 2019-12-03 07:17:24
I have an array of audio data I am passing to a reader: recorder.read(audioData,0,bufferSize); The instantiation is as follows: AudioRecord recorder; short[] audioData; int bufferSize; int samplerate = 8000; //get the buffer size to use with this audio record bufferSize = AudioRecord.getMinBufferSize(samplerate, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT)*3; //instantiate the AudioRecorder recorder = new AudioRecord(AudioSource.MIC,samplerate, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT,bufferSize); recording = true; //variable to use

How to extract frequency out of WAV sample data?

杀马特。学长 韩版系。学妹 提交于 2019-12-03 06:25:42
问题 I'm developing an application in c to read simple PCM WAV files. My question is, how should I interpret the samples from the data chunk, so that I can extract the sample's frequency? Given a WAV example, how can the original data represent frequencies. E.g. this data chunk, 24 17 1e f3, for stereo, 16 bits, the left channel sample is, 0x1724 = 5924d, means 5924Hz ? How can that be, for samples that are signed or frequencies that humans can´t hear? 回答1: Your assumption is incorrect. The sample

PCM to AAC conversion using mediacodec

☆樱花仙子☆ 提交于 2019-12-03 05:43:59
问题 I am using a media codec class in Android (Jelly Bean) to encode PCM format to AAC. The file was encoded but no music player is able to play that file. I was not able to find any working code or proper documentation on the net. This is my code: public void doConvert() { new AsyncTask<Void, Void, Void>() { @Override protected Void doInBackground(Void... params) { try { int codecCount = MediaCodecList.getCodecCount(); for ( int i=0; i < codecCount; i++) { MediaCodecInfo info = MediaCodecList

Mixing 16 bit linear PCM streams and avoiding clipping/overflow

断了今生、忘了曾经 提交于 2019-12-03 04:36:20
问题 I've trying to mix together 2 16bit linear PCM audio streams and I can't seem to overcome the noise issues. I think they are coming from overflow when mixing samples together. I have following function ... short int mix_sample(short int sample1, short int sample2) { return #mixing_algorithm#; } ... and here's what I have tried as #mixing_algorithm# sample1/2 + sample2/2 2*(sample1 + sample2) - 2*(sample1*sample2) - 65535 (sample1 + sample2) - sample1*sample2 (sample1 + sample2) - sample1

MediaCodec and 24 bit PCM

匿名 (未验证) 提交于 2019-12-03 03:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am successfully using MediaCodec to decode audio, however when I load a file with 24-bit samples, I have no way of knowing this has occurred. Since the application was assuming 16-bit samples, it fails. When I print the MediaFormat, I see {mime=audio/raw, durationUs=239000000, bits-format=6, channel-count=2, channel-mask=0, sample-rate=96000} I assume that the "bits-format" would be a hint, however this key is not declared in the API, and is not actually emitted when the output format changes. I get {mime=audio/raw, what=1869968451,

ALSA: snd_pcm_hw_params_free() causing memory error

匿名 (未验证) 提交于 2019-12-03 02:41:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm modifying some existing sound code and noticed that when it finishes writing configuration data to the hardware, the code doesn't call snd_pcm_hw_params_free() . The application, for legacy reasons, open and closes the sound hardware for every sound it plays. This has got to be causing memory leak because the snd_pcm_hw_params_t * is never being free'd. So I added a call to `snd_pcm_hw_params_free() and now get the following error: [root@n00200C709F3D namb2]# ./freetest *** glibc detected *** ./freetest: free(): invalid pointer:

PyAudio prints ALSA warnings and does not work

匿名 (未验证) 提交于 2019-12-03 02:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: hey guys i'm trying to run a basic python speech to text code. This is the code. import speech_recognition as sr r = sr.Recognizer() with sr.Microphone() as source: audio = r.listen(source) try: print("You said " + r.recognize(audio)) except LookupError: print("Could not understand audio") The code works fine till it reaches the print stage and then throws this error. Is there anything that i have done wrong? ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards

How to convert sample rate from AV_SAMPLE_FMT_FLTP to AV_SAMPLE_FMT_S16?

前提是你 提交于 2019-12-03 02:27:40
问题 I am decoding aac to pcm with ffmpeg with avcodec_decode_audio3. However it decodes into AV_SAMPLE_FMT_FLTP sample format (PCM 32bit Float Planar) and i need AV_SAMPLE_FMT_S16 (PCM 16 bit signed - S16LE). I know that ffmpeg can do this easily with -sample_fmt. I want to do the same with the code but i still couldn't figure it out. audio_resample did not work for: it fails with error message: .... conversion failed. 回答1: EDIT 9th April 2013 : Worked out how to use libswresample to do this...