pcm

Downsample PCM audio from 44100 to 8000

非 Y 不嫁゛ 提交于 2019-12-21 10:44:30
问题 I've been working on a audio-recognize demo for some time, and the api needs me to pass an .wav file with sample rate of 8000 or 16000 , so I have to downsample it. I have tried 2 algorithms as following. Though none of them solves the problem as I wish, there's some differences of the results and I hope that will make it more clear. This is my first try, and it works fine when sampleRate % outputSampleRate = 0 , however when outputSampleRate = 8000 or 1600 , the outcome audio file is silent

将音频wav转成pcm

流过昼夜 提交于 2019-12-21 08:07:27
ffmpeg -y -i input.wav -f s16le -ac 1 -ar 16000 output.pcm 其中 -y 强行覆盖 -f 输出音频的格式 s16le :PCM unsigned 16-bit little-endian -ac audio channe -ar audio radio 来源: CSDN 作者: 凌晨4点半 链接: https://blog.csdn.net/lnlhn/article/details/103593081

C\C++ open source Mp3 to PCM convertor [closed]

烂漫一生 提交于 2019-12-20 04:32:31
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . C\C++ open source Mp3 to PCM convertor? What do I need Open Source Libs/wrappers for encoding/decoding. Tutorials and blog articles on How to do it, about etc. 回答1: I've used this successfully in projects: http://www.mpg123.de/ EDIT: I can't speak for this one http://www.underbit.com/products/mad/ but it's

Audio output from Silverlight

时间秒杀一切 提交于 2019-12-20 03:46:14
问题 I'm looking to develop a Silverlight application which will take a stream of data (not an audio stream as such) from a web server. The data stream would then be manipulated to give audio of a certain format (G.711 a-Law for example) which would then be converted into PCM so that additional effects can be applied (such as boosting the volume). I'm OK up to this point. I've got my data, converted the G.711 into PCM but my problem is being able to output this PCM audio to the sound card. I

Android AudioRecord questions?

瘦欲@ 提交于 2019-12-18 17:04:44
问题 I have been messing around with the AudioRecord feature of the Android API and found some strange behaviors with it. Background info: My phone is a HTC Incredible I am using the Eclipse plugin for Android development with the emulator. Targeted platform or OS is 2.2... Since it is what my phone uses. Some code: bufferSize = AudioRecord.getMinBufferSize(FREQUENCY, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT); audioRecord = new AudioRecord(MediaRecorder.AudioSource

java pcm to wav

眉间皱痕 提交于 2019-12-18 05:12:39
问题 I have a pcm file, and I want to convert it to a wav file. Is there any suitable api or code for this? 回答1: it's My Code /** * Write PCM data as WAV file * @param os Stream to save file to * @param pcmdata 8 bit PCMData * @param srate Sample rate - 8000, 16000, etc. * @param channel Number of channels - Mono = 1, Stereo = 2, etc.. * @param format Number of bits per sample (16 here) * @throws IOException */ public void PCMtoFile(OutputStream os, short[] pcmdata, int srate, int channel, int

Can ffmpeg convert audio from raw PCM to WAV?

好久不见. 提交于 2019-12-17 17:29:55
问题 I can convert wav file to pcm ffmpeg -i file.wav -f s16le -acodec pcm_s16le file.pcm How can I revert this operation? 回答1: The wav container just adds a simple header to the raw PCM data. The header includes the format, sample rate, and number of channels. Since the raw PCM data does not include this information, you will need to specify it on the command line. Options are specified before the file they apply to, so options before the input file may be used to specify the format of the input

How to get PCM data from a wav file?

时光毁灭记忆、已成空白 提交于 2019-12-17 16:26:52
问题 I have a .wav file. I want to get the PCM data from that sound file, so that I can get the individual data chunks from the sound and process it. But I don't know how to do it. Can anyone tell me how to do it? I have done this so far: public class test { static int frameSample; static int timeofFrame; static int N; static int runTimes; static int bps; static int channels; static double times; static int bufSize; static int frameSize; static int frameRate; static long length; public static void

iphone利用AudioQueue播放wav(PCM码)

烂漫一生 提交于 2019-12-17 10:54:52
续上一篇 iphone利用AudioQueue播放音频文件(mp3,aac,caf,wav等) 绝对原创,转载请注明出处: http://www.cnblogs.com/xuanyuanchen/admin/EditPosts.aspx?postid=2450169 1、ffmpeg解码音频流并且保存成wav文件。  这一步比较简单,只要熟悉ffmpeg解码音频的流程,将解码出的pcm码,保存到本地文件中,并实时统计解码的pcm的字节长度,最后解码完成之后再添加44字节的wav文件头。 save_audio.c View Code 1 #include <stdio.h> 2 #include "libavformat/avformat.h" 3 #include "libavcodec/avcodec.h" 4 #include "libavutil/avutil.h" 5 static void writeWavHeader(AVCodecContext *pCodecCtx,AVFormatContext *pFormatCtx,FILE *audioFile) { 6 int8_t *data; 7 int32_t long_temp; 8 int16_t short_temp; 9 int16_t BlockAlign; 10 int bits=16; 11 int32

PCM -> AAC (Encoder) -> PCM(Decoder) in real-time with correct optimization

耗尽温柔 提交于 2019-12-17 08:11:13
问题 I'm trying to implement AudioRecord (MIC) -> PCM -> AAC Encoder AAC -> PCM Decode -> AudioTrack?? (SPEAKER) with MediaCodec on Android 4.1+ (API16). Firstly, I successfully (but not sure correctly optimized) implemented PCM -> AAC Encoder by MediaCodec as intended as below private boolean setEncoder(int rate) { encoder = MediaCodec.createEncoderByType("audio/mp4a-latm"); MediaFormat format = new MediaFormat(); format.setString(MediaFormat.KEY_MIME, "audio/mp4a-latm"); format.setInteger