0
* .wavファイルの想定内容を読んだ後、なぜゼロになっているのか分かりません。出力の画像にバイナリリーダーが* .wavの内容を読み取らない理由
リンク:助けを事前にhttp://imgur.com/a/rZWes
using (BinaryReader reader = new BinaryReader(File.Open("test.wav", FileMode.Open))) {
// Read the wave file header from the buffer.
int chunkID = reader.ReadInt32(); print (chunkID);
int fileSize = reader.ReadInt32(); print (fileSize);
int riffType = reader.ReadInt32(); print (riffType);
int fmtID = reader.ReadInt32(); print (fmtID);
int fmtSize = reader.ReadInt32(); print (fmtSize);
int fmtCode = reader.ReadInt16(); print (fmtCode);
int channels = reader.ReadInt16(); print (channels);
int sampleRate = reader.ReadInt32(); print (sampleRate);
int fmtAvgBPS = reader.ReadInt32(); print (fmtAvgBPS);
int fmtBlockAlign = reader.ReadInt16(); print (fmtBlockAlign);
int bitDepth = reader.ReadInt16(); print (bitDepth);
int dataID = reader.ReadInt32(); print (dataID);
int dataSize = reader.ReadInt32(); print (dataSize);
byteArray = reader.ReadBytes(dataSize);
// After this you have to split that byte array for each channel (Left,Right)
// Wav supports many channels, so you have to read channel from header
}
ありがとう!
あなたの 'print'関数とは何ですか? –
エンディアンの問題? https://en.wikipedia.org/wiki/Endianness –
画像をリンクするのではなく、質問の出力を投稿する必要があります。また、結果を確認するために16進エディタでwavファイルを調べてみましたか? – juharr