.wav文件有文件头,在文件头里面有个字段指示编码格式。
到win32的帮助文件看看WAVEFORMATEX结构就知道了。

解决方案 »

  1.   

    您能不能再讲详细点,那个字段是不是FarmatTag?如果是,那么它的哪个值对应A律,哪个值对应u律
      

  2.   

    打开头文件mmreg.h、mmsystem.h,里面有定义:
    #define  WAVE_FORMAT_ALAW                       0x0006 /* Microsoft Corporation */
    #define  WAVE_FORMAT_MULAW                      0x0007 /* Microsoft Corporation */
      

  3.   

    我查了下,头文件里定义wav文件的文件头中Format Chunk中的FormatTag字段如下
    0x0001 pcm
    0x0006 A 律PCM
    0x0007 u 律PCM那么0x0001到底是A律还是u律呢?附定义:
    defined   wformattags   
        
      expr1   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   */  
      

  4.   

    1的线性PCM格式嘛,6是A率,7是U率,不是都很清楚了吗。
      

  5.   

    我的理解.一般的都是pcm的格式。
      

  6.   

    pcm是原始数据原封不动地量化编码(这种量化的位宽大),A律pcm是经过压扩后的非均匀量化(小信号细量化大信号粗量化),U律pcm是经过压扩后的均匀量化(A/U律量化的位宽小)。