sample-rate

How to downsample audio recorded from mic realtime in javascript?

巧了我就是萌 提交于 2019-12-09 23:13:01
问题 I am using following javascript to record audio and send it to a websocket server: const recordAudio = () => new Promise(async resolve => { const constraints = { audio: { sampleSize: 16, channelCount: 1, sampleRate: 8000 }, video: false }; var mediaRecorder; const stream = await navigator.mediaDevices.getUserMedia(constraints); var options = { audioBitsPerSecond: 128000, mimeType: 'audio/webm;codecs=pcm' }; mediaRecorder = new MediaRecorder(stream, options); var track = stream.getAudioTracks(

How to set audio sample rate on AVCaptureSession?

随声附和 提交于 2019-12-07 08:23:41
问题 I am using AVCaptureSession to record video and audio into sample buffers using AVCaptureVideoDataOutput and AVCaptureAudioDataOutput . The default audio sample rate for the iPhone (4 and 4S) is 44100Hz. I would like to set this to 48000Hz however AVCaptureSession does not seem to have any settings for audio sample rate. I have tried to use AVAudioSession to change the hardware sample rate (using setPreferredHardwareSampleRate) but though it reports the hardware sample rate as changed (after

How do you get the current sample rate of Windows audio playback?

陌路散爱 提交于 2019-12-06 08:20:41
问题 I am using the Windows waveOut API (aka MME or Multimedia Extension) mmsystem.h. Some programs change the audio playback sample rate (eg. from 44.1kHz to 48kHz), and it would be very useful for my program to detect the current playback sample rate, so it can warn users that Windows will be resampling the program's output. According to this documentation http://msdn.microsoft.com/en-us/library/aa909811.aspx, waveOutGetPlaybackRate returns the resampling % that the device is currently

How do you get the current sample rate of Windows audio playback?

邮差的信 提交于 2019-12-04 12:59:20
I am using the Windows waveOut API (aka MME or Multimedia Extension) mmsystem.h. Some programs change the audio playback sample rate (eg. from 44.1kHz to 48kHz), and it would be very useful for my program to detect the current playback sample rate, so it can warn users that Windows will be resampling the program's output. According to this documentation http://msdn.microsoft.com/en-us/library/aa909811.aspx , waveOutGetPlaybackRate returns the resampling % that the device is currently performing (eg, device plays at 44.1, and program is playing audio at 44.1 so it would return 1.0). I am

How to convert any mp3 file to .wav 16khz mono 16bit

我们两清 提交于 2019-12-02 16:45:21
Please, help to choose solution for converting any mp3 file to special .wav - I'm a newbie with Linux command line tools, so It's hard for me right now. I need to get wav with 16khz mono 16bit sound properties from any mp3 file. I was trying ffmpeg -i 111.mp3 -ab 16k out.wav, but I got wav with the same rate as mp3 (22k). Please, help to construct right command line Bill kdazzle's solution is almost there - it still output a stereo wav, here is a slightly modified version that generate mono: ffmpeg -i 111.mp3 -acodec pcm_s16le -ac 1 -ar 16000 out.wav also, if this is for pre-processing speech

Android AudioRecord - Won't Initialize 2nd time

前提是你 提交于 2019-11-29 12:07:34
问题 Hej, im currently trying to get AudioRecord to work. Because I need it in a bigger project. But it seems to mess up a lot. I have been trying alot of things, so I went back to basic when I traced this bug. I am using my Samsung Galaxy S as my debugdevice. My problem is, first time after a reboot of my device I can initialize the AudioRecord object I create without problems. But the second time I run it, it won't initialize the AudioRecord object. I have tried several frequencies, fyi. Here is

Change sample rate of AudioContext (getUserMedia)

痞子三分冷 提交于 2019-11-28 18:45:07
Im trying to record a 48000Hz recording via getUserMedia. But without luck. The returned audio MediaStream returns 44100Hz. How can i set this to 48000Hz? Here are snippets of my code: var startUsermedia = this.startUsermedia; navigator.getUserMedia({ audio: true, //sampleRate: 48000 }, startUsermedia, function (e) { console.log('No live audio input: ' + e); }); The startUsermedia function: startUsermedia: function (stream) { var input = audio_context.createMediaStreamSource(stream); console.log('Media stream created.'); // Uncomment if you want the audio to feedback directly //input.connect

how to convert or record .wav file in 16khz 16bit mono little-endian?

微笑、不失礼 提交于 2019-11-28 12:36:05
I m just implementing sphinx4 speech recognition in java..whta i need is how to record sound or convert any sound .wave file in to 16khz 16bit mono little-endian file. had search a lot for this..but no specific guidance i have got..hope anyone from stack overflow family can help me out or give me a proper guidance in that. 1). i need to just record audio in android with the 16khz 16bit mono little-endian file format in wave file or 2). i need to convert the prerecorded file with any sampling rate with the 16khz 16bit mono little-endian format in java.. i need to implement one of above feature.