Skip to content

Commit

Permalink
fixing some compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
markheath committed Oct 1, 2015
1 parent e2f9a2f commit ccf61fa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
1 change: 1 addition & 0 deletions NAudio/NAudio.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
<DocumentationFile>bin\Debug\NAudio.XML</DocumentationFile>
<PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisRuleSet>NAudio.ruleset</CodeAnalysisRuleSet>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand Down
23 changes: 11 additions & 12 deletions NAudio/Wave/WaveStreams/RawSourceWaveStream.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

// ReSharper disable once CheckNamespace
namespace NAudio.Wave
{
/// <summary>
Expand All @@ -11,8 +10,8 @@ namespace NAudio.Wave
/// </summary>
public class RawSourceWaveStream : WaveStream
{
private Stream sourceStream;
private WaveFormat waveFormat;
private readonly Stream sourceStream;
private readonly WaveFormat waveFormat;

/// <summary>
/// Initialises a new instance of RawSourceWaveStream
Expand All @@ -28,13 +27,13 @@ public RawSourceWaveStream(Stream sourceStream, WaveFormat waveFormat)
/// <summary>
/// Initialises a new instance of RawSourceWaveStream
/// </summary>
/// <param name="sourceBuffer">The buffer containing raw audio</param>
/// <param name="sourceOffset">Offset in the source buffer to read from</param>
/// <param name="sourceCount">Number of bytes to read in the buffer</param>
/// <param name="byteStream">The buffer containing raw audio</param>
/// <param name="offset">Offset in the source buffer to read from</param>
/// <param name="count">Number of bytes to read in the buffer</param>
/// <param name="waveFormat">The waveformat of the audio in the source stream</param>
public RawSourceWaveStream(byte[] byteStream, int offset, int count, WaveFormat waveFormat)
{
this.sourceStream = new MemoryStream(byteStream, offset, count);
sourceStream = new MemoryStream(byteStream, offset, count);
this.waveFormat = waveFormat;
}

Expand All @@ -43,15 +42,15 @@ public RawSourceWaveStream(byte[] byteStream, int offset, int count, WaveFormat
/// </summary>
public override WaveFormat WaveFormat
{
get { return this.waveFormat; }
get { return waveFormat; }
}

/// <summary>
/// The length in bytes of this stream (if supported)
/// </summary>
public override long Length
{
get { return this.sourceStream.Length; }
get { return sourceStream.Length; }
}

/// <summary>
Expand All @@ -61,11 +60,11 @@ public override long Position
{
get
{
return this.sourceStream.Position;
return sourceStream.Position;
}
set
{
this.sourceStream.Position = value - (value % waveFormat.BlockAlign);
sourceStream.Position = value - (value % waveFormat.BlockAlign);
}
}

Expand Down

0 comments on commit ccf61fa

Please sign in to comment.