【问题标题】:Analyzing Wav file format分析 Wav 文件格式
【发布时间】:2015-09-09 03:03:30
【问题描述】:

我需要在 Wav 文件中分离数据和 Subchunk2Size。 我正在尝试为我的 MATLAB 代码的这一部分使用现成的代码,但我不明白这里发生了什么。 这是我分析 Wav 文件的来源。 enter link description here 在这部分中,我了解到 40bytes 标头存储在header 中。

 %first 40 bytes make wav header,store the header
    header=fread(fid,40);

Subchunk2Size 是我的问题。它是 4 个字节,但这里我们正在阅读 1。当我使用 4 时,我得到了错误的结果。

 %41st byte to 43rd byte,length of wav data samples 
    data_size=fread(fid,1);

这部分我也看不懂。

  %copy the 16 bit wav data samples starting from 44th byte
    [dta,count]=fread(fid,inf,'uint16');   

【问题讨论】:

    标签: matlab audio wav file-format


    【解决方案1】:

    fread 的第二个参数是维度,而不是大小。请改用第三个参数。

    【讨论】:

    • 你能解释一下吗?
    猜你喜欢
    • 1970-01-01
    • 2012-05-24
    • 2013-06-13
    • 1970-01-01
    • 1970-01-01
    • 2012-01-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多