想做一个录音程序,那位大虾清楚WAV的文件格式,能详细一点吗?谢谢
解决方案 »
- ActiveMovie Control Object控件的疑问
- 请教大家,为三维重建提点方法。。。
- 请问,windows shell编程中要控制文件的拷贝粘贴,那要实现哪几个COM接口啊?
- 从串口中读取大量数据15K字节/S 该如何实现?
- 对在List控件中第一列的checkbox选中与否的消息应该是什么?????
- Win32编程:关于命令行参数(不算有难度,测验一下您对VC的熟悉程度吧!)
- 请问!如何把List Control中的数据(report形式)转换成文档格式并实现打印预览和打印。急用!!高分相送!!!
- 新手问题:如何得到对话框中控件的窗口句柄?谢谢
- 安装了 msdn 2002 july 版,vc6不认?
- ADO之ODBC driver does not support the requested properties???
- 将一个socket置成非阻塞式,然后还能够再置成非阻塞式吗?
- 用DataGrid和ADO控件怎么与Access数据库连接起来??????
--------------------------------------------------------------------------------the necessary type, structure and constant defintions are in mmreg.h.all newly defined wave types must contain both a fact chunk and an extended wave format description within the 'fmt' chunk. riff wave files of type wave_format_pcm need not have the extra chunk nor the extended wave format description.fact chunkthis chunk stores file dependent information about the contents of the wave file. it currently specifies the length of the file in samples.waveformatexthe extended wave format structure is used to defined all non-pcm format wave data, and is described as follows in the include file mmreg.h:/* general extended waveform format structure *//* use this for all non pcm formats *//* (information common to all formats) */typedef struct waveformat_extended_tag {word wformattag; /* format type */word nchannels; /* number of channels (i.e. mono, stereo...) */dword nsamplespersec; /* sample rate */dword navgbytespersec; /* for buffer estimation */word nblockalign; /* block size of data */word wbitspersample; /* number of bits per sample of mono data */word cbsize; /* the count in bytes of the extra size */} waveformatex;wformattag defines the type of wave file.
nchannels number of channels in the wave, 1 for mono, 2 for stereo
nsamplespersec frequency of the sample rate of the wave file. this should be 11025, 22050, or 44100. other sample rates are allowed, but not encouraged. this rate is also used by the sample size entry in the fact chunk to determine the length in time of the data.
navgbytespersec average data rate.
playback software can estimate the buffer size using the <navgbytespersec> value.
nblockalign the block alignment (in bytes) of the data in <data-ck>.
playback software needs to process a multiple of <nblockalign> bytes of data at a time, so that the value of <nblockalign> can be used for buffer alignment.
wbitspersample this is the number of bits per sample per channel data. each channel is assumed to have the same sample resolution. if this field is not needed, then it should be set to zero.img
cbsize the size in bytes of the extra information in the wave format header not including the size of the waveformatex structure.. as an example, in the ima adpcm format cbsize is calculated as sizeof(imaadpcmwaveformat) - sizeof(waveformatex) which yeilds two. defined wformattagsexpr1 wave form registration no - hex expr2
#define wave_format_g723_adpcm 0x0014 /* antex electronics corporation */
#define wave_format_antex_adpcme 0x0033 /* antex electronics corporation */
#define wave_format_g721_adpcm 0x0040 /* antex electronics corporation */
#define wave_format_aptx 0x0025 /* audio processing technology */
#define wave_format_audiofile_af36 0x0024 /* audiofile, inc. */
#define wave_format_audiofile_af10 0x0026 /* audiofile, inc. */
#define wave_format_control_res_vqlpc 0x0034 /* control resources limited */
#define wave_format_control_res_cr10 0x0037 /* control resources limited */
#define wave_format_creative_adpcm 0x0200 /* creative labs, inc */
#define wave_format_dolby_ac2 0x0030 /* dolby laboratories */
#define wave_format_dspgroup_truespeech 0x0022 /* dsp group, inc */
#define wave_format_digistd 0x0015 /* dsp solutions, inc. */
#define wave_format_digifix 0x0016 /* dsp solutions, inc. */
#define wave_format_digireal 0x0035 /* dsp solutions, inc. */
#define wave_format_digiadpcm 0x0036 /* dsp solutions, inc. */
#define wave_format_echosc1 0x0023 /* echo speech corporation */
#define wave_format_fm_towns_snd 0x0300 /* fujitsu corp. */
#define wave_format_ibm_cvsd 0x0005 /* ibm corporation */
#define wave_format_oligsm 0x1000 /* ing c. olivetti & c., s.p.a. */
#define wave_format_oliadpcm 0x1001 /* ing c. olivetti & c., s.p.a. */
#define wave_format_olicelp 0x1002 /* ing c. olivetti & c., s.p.a. */
#define wave_format_olisbc 0x1003 /* ing c. olivetti & c., s.p.a. */
#define wave_format_oliopr 0x1004 /* ing c. olivetti & c., s.p.a. */
#define wave_format_ima_adpcm (wave_form_dvi_adpcm) /* intel corporation */
#define wave_format_dvi_adpcm 0x0011 /* intel corporation */
#define wave_format_unknown 0x0000 /* microsoft corporation */
#define wave_format_pcm 0x0001 /* microsoft corporation */
#define wave_format_adpcm 0x0002 /* microsoft corporation */
#define wave_format_alaw 0x0006 /* microsoft corporation */
#define wave_format_mulaw 0x0007 /* microsoft corporation */
#define wave_format_gsm610 0x0031 /* microsoft corporation */
#define wave_format_mpeg 0x0050 /* microsoft corporation */
#define wave_format_nms_vbxadpcm 0x0038 /* natural microsystems */
#define wave_format_oki_adpcm 0x0010 /* oki */
#define wave_format_sierra_adpcm 0x0013 /* sierra semiconductor corp */
#define wave_format_sonarc 0x0021 /* speech compression */
#define wave_format_mediaspace_adpcm 0x0012 /* videologic */
#define wave_format_yamaha_adpcm 0x0020 /* yamaha corporation of america */ unknown wave typeadded: 05/01/92
author: microsoftfact chunk
--------------------------------------------------------------------------------the necessary type, structure and constant defintions are in mmreg.h.all newly defined wave types must contain both a fact chunk and an extended wave format description within the 'fmt' chunk. riff wave files of type wave_format_pcm need not have the extra chunk nor the extended wave format description.fact chunkthis chunk stores file dependent information about the contents of the wave file. it currently specifies the length of the file in samples.waveformatexthe extended wave format structure is used to defined all non-pcm format wave data, and is described as follows in the include file mmreg.h:/* general extended waveform format structure *//* use this for all non pcm formats *//* (information common to all formats) */typedef struct waveformat_extended_tag {word wformattag; /* format type */word nchannels; /* number of channels (i.e. mono, stereo...) */dword nsamplespersec; /* sample rate */dword navgbytespersec; /* for buffer estimation */word nblockalign; /* block size of data */word wbitspersample; /* number of bits per sample of mono data */word cbsize; /* the count in bytes of the extra size */} waveformatex;wformattag defines the type of wave file.
nchannels number of channels in the wave, 1 for mono, 2 for stereo
nsamplespersec frequency of the sample rate of the wave file. this should be 11025, 22050, or 44100. other sample rates are allowed, but not encouraged. this rate is also used by the sample size entry in the fact chunk to determine the length in time of the data.
navgbytespersec average data rate.
playback software can estimate the buffer size using the <navgbytespersec> value.
nblockalign the block alignment (in bytes) of the data in <data-ck>.
playback software needs to process a multiple of <nblockalign> bytes of data at a time, so that the value of <nblockalign> can be used for buffer alignment.
wbitspersample this is the number of bits per sample per channel data. each channel is assumed to have the same sample resolution. if this field is not needed, then it should be set to zero.img
cbsize the size in bytes of the extra information in the wave format header not including the size of the waveformatex structure.. as an example, in the ima adpcm format cbsize is calculated as sizeof(imaadpcmwaveformat) - sizeof(waveformatex) which yeilds two. defined wformattagsexpr1 wave form registration no - hex expr2
#define wave_format_g723_adpcm 0x0014 /* antex electronics corporation */
#define wave_format_antex_adpcme 0x0033 /* antex electronics corporation */
#define wave_format_g721_adpcm 0x0040 /* antex electronics corporation */
#define wave_format_aptx 0x0025 /* audio processing technology */
#define wave_format_audiofile_af36 0x0024 /* audiofile, inc. */
#define wave_format_audiofile_af10 0x0026 /* audiofile, inc. */
#define wave_format_control_res_vqlpc 0x0034 /* control resources limited */
#define wave_format_control_res_cr10 0x0037 /* control resources limited */
#define wave_format_creative_adpcm 0x0200 /* creative labs, inc */
#define wave_format_dolby_ac2 0x0030 /* dolby laboratories */
#define wave_format_dspgroup_truespeech 0x0022 /* dsp group, inc */
#define wave_format_digistd 0x0015 /* dsp solutions, inc. */
#define wave_format_digifix 0x0016 /* dsp solutions, inc. */
#define wave_format_digireal 0x0035 /* dsp solutions, inc. */
#define wave_format_digiadpcm 0x0036 /* dsp solutions, inc. */
#define wave_format_echosc1 0x0023 /* echo speech corporation */
#define wave_format_fm_towns_snd 0x0300 /* fujitsu corp. */
#define wave_format_ibm_cvsd 0x0005 /* ibm corporation */
#define wave_format_oligsm 0x1000 /* ing c. olivetti & c., s.p.a. */
#define wave_format_oliadpcm 0x1001 /* ing c. olivetti & c., s.p.a. */
#define wave_format_olicelp 0x1002 /* ing c. olivetti & c., s.p.a. */
#define wave_format_olisbc 0x1003 /* ing c. olivetti & c., s.p.a. */
#define wave_format_oliopr 0x1004 /* ing c. olivetti & c., s.p.a. */
#define wave_format_ima_adpcm (wave_form_dvi_adpcm) /* intel corporation */
#define wave_format_dvi_adpcm 0x0011 /* intel corporation */
#define wave_format_unknown 0x0000 /* microsoft corporation */
#define wave_format_pcm 0x0001 /* microsoft corporation */
#define wave_format_adpcm 0x0002 /* microsoft corporation */
#define wave_format_alaw 0x0006 /* microsoft corporation */
#define wave_format_mulaw 0x0007 /* microsoft corporation */
#define wave_format_gsm610 0x0031 /* microsoft corporation */
#define wave_format_mpeg 0x0050 /* microsoft corporation */
#define wave_format_nms_vbxadpcm 0x0038 /* natural microsystems */
#define wave_format_oki_adpcm 0x0010 /* oki */
#define wave_format_sierra_adpcm 0x0013 /* sierra semiconductor corp */
#define wave_format_sonarc 0x0021 /* speech compression */
#define wave_format_mediaspace_adpcm 0x0012 /* videologic */
#define wave_format_yamaha_adpcm 0x0020 /* yamaha corporation of america */ unknown wave typeadded: 05/01/92
author: microsoftfact chunk
--------------------------------------------------------------------------------the necessary type, structure and constant defintions are in mmreg.h.all newly defined wave types must contain both a fact chunk and an extended wave format description within the 'fmt' chunk. riff wave files of type wave_format_pcm need not have the extra chunk nor the extended wave format description.fact chunkthis chunk stores file dependent information about the contents of the wave file. it currently specifies the length of the file in samples.waveformatexthe extended wave format structure is used to defined all non-pcm format wave data, and is described as follows in the include file mmreg.h:/* general extended waveform format structure *//* use this for all non pcm formats *//* (information common to all formats) */typedef struct waveformat_extended_tag {word wformattag; /* format type */word nchannels; /* number of channels (i.e. mono, stereo...) */dword nsamplespersec; /* sample rate */dword navgbytespersec; /* for buffer estimation */word nblockalign; /* block size of data */word wbitspersample; /* number of bits per sample of mono data */word cbsize; /* the count in bytes of the extra size */} waveformatex;wformattag defines the type of wave file.
nchannels number of channels in the wave, 1 for mono, 2 for stereo
nsamplespersec frequency of the sample rate of the wave file. this should be 11025, 22050, or 44100. other sample rates are allowed, but not encouraged. this rate is also used by the sample size entry in the fact chunk to determine the length in time of the data.
navgbytespersec average data rate.
playback software can estimate the buffer size using the <navgbytespersec> value.
nblockalign the block alignment (in bytes) of the data in <data-ck>.
playback software needs to process a multiple of <nblockalign> bytes of data at a time, so that the value of <nblockalign> can be used for buffer alignment.
wbitspersample this is the number of bits per sample per channel data. each channel is assumed to have the same sample resolution. if this field is not needed, then it should be set to zero.img
cbsize the size in bytes of the extra information in the wave format header not including the size of the waveformatex structure.. as an example, in the ima adpcm format cbsize is calculated as sizeof(imaadpcmwaveformat) - sizeof(waveformatex) which yeilds two. defined wformattagsexpr1 wave form registration no - hex expr2
#define wave_format_g723_adpcm 0x0014 /* antex electronics corporation */
#define wave_format_antex_adpcme 0x0033 /* antex electronics corporation */
#define wave_format_g721_adpcm 0x0040 /* antex electronics corporation */
#define wave_format_aptx 0x0025 /* audio processing technology */
#define wave_format_audiofile_af36 0x0024 /* audiofile, inc. */
#define wave_format_audiofile_af10 0x0026 /* audiofile, inc. */
#define wave_format_control_res_vqlpc 0x0034 /* control resources limited */
#define wave_format_control_res_cr10 0x0037 /* control resources limited */
#define wave_format_creative_adpcm 0x0200 /* creative labs, inc */
#define wave_format_dolby_ac2 0x0030 /* dolby laboratories */
#define wave_format_dspgroup_truespeech 0x0022 /* dsp group, inc */
#define wave_format_digistd 0x0015 /* dsp solutions, inc. */
#define wave_format_digifix 0x0016 /* dsp solutions, inc. */
#define wave_format_digireal 0x0035 /* dsp solutions, inc. */
#define wave_format_digiadpcm 0x0036 /* dsp solutions, inc. */
#define wave_format_echosc1 0x0023 /* echo speech corporation */
#define wave_format_fm_towns_snd 0x0300 /* fujitsu corp. */
#define wave_format_ibm_cvsd 0x0005 /* ibm corporation */
#define wave_format_oligsm 0x1000 /* ing c. olivetti & c., s.p.a. */
#define wave_format_oliadpcm 0x1001 /* ing c. olivetti & c., s.p.a. */
#define wave_format_olicelp 0x1002 /* ing c. olivetti & c., s.p.a. */
#define wave_format_olisbc 0x1003 /* ing c. olivetti & c., s.p.a. */
#define wave_format_oliopr 0x1004 /* ing c. olivetti & c., s.p.a. */
#define wave_format_ima_adpcm (wave_form_dvi_adpcm) /* intel corporation */
#define wave_format_dvi_adpcm 0x0011 /* intel corporation */
#define wave_format_unknown 0x0000 /* microsoft corporation */
#define wave_format_pcm 0x0001 /* microsoft corporation */
#define wave_format_adpcm 0x0002 /* microsoft corporation */
#define wave_format_alaw 0x0006 /* microsoft corporation */
#define wave_format_mulaw 0x0007 /* microsoft corporation */
#define wave_format_gsm610 0x0031 /* microsoft corporation */
#define wave_format_mpeg 0x0050 /* microsoft corporation */
#define wave_format_nms_vbxadpcm 0x0038 /* natural microsystems */
#define wave_format_oki_adpcm 0x0010 /* oki */
#define wave_format_sierra_adpcm 0x0013 /* sierra semiconductor corp */
#define wave_format_sonarc 0x0021 /* speech compression */
#define wave_format_mediaspace_adpcm 0x0012 /* videologic */
#define wave_format_yamaha_adpcm 0x0020 /* yamaha corporation of america */ unknown wave typeadded: 05/01/92
author: microsoftfact chunk
nchannels number of channels in the wave.(1 for mono)
nsamplespersec frequency the of the sample rate of wave file.
navgbytespersec average data rate.
playback software can estimate the buffer size using the <navgbytespersec> value.
nblockalign block alignment of the data.
playback software needs to process a multiple of <nblockalign> bytes of data at a time, so that the value of <nblockalign> can be used for buffer alignment.
wbitspersample this is the number of bits per sample of data.
cbsize the size in bytes of the extra information in the extended wave 'fmt' header. microsoft adpcmadded 05/01/92
author: microsoftfact chunkthis chunk is required for all wave formats other than wave_format_pcm. it stores file dependent information about the contents of the wave data. it currently specifies the time length of the data in samples.wave format header# define wave_format_adpcm (0x0002)typedef struct adpcmcoef_tag {int icoef1;int icoef2;} adpcmcoefset; typedef struct adpcmwaveformat_tag {waveformatex wfxx;word wsamplesperblock;word wnumcoef;adpcmcoefset acoeff[wnumcoef];} adpcmwaveformat;wformattag this must be set to wave_format_adpcm.
nchannels number of channels in the wave, 1 for mono, 2 for stereo.
nsamplespersec frequency of the sample rate of the wave file. this should be 11025, 22050, or 44100. other sample rates are allowed, but not encouraged.
navgbytespersec average data rate. ((nsamplespersec / nsamplesperblock) * nblockalign).
playback software can estimate the buffer size using the value.
nblockalign the block alignment (in bytes) of the data in .
nsamplespersec x channels nblockalign
8k 256
11k 256
22k 512
44k 1024
playback software needs to process a multiple of <nblockalign> bytes of data at a time, so that the value of <nblockalign> can be used for buffer alignment.
wbitspersample this is the number of bits per sample of adpcm. currently only 4 bits per sample is defined. other values are reserved.
cbsize the size in bytes of the extended information after the waveformatex structure.
for the standard wave_format_adpcm using the standard seven coefficient pairs, this is 32. if extra coefficients are added, then this value will increase.
nsamplesperblock count of number of samples per block.
(((nblockalign - (7 * nchannels)) * 8) / (wbitspersample * nchannels)) + 2.
nnumcoef count of the number of coefficient sets defined in acoef.
acoeff these are the coefficients used by the wave to play. they may be interpreted as fixed point 8.8 signed values. currently there are 7 preset coefficient sets. they must appear in the following order.
coef set coef1 coef2
0 256 0
1 512 -256
2 0 0
3 192 64
4 240 0
5 460 -208
6 392 -232
note that if even only 1 coefficient set was used to encode the file then all coefficient sets are still included. more coefficients may be added by the encoding software, but the first 7 must always be the same. note: 8.8 signed values can be divided by 256 to obtain the integer portion of the value.blockthe block has three parts, the header, data, and padding. the three together are <nblockalign> bytes.typedef struct adpcmblockheader_tag {byte bpredictor[nchannels];int idelta[nchannels];int isamp1[nchannels];int isamp2[nchannels];} adpcmblockheader;field description
bpredictor index into the acoef array to define the predictor used to encode this block.
idelta initial delta value to use.
isamp1 the second sample value of the block. when decoding this will be used as the previous sample to start decoding with.
isamp2 the first sample value of the block. when decoding this will be used as the previous' previous sample to start decoding with. datathe data is a bit string parsed in groups of (wbitspersample * nchannels). for the case of mono voice adpcm (wbitspersample = 4, nchannels = 1) we have:... ...where has or <(sample 2n + 2) (sample 2n + 3)>= ((4 bit error delta for sample (2 * n) + 2) << 4) | (4 bit error delta for sample (2 * n) + 3) for the case of stereo voice adpcm (wbitspersample = 4, nchannels = 2) we have:... ...where has or<(left channel of sample n + 2) (right channel of sample n + 2)>= ((4 bit error delta for left channel of sample n + 2) << 4) | (4 bit error delta for right channel of sample n + 2) paddingbit padding is used to round off the block to an exact byte length.the size of the padding (in bits):((nblockalign - (7 * nchannels)) * 8) - (((nsamplesperblock - 2) * nchannels) * wbitspersample)the padding does not store any data and should be made zero.
author: dsp solutions, formerly digispeechfact chunkthis chunk is required for all wave formats other than wave_format_pcm. it stores file dependent information about the contents of the wave data. it currently specifies the time length of the data in samples.wave format header# define wave_format_ibm_cvsd (0x0005)wformattag this must be set to wave_format_ibm_cvsd
nchannels number of channels in the wave, 1 for mono, 2 for stereo...
nsamplespersec frequency the source was sampled at. see chart below.
navgbytespersec average data rate. see chart below. (one of 1800, 2400, 3000, 3600, 4200, or 4800)
playback software can estimate the buffer size using the value.
nblockalign set to 2048 to provide efficient caching of file from cd-rom.
playback software needs to process a multiple of bytes of data at a time, so that the value of can be used for buffer alignment.
wbitspersample this is the number of bits per sample of data. this is always 1 for cvsd.
cbsize the size in bytes of the rest of the wave format header. this is zero for cvsd. the digispeech cvsd compression format is compatible with the ibm ps/2 speech adapter, which uses a motorola mc3418 for cvsd modulation. the motorola chip uses only one algorithm which can work at variable sampling clock rates. the cvsd algorithm compresses each input audio sample to 1 bit. an acceptable quality of sound is achieved using high sampling rates. the digispeech ds201 adapter supports six cvsd sampling frequencies, which are being used by most software using the ibm ps/2 speech adapter:sample rate bytes/second
14,400hz 1800 bytes
19,200hz 2400 bytes
24,000hz 3000 bytes
28,800hz 3600 bytes
33,600hz 4200 bytes
38,400hz 4800 bytes the cvsd format is a compression scheme which has been used by ibm and is supported by the ibm ps/2 speech adapter card. digispeech also has a card that uses this compression scheme. it is not digispeech's policy to disclose any of these algorithms to any third party vendor.ccitt standard companded wave types