Skip to content

Commit

Permalink
Merge pull request #559 from JanOonk/patch-1
Browse files Browse the repository at this point in the history
Update WaveProviders.md
  • Loading branch information
markheath authored Nov 15, 2019
2 parents ec5266c + c81768d commit 4362fa3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Docs/WaveProviders.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public interface IWaveProvider
}
```

The `IWavePlayer` interface only needs an `IWaveProvider` passed to its `Init` method in order to be able to play audio. `WaveFileWriter.CreateWaveFile` and `MediaFoundationEncoder.EncodeToMp3` also only needs an `IWaveProvider` to dump the audio out to a WAV file. So in many cases you won't need to create a `WaveStream` implementation, just implement `IWavePlayer` and you've got an audio source that can be played or rendered to a file.
The `IWavePlayer` interface only needs an `IWaveProvider` passed to its `Init` method in order to be able to play audio. `WaveFileWriter.CreateWaveFile` and `MediaFoundationEncoder.EncodeToMp3` also only needs an `IWaveProvider` to dump the audio out to a WAV file. So in many cases you won't need to create a `WaveStream` implementation, just implement `IWaveProvider` and you've got an audio source that can be played or rendered to a file.

`BufferedWaveProvider` is a good example of a `IWaveProvider` as it has no ability to reposition - it simply returns any buffered audio from its `Read` method.

Expand Down Expand Up @@ -77,4 +77,4 @@ public int Read(float[] buffer, int offset, int sampleCount)

NAudio makes it easy to go from an `IWaveProvider` to an `ISampleProvider` with the `ToSampleProvider` extension method. You can also use `AudioFileReader` which reads a wide variety of file types and implements `ISampleProvider`.

You can get back to an `IWaveProvider` with the `ToWaveProvider` extension method. Or there's the `ToWaveProvider16` extension method if you want to go back to 16 bit integer samples.
You can get back to an `IWaveProvider` with the `ToWaveProvider` extension method. Or there's the `ToWaveProvider16` extension method if you want to go back to 16 bit integer samples.

0 comments on commit 4362fa3

Please sign in to comment.