所以这就是我所拥有的:
我面临的问题需要我从 WAV1 获取一个专门的标头,并将其作为 WAV2 的标头,以使 WAV2 与我正在使用的 API 一起工作。但是,每当我尝试将 WAV2 的前 38 个字符替换为 WAV1 的前 38 个字符时,当我尝试播放文件时都会收到错误消息,提示文件格式不正确。WAV1 和 WAV2 在编辑前都能正常播放。
你们知道我做错了什么吗?
非常感谢你的帮助。
-Rhynorater。
Wav format is a standardised format (see https://ccrma.stanford.edu/courses/422/projects/WaveFormat/ for details about file format). I'm not sure what a "specialized" header is (perhaps you could clarify what your specialised header is?) as the format is standard - any variation would not be a wav file.
The first 38 bytes of a wav file are the header and should adhere to the standard. You cannot copy the header from one file and use it for another as the header contains information specific to the individual file (number of channels, sample rate, file length, etc).
If you both files playback normally (how are you testing this?) I'm not sure why the API you are using is not compatible (which API are you using?).