pcm

SoundPlayer not playing any bundled windows sounds PCM wav files

蓝咒 提交于 2019-12-11 03:29:11
问题 In C# I cannot get SoundPlayer class from System.Media to play any wav from my C:\Windows\Media folder using the following code. All I get is no sound: String filename = "C:\\Windows\\Media\\tada.wav"; SoundPlayer sp = new SoundPlayer(filename); sp.Load(); sp.Play(); I have checked the wave file "tada.wav" with a program called "Gspot" that tells me the audio codec is "PCM Audio". I do not receive any compiler warnings or errors and there is no exceptions raised when I run the program. I just

Convert .m4a to PCM using libavcodec

倖福魔咒の 提交于 2019-12-10 21:37:15
问题 I'm trying to convert a .m4a file to raw PCM file so that I can play it back in Audacity. According to the AVCodecContext it is a 44100 Hz track using the sample format AV_SAMPLE_FMT_FLTP which, to my understanding, when decodeded using avcodec_decode_audio4, I should get two arrays of floating point values (one for each channel). I'm unsure of the significance of the AVCodecContext's bits_per_coded_sample = 16 Unfortunately Audacity plays the result back as if I have the original track is

converting PCM-16 to AMR using AmrInputStream

白昼怎懂夜的黑 提交于 2019-12-10 17:35:10
问题 I'm doing a conversion from PCM-16 to AMR using AmrInputStream. The details for the AmrInputStream can be found here http://hi-android.info/src/android/media/AmrInputStream.java.html I'm quite new to programming to while it talks about using JNI and stuff, I have no idea what JNI is and I don't think it is required for this discussion. The AmrInputStream above is also apparently not found in the SDK nor the NDK, but I have been able to use it. I've been searching around the internet for how

Simple Wav comparison in Java

╄→尐↘猪︶ㄣ 提交于 2019-12-10 10:25:27
问题 I seem to be having a huge problem with something that seems very trivial. Goal : Try to compare two Wav files and see if one(small file) is part of the other(large file). Test : First, I took a 1 minute long piece of audio and exported 30 seconds of it to another file. I first tried to simply read in the byte[] data and look at it via logs, and there's absolutely no correlation even though they are both from the same source file? I then tried using libraries such as WavFile, and MusicG but I

Coverting PCM 16bit LE to WAV

北城以北 提交于 2019-12-10 10:06:48
问题 I'm trying to write a program in C that converts a captured Raw 16kHz PCM 16-bit file to a 16-bit WAV . I've read some posts and people recommended using libsox . Installed it and now i'm really struggling with understanding the man-page. So far (by reading the example in the source dist) I've figured out that the structs : sox_format_t sox_signalinfo_t can probably be used to describe the data I'm inputting. I also know how much info i'm processing (time) if that is somehow necessary? Some

MediaCodec编码 音频pts设置

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 02:19:51
每一帧音频pcm录音,要进行mediacodec编码时,都需要为此pcm设置pts,在放入编码的input队列中。对于视频的pts来说,编码h264,一帧原始视频yuv420格式编码出的就是一帧h264,所以视频的pts可以直接取当前的时间戳就可以。但是对于音频来讲,一帧pcm数据,会编码出多帧的aac,mediacodec会根据送入编码器时设置的yuv420的pts,为每帧编码出的h264打一个pts。 音频的pts设置,就需要小心了。 首先,根据AudioRecord录音器配置的参数,根据采样率,声道数,采样位,和AudioRecord设置的输出buffer的大小,计算pts。 如下: buffer_duration_us = 1000000 * ((double) mAudioBufferSize / mAudioChanelCount / 2 / mAudioSampleRate); buffer_duration_us:每一帧pcm,需要叠加的时间间隔。 pts计算 pts = (long) (firstPresentationTimeUs + mCount * buffer_duration_us); if (getPTSUs() - pts > 300000) { firstPresentationTimeUs += getPTSUs() - pts; pts =

Can someone here has a sample of high pass filter for PCM audio data?

落花浮王杯 提交于 2019-12-09 14:16:53
问题 Good day. I am poor of DSP. I have difficulties understanding the algorithm. I have a c# application, a recorder function that will record a sound waves but this sound is a mixture of all sounds. specifically, when i receive the data i will filter this data to save only the filtered audio data with high frequency, example cutoff frequency is 15khz. For this filter, given are the samples of data with size, and the cutoff frequency C/C++ is fine At the time i received that samples of data,

Converting a 8 bit PCM to 16 bit PCM

爷,独闯天下 提交于 2019-12-09 13:58:03
问题 Starting from this question I was made to understand how to deinterleave the left and right channel of a 16 bit PCM data. My question now is, how will a 8 bit PCM be deinterleaved and "stretched" into a 16 bit value 回答1: 16-bit PCM has basically the same data bits and additional bits on the least significant bit side to specify the value and add accuracy and detail. Then 8-bit PCM is typically unsigned value with a centerpoint of 0x80 , and 16-bit (also applicable to higher bitnesses) PCM is

How to correctly read decoded PCM samples on iOS using AVAssetReader — currently incorrect decoding

一个人想着一个人 提交于 2019-12-08 22:48:29
问题 I am currently working on an application as part of my Bachelor in Computer Science. The application will correlate data from the iPhone hardware (accelerometer, gps) and music that is being played. The project is still in its infancy, having worked on it for only 2 months. The moment that I am right now, and where I need help, is reading PCM samples from songs from the itunes library, and playing them back using and audio unit. Currently the implementation I would like working does the

What does interleaved stereo PCM linear Int16 big endian audio look like?

我的梦境 提交于 2019-12-07 11:21:36
问题 I know that there are a lot of resources online explaining how to deinterleave PCM data. In the course of my current project I have looked at most of them...but I have no background in audio processing and I have had a very hard time finding a detailed explanation of how exactly this common form of audio is stored. I do understand that my audio will have two channels and thus the samples will be stored in the format [left][right][left][right]... What I don't understand is what exactly this