pcm

Core Audio AudioFIleReadPackets… looking for raw audio

白昼怎懂夜的黑 提交于 2019-12-06 12:41:53
问题 I'm trying to get raw audio data from a file (i'm used to seeing floating point values between -1 and 1). I'm trying to pull this data out of the buffers in real time so that I can provide some type of metering for the app. I'm basically reading the whole file into memory using AudioFileReadPackets. I've create a RemoteIO audio unit to do playback and inside of the playbackCallback, i'm supplying the mData to the AudioBuffer so that it can be sent to hardware. The big problem I'm having is

PCM algorithm for upsampling

杀马特。学长 韩版系。学妹 提交于 2019-12-06 09:25:12
问题 I have 8k16bit pcm audio and I want to upsample it to 16k16bit. I have to do this manually. Can someone tell me the algorithm for linear interpolation? Should I interpolate between each two bytes? Also when I upsample i have to make changes for the wav header - what should I change? 回答1: As others have mentioned, linear interpolation doesn't give the best sound quality, but it's simple and cheap. For each new sample you create, just average it with the next one, e.g. short[] source = ...;

PCM Data Pitch Change in C#

大憨熊 提交于 2019-12-06 05:20:51
I have a program that downloads PCM data from a Web Server, which it uses later to play through a standard PCM player. I want to be able to allow users to change the pitch of the PCM data while its being played. Does anyone know how to do this? I don't know any digital signal processing library for C#, but this seems to be a complete source sample for pitch shifting in .net.: http://sites.google.com/site/mikescoderama/pitch-shifting The simplest solution is to play back the sound at a higher sampling rate than it was recorded - playing a 22 kHz file at 44 kHz will double the pitch. You can

Coverting PCM 16bit LE to WAV

可紊 提交于 2019-12-06 02:16:37
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 guidance is appreciated! I would recommend to write WAV header and data manually, it is really very

Convert audio linear pcm to mp3 ( using LAME ) with the help of AudioQueueServices example in iOS

柔情痞子 提交于 2019-12-06 00:17:21
I am new in ios developement.I am encoding a LinearPCM to MP3 in iOS.I'm trying to encode the raw PCM data from microphone to MP3 using AudioToolbox framework and Lame.And although everything seems to run fine if i record .caf format . i am getting only noise and distortions present in the encoded stream. I'm not sure that I setup AudioQueue correctly and also that I process the encoded buffer in the right wat... My code to setup audio recording: sample project https://github.com/vecter/Audio-Queue-Services-Example - (void)setupAudioFormat:(AudioStreamBasicDescription*)format { format-

Clicks while using LAME to encode from PCM to MP3 in iOS

大兔子大兔子 提交于 2019-12-05 23:24:11
I am not the first to have this type of issue, however, I have no been able to solve it. I am encoding a LinearPCM to MP3 in iOS. It is working though I am experiencing clicks between each buffer. memset(&mEncodedBuffer, 0, sizeof(mEncodedBuffer)); int encodedBytes = lame_encode_buffer(gfp, (short*)inBuffer->mAudioData, NULL, inNumberPacketDescriptions, mEncodedBuffer, MP3_BUFFER_SIZE); NSData* data = [NSData dataWithBytes:mEncodedBuffer length:encodedBytes]; Then, I do the following with the buffer: AudioQueueEnqueueBuffer(vc.recordState.queue, inBuffer, 0, NULL); I have tried adding the

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

被刻印的时光 ゝ 提交于 2019-12-05 12:23:29
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 means. I have also read that each sample is stored in the format [left MSB][left LSB][right MSB][right

IOS Swift read PCM Buffer

喜你入骨 提交于 2019-12-05 06:00:16
问题 I have a project for Android reading a short[] array with PCM data from microphone Buffer for live analysis. I need to convert this functionality to iOS Swift. In Android it is very simple and looks like this.. import android.media.AudioFormat; import android.media.AudioRecord; ... AudioRecord recorder = new AudioRecord(MediaRecorder.AudioSource.DEFAULT, someSampleRate, AudioFormat.CHANNEL_IN_MONO, AudioFormat.ENCODING_PCM_16BIT, AudioRecord.getMinBufferSize(...)); recorder.startRecording();

C & Fmod Ex - playing a PCM array/buffer in Real Time

北战南征 提交于 2019-12-05 02:34:41
问题 I use an array to process radio signal and to obtain raw PCM audio. I am desperately trying to play this audio using Fmod Ex. Basically, would it be possible to create a stream corresponding to my circular buffer, that I could access in a thread-safe way ? Any basic information about what methods to use would be greatly appreciated. If no, could any other Windows 7 API do the trick and how ? (ASIO, Wasapi...) Thx °-° 回答1: I'm assuming your data is continuous (always updating) so you would

Java Audio : Playing PCM amplitude Array

两盒软妹~` 提交于 2019-12-04 23:43:54
转载自: http://ganeshtiwaridotcomdotnp.blogspot.com/2011/12/java-audio-playing-pcm-amplitude-array.html How to play a array of PCM amplitude values (integer or float array) in Java - Steps Basic Steps : //initialize source data line - for playback SourceDataLine line = AudioSystem.getSourceDataLine(audioFormat); line.open(audioFormat); line.start(); //play the byteArray line.write(byteArray, 0, byteArray .length);//(byte[] b, int off, int len) line.drain(); line.close(); Converting integer array to bytearray : We need to convert our PCM array to byteArray because the line.write requires byte[] b