|
|
@ -79,7 +79,7 @@ namespace NAudio.Wave |
|
|
|
|
|
|
|
private void CreateFactChunk() |
|
|
|
{ |
|
|
|
if (this.format.Encoding != WaveFormatEncoding.Pcm) |
|
|
|
if (HasFactChunk()) |
|
|
|
{ |
|
|
|
this.writer.Write(System.Text.Encoding.ASCII.GetBytes("fact")); |
|
|
|
this.writer.Write((int)4); |
|
|
@ -88,6 +88,11 @@ namespace NAudio.Wave |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private bool HasFactChunk() |
|
|
|
{ |
|
|
|
return this.format.Encoding != WaveFormatEncoding.Pcm && this.format.BitsPerSample != 0; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The wave file name or null if not applicable
|
|
|
|
/// </summary>
|
|
|
@ -375,7 +380,7 @@ namespace NAudio.Wave |
|
|
|
|
|
|
|
private void UpdateFactChunk(BinaryWriter writer) |
|
|
|
{ |
|
|
|
if (format.Encoding != WaveFormatEncoding.Pcm) |
|
|
|
if (HasFactChunk()) |
|
|
|
{ |
|
|
|
int bitsPerSample = (format.BitsPerSample * format.Channels); |
|
|
|
if (bitsPerSample != 0) |
|
|
|