pcm是什么音频格式_pcm转mp3

pcm是什么音频格式_pcm转mp3【文章内容属于多方转载内容】PCMParametersPCMaudioiscodedusingacombinationofvariousparameters.Resoluti

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE使用 1年只要46元 售后保障 童叟无欺

【文章内容属于多方转载内容】

PCM Parameters

 

PCM audio is coded using a combination of various parameters.

Resolution/Sample Size

This parameter specifies the amount of data used to represent each discrete amplitude sample. The most common values are 8 bits (1 byte), which gives a range of 256 amplitude steps, or 16 bits (2 bytes), which gives a range of 65536 amplitude steps. Other sizes, such as 12, 20, and 24 bits, are occasionally seen. Some king-sized formats even opt for 32 and 64 bits per sample.

Byte Order

When more than one byte is used to represent a PCM sample, the byte order (big endian vs. little endian) must be known. Due to the widespread use of little-endian Intel CPUs, little-endian PCM tends to be the most common byte orientation.

Sign

It is not enough to know that a PCM sample is, for example, 8 bits wide. Whether the sample is signed or unsigned is needed to understand the range. If the sample is unsigned, the sample range is 0..255 with a centerpoint of 128. If the sample is signed, the sample range is -128..127 with a centerpoint of 0. If a PCM type is signed, the sign encoding is almost always 2’s complement. In very rare cases, signed PCM audio is represented as a series of sign/magnitude coded numbers.

Channels And Interleaving

If the PCM type is monaural, each sample will belong to that one channel. If there is more than one channel, the channels will almost always be interleaved: Left sample, right sample, left, right, etc., in the case of stereo interleaved data. In some rare cases, usually when optimized for special playback hardware, chunks of audio destined for different channels will not be interleaved.

Frequency And Sample Rate

This parameter measures how many samples/channel are played each second. Frequency is measured in samples/second (Hz). Common frequency values include 8000, 11025, 16000, 22050, 32000, 44100, and 48000 Hz.

Integer Or Floating Point

Most PCM formats encode samples using integers. However, some applications which demand higher precision will store and process PCM samples using floating point numbers.

Floating-point PCM samples (32- or 64-bit in size) are zero-centred and varies in the interval [-1.0, 1.0], thus signed values.

PCM Types

Linear PCM

The most common PCM type.

Logarithmic PCM

Rather than representing sample amplitudes on a linear scale as linear PCM coding does, logarithmic PCM coding plots the amplitudes on a logarithmic scale. Log PCM is more often used in telephony and communications applications than in entertainment multimedia applications.

There are two major variants of log PCM: mu-law (u-law) and A-law. Mu-law coding uses the format number 0x07 in Microsoft multimedia files (WAV/AVI/ASF) and the fourcc ‘ulaw’ in Apple Quicktime files. A-law coding uses the format number 0x06 is Microsoft multimedia files and the fourcc ‘alaw’ in Apple Quicktime files.

Every byte of a log PCM data chunk maps to a signed 16-bit linear PCM sample. [TODO: Add either the conversion tables or conversion formulas]

Differential PCM

Values are encoded as differences between the current and the previous value. This reduces the number of bits required per audio sample by about 25% compared to PCM.

Adaptive DPCM

The size of the quantization step is varied to allow further reduction of the required bandwidth for a given signal-to-noise ratio.

Platform-Specific PCM Identifiers And Characteristics

This section describes how different computing platforms store PCM audio data and any format identifiers they use.

DOS/Windows

The first widely available, PC audio card that could play back PCM audio was the Creative Labs’ Sound Blaster. This drove the audio format for a lot of early audio-capable DOS applications and games. The original Sound Blaster could only play mono, unsigned 8-bit PCM data. Later Sound Blaster cards were capable of playing back 16-bit audio data. However, while these cards still played unsigned 8-bit PCM data, 16-bit data needed be signed.

Likely owing to the DOS/Intel little endian architecture, 16-bit PCM for the Sound Blaster also needs to be little endian.

Further, the original Sound Blaster was somewhat limited in the frequencies that it could support. The digital to analog conversion hardware (DAC) had to be programmed with a byte value (frequency divisor) that was processed through the following formula to yield the final playback frequency:

frequency = 1000000 / (256 - frequency_divisor)

A common divisor is 211 which yields an integer frequency of 22222 Hz, a common rate in the days of the Sound Blaster. Note that while very low frequencies (all the way down to 3921 Hz) were supported, frequencies above 45454 Hz were not.

Microsoft WAV/AVI/ASF Identifiers

Microsoft multimedia file formats such as WAVAVI, and ASF all share the WAVEFORMATEX data structure. The structure defines, among other properties, a 16-bit little endian audio identifier. The following audio identifiers correspond to various PCM formats:

  • 0x0001 denotes linear PCM
  • 0x0006 denotes A-law logarithmic PCM
  • 0x0007 denotes mu-law logarithmic PCM

Apple Macintosh

Native sample rates of early Apple Macintosh audio hardware included 11127 Hz and 22254 Hz. These sample rates are commonly seen in early QuickTime files.

Apple QuickTime Identifiers

