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

📄 audio_hdr.3

📁 操作系统SunOS 4.1.3版本的源码
💻 3
字号:
.\" @(#)audio_hdr.3 1.1 92/07/30 SMI.ds Dc 7/30/92.TH AUDIO_HDR 3 "\*(Dc" "" "Audio Library".SH NAMEaudio_hdr\- audio header structure.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/audio_hdr.h>.fi.SH OVERVIEW.LPDigital audio data represents a quantized approximation of an analogaudio signal, which itself is directly proportional to the rapid changesof air pressure that we perceive as sound.Pulse Code Modulation (\s-1PCM\s0) refers to the sampling, at discreteintervals, of an audio waveform to produce a (usually linear) quantization.In order to achieve the best approximation of a signal,the highest possible sampling frequency and precision should be used.However, it is often impractical to process and store the huge amountsof data that such a practice yields..LPIn lowering the overall data rate, a number of compromises must bemade.  To begin with, the sampling frequency is generally reduced to a levelcommensurate with the quality of the audio signal.  For speech and telephony,8, 12, and 16 kHz sampling rates are typically used.  For high-fidelityaudio, 44.1 and 48 kHz sampling rates are predominant..LPSampling precision may also be reduced to yield lower data rates.Various encoding schemes further compress the signal.  Some of these,such as \(*m-law and A-law companding, map the linear.SM PCMdomain into a pseudo-logarithmic domain.  Like.SM PCMencoding, these schemes maintain a one-to-one relationship betweenindividual samples and waveform quantizations.Other encoding schemes, such as Differential and Adaptive Differential.SM PCM\s0,convolve several samples into a single.I sound unitthat must be treated as an atomic entity..LPMultiple channels of audio data may be combined into a single audio streamby interleaving individual sound units from each channel.  For eachquantized period of time, the set consisting of one sound unit from eachaudio channel is known as a.IR "sample frame" ..SH AUDIO HEADER.LPFor programming purposes, the encoding of audio data is described by an in-core.B Audio_hdrstructure.  This audio header is defined in.B <multimedia/audio_hdr.h>as follows:.RS.nf.ft Btypedef struct {	unsigned	sample_rate;		/* samples per second */	unsigned	samples_per_unit;	/* samples per unit */	unsigned	bytes_per_unit;		/* bytes per sample unit */	unsigned	channels;		/* # of interleaved channels */	unsigned	encoding;		/* data encoding format */	unsigned	data_size;		/* length of data (advisory) */} Audio_hdr;.ft P.fi.RE.LPThe.I sample_ratefield is an integer representing the sampling frequency, in samples per second,of the audio data..LPThe.I samples_per_unitand.I bytes_per_unitfields describe an individual sound unit.  For.SM PCMand related encodings, the.I samples_per_unitfield is 1, and.I bytes_per_unitgives the precision.  For encodings that group several samples together, .I bytes_per_unitreflects the size of an atomic unit of audio data..LPThe.I channelsfield describes the number of interleaved audio channels.  The quantity.RS.ft Bchannels \(** bytes_per_unit.ft P.REgives the size, in bytes, of each sample frame..LPThese four values are used to compute the byte offset given aparticular time, and vice versa.  Specifically:.RS.ft Bseconds = offset / C.broffset = seconds \(** C.ft P.REwhere:.RS.ft BC = (channels \(** bytes_per_unit \(** sample_rate) / samples_per_unit.ft P.RE.LPThe.I encodingfield enumerates the specific data encoding.  The following values are defined:.TP 35.SB AUDIO_ENCODING_ULAWISDN \(*m-law companding.TP.SB AUDIO_ENCODING_ALAWISDN A-law companding.TP.SB AUDIO_ENCODING_LINEARlinear PCM 2's-complement integer (0-center).TP.SB AUDIO_ENCODING_FLOATlinear IEEE floating-point (\(mi1. \(<= x \(<= \(pl1.).LPNote that floating-point data is normalized to \(+-1.Many signal-processing algorithms are simplified by such normalizationsince the result of the multiplication of two signals is guaranteed tolie within the acceptable range.  Thus, bounds-checking need only be performedwhen converting to or from integer representations..LPThe.I data_sizefield contains the number of bytes in the data stream.  This value isadvisory only, as this quantity is not always known in advance.  In suchcases, the special value.SB AUDIO_UNKNOWN_SIZEshould be used..SH SEE ALSO.BR audio_convert (3),.BR audio_filehdr (3),.BR audio_misc (3),.BR audio_ulaw2linear (3).

⌨️ 快捷键说明

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