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
5
votes
4 answers

Android AudioRecord questions?

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…
dakira
  • 333
  • 3
  • 5
  • 12
5
votes
1 answer

How to set AudioStreamBasicDescription properties?

I'm trying to play PCM stream data from server using AudioQueue. PCM data format : Sample rate = 48000, num of channel = 2, Bit per sample = 16 And, server is not streaming fixed bytes to client. (variable bytes.) (ex : 30848, 128, 2764, ... bytes…
user6081283
  • 127
  • 1
  • 8
5
votes
6 answers

Problem with writing a 16bit raw PCM file

As a small experimental music piece I am attempting to program a song in standard C. The code outputs a raw PCM file which can be imported into Audacity. At the moment everything works as expected, but I'm encountering problems when trying to write…
blkrbt
  • 51
  • 1
  • 2
5
votes
1 answer

Android AudioRecord and AudioTrack codec options?

I currently use the AudioTrack and AudioRecord classes in Android. I use the pure PCM data but I was wondering what my options are for other codecs? From this page it seems I can only encode and decode using AMR narrowband? I currently set up the…
Donal Rafferty
  • 19,707
  • 39
  • 114
  • 191
5
votes
2 answers

FFmpeg avformat_open_input with memory located file

I want to decode an internet-audiostream, but I don't want to write the data to disk, so the data is located in the memory only. But when I want to decode data to raw-data, I must initialise the format-context and so I need to use…
user2492388
  • 151
  • 6
  • 15
5
votes
2 answers

How to get PCM data from a wav file?

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…
Pallab
  • 179
  • 1
  • 3
  • 16
4
votes
3 answers

Can I get raw PCM data from MediaPlayer or SoundPool?

i use eclipse with android sdk 4.0.3 api lvl 15 to create a basic music player application. I read and found that there are two main classes to play sounds. MediaPlayer and SoundPool. SoundPool has more flexibility regarding sound priority and rate…
ufk
  • 30,912
  • 70
  • 235
  • 386
4
votes
3 answers

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

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…
Peter
  • 53
  • 1
  • 1
  • 4
4
votes
0 answers

How do you load a WAV file with Sound.loadPCMFromByteArray()?

Based on the resource here (defining the structure of a WAV file), I was able to get the audio data between the 44th byte and near the end of the file (some extra meta-data exists at the end which is not necessary). But I'm having trouble loading it…
chamberlainpi
  • 4,854
  • 8
  • 32
  • 63
4
votes
0 answers

Getting raw audio samples from AVAudioPlayer

I'm loading in a .caf file with AVAudioPlayer, and I'd like to get at a pointer to the audio samples. Is there any way to go about doing this? I know AVAudioPlayer has an NSData property which I assume is the bytes read in from the .caf file. Could…
Artelis
  • 159
  • 1
  • 11
4
votes
1 answer

converting PCM-16 to AMR using AmrInputStream

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…
Ian Low
  • 399
  • 4
  • 14
4
votes
1 answer

Convert OPUS to PCM in Android Studio

As one of the components of my app, I need to be able to convert an opus file to mp3. After much looking around, I figured the best approach would be to convert the opus file into raw PCM data and then convert the PCM data to an mp3 file. After…
Moshe Goldberg
  • 461
  • 2
  • 15
4
votes
1 answer

How to play raw pcm data in iphone sdk

I am developing an application for voice chat. Now I want to play raw pcm audio data in iPhone. I could not achieve it. Can anyone help me to play pcm data?
karthikeyan
  • 111
  • 1
  • 8
4
votes
3 answers

Streaming PCM audio over tcp socket

I have a continuous stream of raw PCM audio data from a TCP socket and I want to play them. I've done so many researches and saw many samples but no result. This gist was the most close solution but the problem is, it's streaming mp3 file. So I have…
Sepehr Behroozi
  • 1,780
  • 1
  • 17
  • 32
4
votes
1 answer

Play generated PCM data in real time

I'm developing a digital audio synthesizer on a dsPIC. To begin with Im writing and testing the algorithms in matlab. For the second phase Im translating the algorithms into ANSI C (MinGW Compiler) to test on a Windows PC before porting to the…
volting
  • 16,773
  • 7
  • 36
  • 54