Audio information in QuickTime files is stored along with an stsd atom that contains a FOURCC to indicate the format type. Apple QuickTime accomodates a number of different PCM formats:

  • ‘raw ‘ (need space character, ASCII 0x20, to round out FOURCC) denotes unsigned, linear PCM. 16-bit data is stored in little endian format.
  • ‘twos’ denotes signed (i.e. twos-complement) linear PCM. 16-bit data is stored in big endian format.
  • ‘sowt’ (‘twos’ spelled backwards) also denotes signed linear PCM. However, 16-bit data is stored in little endian format.
  • ‘in24’ denotes 24-bit, big endian, linear PCM.
  • ‘in32’ denotes 32-bit, big endian, linear PCM.
  • ‘fl32’ denotes 32-bit floating point PCM. (Presumably IEEE 32-bit; byte order?)
  • ‘fl64’ denotes 64-bit floating point PCM. (Presumably IEEE 64-bit; byte order?)
  • ‘alaw’ denotes A-law logarithmic PCM.
  • ‘ulaw’ denotes mu-law logarithmic PCM.

Red Book CD Audio

The “Red Book” defines the format of a standard audio compact disc (CD). The audio data on a standard CD consists of 16-bit linear PCM samples stored in little endian format, replayed at 44100 Hz (hence the standard term “CD-quality audio”), with left-right stereo interleaving.

Sega CD

Games made for the Sega CD, an add-on for the Sega Genesis game console, all seem to use sign-magnitude coding to store PCM information. It is a good guess that the Sega CD unit has custom hardware to play this format natively.

Sega Saturn

Games made for the Sega Saturn video game console generally seem to store PCM data as signed, 8-bit data or signed, big endian, 16-bit data. The curious property of the PCM, however, is the stereo handling. Generally, multimedia files on Sega Saturn games (most often stored using the Sega FILM format) would store a block of left channel information followed by a block of right channel information rather than interleaving left and right samples. This is likely due to custom multi-channel audio hardware in which individual channels are assigned pan positions. For playing stereo data, one channel is assigned extreme left and another is assigned extreme right. The correct samples are sent to their respective channels. Interleaved data would require deinterleaving before playback.

DVD PCM

Standard Video-DVDs can contain 16-bit, 20-bit and 24-bit signed, linear PCM (often called LPCM) streams. A stream can consist of up to 8 channels as long as the maximum bandwidth of 6.144 mbit/sec for any LPCM audio stream is not exceeded. Two samplerates are supported: 48kHz and 96kHz.

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/166537.html原文链接:https://javaforall.cn

【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛

【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...

(0)


相关推荐

  • 递归下降算法_递归下降分析程序得到的经验

    递归下降算法_递归下降分析程序得到的经验递归下降算法算法模型:Term=Term+ExprExpr=Expr+FactorFactor=单个元素。最小单位。 实现原理:一个程式进入算法及被看作是一个项,分解成项加表达式的形式,表达式被分解成表达式加因子的形式,因子是这个算法中的最小单位。上一级调用比自己小一级的自己。这里三层分离,越下层模型中所形成的优先级就会越高。 我用递归下降算法写了个简单的计算器,递归算法为我的运算符号…

  • Kotlin与Java的异同(一)

    Kotlin与Java的异同(一)Kotlin简介Kotlin是一种针对Java平台的新编程语言。Kotlin简洁、安全、务实,并且专注于与Java代码的互操作性。它几乎可以用在现在Java使用的任何地方:服务端开发、Android应用等等。Kotlin可以很好地和所有现存的Java库和框架一起工作,而且性能和Java旗鼓相当。Kotlin特点:Kotlin是静态类型语言并支持类型推导,允许维护正确性与性能的同时保…

  • 纯CSS画三角形

    纯CSS画三角形之前遇到过的问题如果查了然后懂了,然后没有及时复盘思考,就很容易还回去,今天把许久之前的这个知识点再整理一下,一是加深自己的记忆,二也是让初学者更容易懂。首先,创建一个空的div<divclass="triangle"></div>然后,CSS处理它的边框,给它不一样的颜色,好观察.triangle{border-left:100pxs…

  • spawn-fcgi原理及源代码分析

    spawn-fcgi原理及源代码分析spawn-fcgi是一个小程序,作用是管理fast-cgi进程,功能和php-fpm类似,简单小巧,原先是属于lighttpd的一部分。后来因为使用比較广泛。所以就迁移出来作为独立项目了。本文介绍的

  • VS无法打开源文件

    VS无法打开源文件通过一天的时间终于弄出来了,无法找到源文件的主要原因其实就是你删了某一个文件夹,他找不到了。这是我查这么多最贴合实际的一次,其他的调的,可能也可以解决,不过会有其他问题产生,无法打开元文件。搞了半天还是不行,主要是没有从根本上下手。推荐一个链接,解决这个问题:解决无法打开源文件…

  • OHEM[通俗易懂]

    OHEM[通俗易懂]TrainingRegion-basedObjectDetectorswithOnlineHardExampleMining00Astract摘要主要讲了四点:(1)训练过程需要进行参数的空间搜索(2)简单样本与难分辨样本之间的类别不平衡是亟需解决的问题(3)自动地选择难分辨样本来进行训练不仅效率高而且性能好(4)提出了OHEM算法,不仅效率高而且性能好,在各种数据集上表…

发表回复

您的电子邮箱地址不会被公开。

关注全栈程序员社区公众号