搜尋 RIFF 區塊
[與此頁面相關聯的功能 多媒體檔案 I/O是舊版功能。 來源讀取器已取代它。 來源讀取器 已針對 Windows 10 和 Windows 11 優化。 Microsoft強烈建議新代碼盡可能使用 來源讀取器,而非使用 多媒體檔案 I/O。 Microsoft建議使用舊版 API 的現有程式代碼,盡可能改寫成使用新的 API。]
下列範例會使用 mmioDescend 函式來搜尋格式為 “WAVE” 的 “RIFF” 區塊,以確認剛開啟的檔案是波浪音頻檔案。
HMMIO hmmio;
MMCKINFO mmckinfoParent;
MMCKINFO mmckinfoSubchunk;
.
.
.
// Locate a "RIFF" chunk with a "WAVE" form type to make
// sure the file is a waveform-audio file.
mmckinfoParent.fccType = mmioFOURCC('W', 'A', 'V', 'E');
if (mmioDescend(hmmio, (LPMMCKINFO) &mmckinfoParent, NULL,
MMIO_FINDRIFF))
// The file is not a waveform-audio file.
else
// The file is a waveform-audio file