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

C: print an integer array as binary data

I want to record data from a microphone using alsa. This command: int buf[4096]; memset(buf, 0, sizeof(buf)); snd_pcm_readi(capture_handle, buf, avail); writes the microphone data into the integer buffer buf. ( I am not sure if the data that is…
relot
  • 651
  • 1
  • 6
  • 18
0
votes
0 answers

The java sound api doesn't seem to accept a .wav file with codec - IMA WAV ADPCM

I am trying to calculate the duration of .wav files using java sound api . Java sound api supports .wav files with PCM S16LE codec but it doesn't seem to support .wav file with IMA WAV ADPCM codec. Is there any library that can help me get the…
Divyaa
  • 45
  • 1
  • 6
0
votes
1 answer

AWS Polly Text to Downloadable Audio PCM File Not Working

I have a page that has jquery and the amazon SDK. There is text in an area box that the user can change. I successfully make the request to Amazon. I get back the PCM AudioStream (Int16Array). How do I then convert this stream to a downloadable PCM…
0
votes
1 answer

Android merging PCM and MP3 into AAC

I have a program that records user input sound as PCM (I needed to do it separately to "play" with the voice) and then I also have a custom audio track, which is in MP3 format, that I want merge with the PCM file. To start off I convert both of…
Richard
  • 1,087
  • 18
  • 52
0
votes
1 answer

AAC audio files play faster than normal speed

I sampled the raw PCM data from the device, encoded it through libfaac to an audio file in ".aac" format(ADTS format), and when I sampled it in 16KHZ or 41KHZ the encoded ".aac" file played faster than normal. What's the reason? The parameter…
YuanDa.Yu
  • 127
  • 7
0
votes
1 answer

Identifying dominant frequency in recorded sound in Android

I'm trying to convert the Python program located at https://github.com/rraval/pied-piper/blob/master/decode.py to an Android Java file. The first step is to identify the dominant frequency. I have written the following Java program to do…
Arun
  • 3,036
  • 3
  • 35
  • 57
0
votes
1 answer

Coverting raw PCM file to MP3 with LAME returns distorted audio

I have raw PCM files generated from a base64 string. Here is the link to the API response that returns in.. I then create a PCM file from this string, after which I convert it to MP3 using the LAME library. Here is the code that deals with the…
Glenncito
  • 902
  • 1
  • 10
  • 23
0
votes
0 answers

How can I get pcm data from mp3 files?

I want to import the PCM data of an mp3 file. I tried the mediaCodec but it failed. Is there a way to do this? Use mediaFormat to change to a raw file, then decode it with mediaCodec to create a raw file of the same size as the mp3 file. However, it…
Taek
  • 1
  • 4
0
votes
2 answers

PCM to AAC with FAAC, numberBytesWritten >> 16bits?

Next iteration of my question: Thank you for your inputs, it has helped me to understand a little bit more about the Frame and inputSamples utility. I’ve done modifications to my source code with the new knowledge you’ve given me. But I still have…
manBear
  • 1
  • 1
  • 3
0
votes
2 answers

Java - Adjust playback speed of a WAV file

I'm likely dense but I cannot seem to find a solution to my issue (NOTE: I CAN find lots of people reporting this issue, seems like it happened as a result of newer Java (possible 1.5?). Perhaps SAMPLE_RATE is no longer supported? I am unable to…
Alan Pauley
  • 121
  • 1
  • 10
0
votes
1 answer

Addition of PCM Audio Files - Mixing Audio

I am posed with the task of mixing raw data from audio files. I am currently struggling to get a clean sound from mixing the data, I keep getting distortion or white noise. Lets say that I have a two byte array of data from two AudioInputStream's. …
Ivaan
  • 36
  • 4
0
votes
0 answers

ALSA lib ../../../alsa-lib-1.1.0/src/pcm/pcm_dmix.c:1029:(snd_pcm_dmix_open) unable to open slave

OS: NXP in yocto(arm embedded) ON_RECOGNIZING_SPEECH_FINISHED: {u'text': u'who are you'} ALSA lib ../../../alsa-lib-1.1.0/src/pcm/pcm_dmix.c:1029:(snd_pcm_dmix_open) unable to open slave [ERROR:audio_output_stream.cc(61)] Device could not be…
DanielHsu
  • 115
  • 4
  • 10
0
votes
1 answer

audiotrack: playing noise for a raw pcm 16bit wav file

I am trying to play a wav file of size 230mb and 20 min whose properties are as below: ffmpeg -i 1.wav Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s I am learning how to use audiotrack. I found two…
Santhosh
  • 9,965
  • 20
  • 103
  • 243
0
votes
1 answer

Send the data as-is to the audio device in Xamarin.Forms

I have a custom Audio DAC device. I can connect it with Android/iOS smartphone by OTG cable. The main question is how to supply byte stream audio to the my device? In UWP application I'm using NAdio which provides wrapper for WASAPI with exclusive…
user3818229
  • 1,537
  • 2
  • 21
  • 46
0
votes
1 answer

Is it possible to supply raw audio (byte stream) data in UWP application?

I have a custom Audio DAC device. It has own controller inside and knows how to work with a certain byte stream. There is a library I'm trying to use: Audio Graph. I generate some data in memory and send it like so: private unsafe AudioFrame…
user3818229
  • 1,537
  • 2
  • 21
  • 46