Questions tagged [pcm]

Use this tag for questions about the Pulse-Code Modulation representation of sampled signals.

Pulse-Code Modulation (PCM) is a method used to digitally represent sampled analog signals. It is the standard form for digital audio in computers and various Blu-ray, DVD and Compact Disc formats, as well as other uses such as digital telephone systems. A PCM stream is a digital representation of an analog signal, in which the magnitude of the analog signal is sampled regularly at uniform intervals, with each sample being quantized to the nearest value within a range of digital steps. PCM streams have two basic properties that determine their fidelity to the original analog signal: the sampling rate, which is the number of times per second that samples are taken; and the bit depth, which determines the number of possible digital values that each sample can take.

Pulse-code modulation is an uncompressed audio encoding method. PCM is used in the .WAV, and .PCM file formats, and for encoding audio CDs, among many other uses. Digital signal processing algorithms like filters or FFT interact with the data when its in PCM format. When compressed audio format conversions are made, say from aac to flac, the data is converted from the source codec into PCM and then into the target codec. PCM can be considered the fundamental representation of digital time series data (EG. audio, financial ticker prices).

An alternative to PCM, with its sample rate and bit depth measurements, is the notion of storing the curve as a series of one bit samples. Instead of the ADC generating a sample of the absolute location of the height of the input analog curve when using the PCM approach, with this alternative one bit sample approach the ADC generates the relative position of the input analog curve. This one bit approach is memory efficient when performing very high sample rates.

780 questions
0
votes
1 answer

Mux video with my own audio PCM track

Using Android MediaMuxer, what would be a decent way to add my own PCM track as the audio track in the final movie? In a movie, at a certain time, I'm slowing down, stop, then accelerate and restart a video. For the video part, it's easy to directly…
Léon Pelletier
  • 2,701
  • 2
  • 40
  • 67
0
votes
1 answer

alGenSources keeps giving a random source

I was recently given some code by a friend that's meant to convert then play and analyze music, but when I have tried integrating it into my own project, it is throwing errors and refusing to play the music. I've tracked the flow of the code and…
Justin Buergi
  • 131
  • 11
0
votes
1 answer

Handle setting up WaveFormat for mp3 memory stream in NAudio

I'm trying to set up the WaveStream so that it uses the same format as the mp3 data passed in. I get the format by reading a frame, but when I try to actually create the new conversion stream using the new format I get an "AcmNotPossible calling…
0
votes
1 answer

Resize PCM array without resample

I receive PCM byte array with sample rate 8 kHz and length 320 from network. Now I want to resize the length of array to be 2n, i.e. 256 or 512 while keeping the sample rate at 8 kHz. Does anyone know an algorithm can do this?
monkid
  • 69
  • 2
  • 2
  • 7
0
votes
0 answers

Queue PCM buffers with WebAudio API

I get PCM data from a server. What is the best way to play them one after another? I currently call the following function for each sample batch that I get: function playSamples( samples ) { let count = samples.length / 2; let leftData =…
Maël Nison
  • 7,055
  • 7
  • 46
  • 77
0
votes
1 answer

Properly trimming PCM data from a ByteArray

I have a situation where I need to trim a small amount of audio from the beginning of a recorded clip (generally somewhere between 110-150ms, it is an inconsistent amount). I'm recording in 44100 frequency and 16 bitrate. This is the code I'm…
Lowgain
  • 3,254
  • 5
  • 27
  • 30
0
votes
1 answer

Presentation time in ALSA

I am receiving IEEE 1722 standard ethernet packets from a machine over the network. These packets contain a 'timestamp' field which can be used by the receiver to decide when to play the audio data using ALSA subsystem. I want to know whether which…
Sumeet_Jain
  • 467
  • 4
  • 12
0
votes
1 answer

Audio Record in pcm format Android eclipse

I want to get voice records in a .wav file in pcm format in Android eclipse. I see data in sdcard0, but I can not listen. So I wonder about I saved or not. I read that I should add chunks i.e: RIFF header, FMT and DATA chunks.How can I do add? If…
Gianna
  • 11
  • 6
0
votes
1 answer

Half speed AudioContext from microphone when written to server

I am trying to write a microphone recording on client javascript, transfer it to server then convert it to silk. I have the audio playing back on server using the Speaker module using these settings var speaker = new Speaker({ channels: 1, …
Neablis
  • 894
  • 2
  • 12
  • 30
0
votes
1 answer

Android:AudioTrack not playing completly the PCM track while Readin 1024 Bytes at a time using FileInputStream

I want to read 1024 bytes at a time using FileInputStream, and pass the byte buffer to AudioTrack which will play the 1024 bytes. I have put this is a while loop so that the entire track is played continuously. You might suggest that you could…
shivram
  • 469
  • 2
  • 10
  • 26
0
votes
1 answer

A way to decompress mp3 frames in managed code to PCM or better ADPCM

Is there a way to decompress mp3 frames in managed code to PCM or better ADPCM data without using native code dlls? DllImport and P/Invoke is restricted on platform. I'v checked NAudio and all its decompression classes for mp3 requires windows dlls…
0
votes
1 answer

how to get the pcm data of android?

i'm try to get pcm data by class AudioRecord, the source of audio from headset,it linked a device ,the device will send some wave to my app(i hope you can understand what i say).![difference device's wave],the picture at …
ahsiu
  • 123
  • 1
  • 6
0
votes
0 answers

where the conversion from 24 bit to 16 bit happens in kernel when recording

I am recording with the format of S16_LE. Even though I set the format on my dai as S24_LE it is getting recorded in 16 bit recording in Linux. Can anyone help me with this? How can I find where the conversation is happening? I am using Linux…
optimus prime
  • 764
  • 1
  • 13
  • 39
0
votes
1 answer

Do I need my codec to be ALSA or not?

I have a project that I am working on, for the purposes of this question, lets say they are wireless speakers. We are using the raspberry pi for development right now but we plan to move to our own embedded solution. The codec we've chosen fits…
Funkyguy
  • 628
  • 2
  • 10
  • 31
0
votes
1 answer

NAudio C#: How to obtain a byte array from WaveInEventArgs for further manipulation

I have developed an Android application which is working and is trying to make a C# version of it. I'm stuck at trying to retrieve the buffer data and passing it into a byte array. I have referenced my project to NAudio etc. My project now enables…
Jeany
  • 37
  • 1
  • 7