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
3 answers

Converting wav file to mono

I'm trying to convert a stereo .wav file to mono using NAudio. One requirement is that I cannot use any native calls, as I need to run this code on Azure. Here's what I came with: using (var waveFileReader = new WaveFileReader(sourceFileName)) …
ulu
  • 5,872
  • 4
  • 42
  • 51
0
votes
0 answers

Transmit string Array over audio cable using java PCM

My objective is very simple, I want to transmit string data from PC1 to PC2 through an audio cable using the PCM methodology. However, I'm encountering some problems when I record the data from PC2. In fact I was expecting ASCII numeric values,…
Ale
  • 21
  • 1
  • 2
0
votes
2 answers

Where can I get the original PCM data from the Android framework?

Where can I get the original pcm data from the Android framework? I think I can get it from: Write (const void * buffer, size_t userSize, bool blocking) in /framework/av/media/libmedia/AudioTrack.cpp However, it differs from the pcm data in the…
share id
  • 3
  • 1
0
votes
2 answers

naudio: playing from pcm byte stream

I am trying to stream audio bytes into an naudio waveout stream but it isn't working. Here is the pseudocode: byte[] by = new byte[2560] //audio packet sizes int counter=0; while (true) { //keep receiving bytes from incoming TCP socket int…
E.D.
  • 215
  • 3
  • 16
0
votes
1 answer

Is Spotify Android API audio delivered in raw PCM?

I am wanting to write a Spotify Android plug-in to perform audio pre-processing prior to playback. Judging by the documentation for com.spotify.sdk.android.player.AudioController.onAudioDataDelivered: samples - 16-bit PCM data. The buffer contains…
Miguel
  • 35
  • 1
  • 7
0
votes
0 answers

Why is Java's TargetDataLine.read() so slow?

I am developing a VOIP application that uses Java's built in TargetDataLine.read() method to store microphone input in a byte array buffer. However, this function seems to run for around 500ms longer than it should. Why is there this extra latency…
Syd Lambert
  • 1,415
  • 14
  • 16
0
votes
2 answers

Converting RAW 24bit Signed PCM to 32bit PCM raw

I am a newbie here. I am looking to know about any tool/quick way to convert a 24bit PCM raw(headerless) file, having 3 byte PCM samples, into a 32 bit PCM raw file which has 4 bytes per sample, with the MSByte of the 4 byte data as sign/zero…
goldenmean
  • 18,376
  • 54
  • 154
  • 211
0
votes
1 answer

LibGDX, Android audio spectrum analyse from MP3

I'm trying to make a game that generate level from an audio track (MP3). But LibGDX audio analyse support was removed since 2012, and other methods I found on the web are not available for Android. The only thing I need at the moment is to read the…
KiraLeOuf
  • 23
  • 6
0
votes
1 answer

How to get frequency and pitch from a pcm byte array .wav file using java?

I am currently new to this, so kindly keep it simple for me to understand. I have a project in which I have to classify the voice as good, bad or neutral. My plan is to get all the frequencies and pitch of the sample data set and train them using…
0
votes
0 answers

alsa snd_device_name_get_hint with card index

I created a custom sound device in ~/.asoundrc or /etc/asound.conf. Now i call my sound client with the parameter for the sound device and want to check if this device exists. I found it easier to use the actual card and device index instead of…
Meldryt
  • 99
  • 1
  • 9
0
votes
0 answers

OPUS decode raw PCM data

I am trying to compress and decompress raw PCM (16-Bit) audio, using OPUS. Here below is my code for opus_encoder.c. If I remove my decoder.c, the buffer works just fine as in the microphone is able to take in raw PCM data. However, once I have…
omg99123
  • 1
  • 2
0
votes
0 answers

How to record a pcm mp4 with FFmpegFrameRecorder on Android?

How can i get a pcm mp4 with FFmpegFrameRecorder?I see it suppout pcm format.I try like below: mFrameRecorder = new FFmpegFrameRecorder(mVideo, videoWidth, videoHeight, 1); mFrameRecorder.setFormat("mp4"); …
DoubleCui
  • 49
  • 1
  • 1
  • 9
0
votes
0 answers

How do you render an audio data like this?

How would you render an audio wave form like this from PCM data?
jshbrntt
  • 5,134
  • 6
  • 31
  • 60
0
votes
0 answers

C++ Read/Write 16 bit integer file by blocks

So I write a log file containing 16 bit integer data. Using the following way. std::ofstream waveform; waveform.open("waveform.iq"); cout << "Opening file for waveform " << endl; LOOP WRITING BUFFER VALUES TO THE FILE waveform << R0 << std::endl;…
jav321
  • 151
  • 2
  • 11
0
votes
1 answer

how to use Lame library in android to convert .Pcm file to Mp3

I am using Lame library to convert pcm file to mp3 in android. using this link I compiled it and every thing is ok. but I don't know how to use this library to convert .Pcm file to .Mp3 in android studio. any sample code or any hint would be…
unos baghaii
  • 2,539
  • 4
  • 25
  • 42