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

📄 audio_misc.3

📁 操作系统SunOS 4.1.3版本的源码
💻 3
字号:
.\" @(#)audio_misc.3 1.1 92/07/30 SMI.ds Dc 7/30/92.TH AUDIO_MISC 3 "\*(Dc" "" "Audio Library".SH NAMEaudio_misc,audio_bytes_to_secs,audio_secs_to_bytes,audio_str_to_secs,audio_secs_to_str,audio_cmp_hdr,audio_enc_to_str\- miscellaneous audio functions.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/libaudio.h>.LP.B double audio_bytes_to_secs(hp, cnt).B Audio_hdr *hp;.B unsigned cnt;.LP.B unsigned audio_secs_to_bytes(hp, secs).B Audio_hdr *hp;.B double secs;.LP.B double audio_str_to_secs(str).B char *str;.LP.B char *audio_secs_to_str(secs, str, precision).B double secs;.B char *str;.B int precision;.LP.B int audio_cmp_hdr(hp1, hp2).B Audio_hdr *hp1;.B Audio_hdr *hp2;.LP.B int audio_enc_to_str(hp, str).B Audio_hdr *hp;.B char *str;.fi.SH DESCRIPTIONThese functions perform some simple, useful transformations..LP.B audio_bytes_to_secs(\|)converts a byte count into a floating-point time value that is appropriateto the encoding described by the given audio header.The time value returned indicates the number of seconds of data thatwould correspond to.I cntbytes.Note that a byte count is not the same as an offset in an audio file, sincethe size of the audio file header is not taken into account..LP.B audio_secs_to_bytes(\|)converts a floating-point time value into a byte count that is appropriateto the encoding described by the given audio header.The byte count is rounded down to a sample frame boundary; this guaranteesthat the returned count will not refer to an offset in the middle of amulti-byte sample frame..LP.B audio_str_to_secs(\|)converts an.SM ASCIIstring into a floating-point time value, in seconds.The string should take the form:.RS[\fIhh\fP:][\fImm\fP:][\fIss\fP][.\fIdd\fP].RE.LPFor example,the following strings all convert to to the floating-point value 90.5:.RS.ft B.LP90.5.br1:30.5.br0:01:30.500.ft P.RE.LPIf the given string contains a syntax error, the value.SB HUGE_VALis returned..LP.B audio_secs_to_str(\|)converts a floating-point time value into an.SM ASCIIstring of the form\fIhh\fP:\fImm\fP:\fIss\fP.\fIdd\fP.As a special case, the value.SB HUGE_VALis converted to the string \"0\:00\".The.I precisionargument specifies the maximum number of digits to appear after thedecimal point.  A precision of \-1 guarantees the maximum precisionnecessary to represent the given time.  The.I strargument is a pointer to a buffer of at least.SB AUDIO_MAX_TIMEVALbytes.  For convenience, the address of the converted stringis returned as the function value..LP.B audio_cmp_hdr(\|)compares the encoding information fields of the two specified audioheaders, returning 0 if they are identical.  If the encodingtype and precision match but the sample rates are different, 1 isreturned.  Otherwise, \-1 is returned..LP.B audio_enc_to_str(\|)converts the encoding information in the given audio header to a printable.SM ASCIIstring, e.g.:.RS.ft Bmono 8-bit u-law @ 8kHz.brstereo 16-bit linear PCM @ 44.1kHz.ft P.RE.LPThe.I strargument is a pointer to a buffer of at least.SB AUDIO_MAX_ENCODE_INFObytes.On successful completion, the value.SB AUDIO_SUCCESSis returned.If any fields of the audio header cannot be interpreted, the value.SB AUDIO_ERR_BADHDRis returned, with an appropriate string stored in the buffer..SH SEE ALSO.BR audio_hdr (3).

⌨️ 快捷键说明

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