⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 audio_ulaw2linear.3

📁 操作系统SunOS 4.1.3版本的源码
💻 3
字号:
.\" @(#)audio_ulaw2linear.3 1.1 92/07/30 SMI.ds Dc 7/30/92.TH AUDIO_ULAW2LINEAR 3 "\*(Dc" "" "Audio Library".SH NAMEaudio_ulaw2linear,audio_u2c,audio_u2s,audio_u2l,audio_c2u,audio_s2u,audio_l2u\- \(*m-law data conversions.SH DISCLAIMER.LPThe manual pages, header files, and object library associated with.B /usr/demo/SOUND/libaudio.aare furnished on an AS IS basis as a preliminary interface to severaluseful audio data-processing capabilities.  A future release of theoperating system may redefine the syntax or semantics of some of thefunctions described herein..SH SYNOPSIS.nf.B #include <multimedia/ulaw2linear.h>.LP.B char audio_u2c(ulaw).B unsigned char ulaw;.LP.B short audio_u2s(ulaw).B unsigned char ulaw;.LP.B long audio_u2l(ulaw).B unsigned char ulaw;.LP.B unsigned char audio_c2u(pcm).B char pcm;.LP.B unsigned char audio_s2u(pcm).B short pcm;.LP.B unsigned char audio_l2u(pcm).B long pcm;.fi.SH DESCRIPTIONThese macros are designed to make conversion to and from the format usedby the SPARCstation audio chip as easy and fast as possible..LPThe audio chip processes data encoded using \(*m-law companding, a techniquethat allows Pulse Code Modulated (\s-1PCM\s0) data to be compressedto 8 bits.  The resulting data word contains 7 bits of magnitude and ahigh-order sign bit.  By convention, the data is also subjected to aone's-complement; the.I zerovalue (i.e., half-scale) is therefore represented by the \(*m-law value 0xFF..LPThe \(*m-law transfer function results in a nearly linear relationship to.SM PCMat low amplitudes and a logarithmic relationship at high amplitudes.Thus, it is not reasonable to perform arithmetic operations(such as would be performed on.SM PCMdata) directly on the encoded data.For instance, to sum two \(*m-law values, the following two lines of codewill give very different answers (the second is correct):.ft B.nf	wrong = (ulaw1 + ulaw2);	right = audio_s2u(audio_u2s(ulaw1) + audio_u2s(ulaw2));.fi.ft R.LP.BR audio_u2c(\|) ,.BR audio_u2s(\|) ,and.B audio_u2l(\|)convert \(*m-law data to.SM PCMsigned integers of 8, 16, or 32 bit precision, respectively.Since \(*m-law data represents approximately 13 bits of precisionto begin with, theconversion to 8-bit integers loses precision, while the conversion to 32-bit integers is provided merely as a convenience..LP.BR audio_c2u(\|) ,.BR audio_s2u(\|) ,and.B audio_l2u(\|)convert 8, 16, and 32 bit.SM PCMsigned integers to their \(*m-law encoded form..SH SEE ALSO.BR audio_convert (3).

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -