C# Класс NAudio.Wave.AudioFileReader

AudioFileReader simplifies opening an audio file in NAudio Simply pass in the filename, and it will attempt to open the file and set up a conversion path that turns into PCM IEEE float. ACM codecs will be used for conversion. It provides a volume property and implements both WaveStream and ISampleProvider, making it possibly the only stage in your audio pipeline necessary for simple playback scenarios
Наследование: WaveStream, ISampleProvider
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AudioFileReader ( string fileName ) : System

Initializes a new instance of AudioFileReader

Read ( byte buffer, int offset, int count ) : int

Reads from this wave stream

Read ( float buffer, int offset, int count ) : int

Reads audio from this sample provider

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

Disposes this AudioFileReader

Приватные методы

Метод Описание
CreateReaderStream ( string fileName ) : void

Creates the reader stream, supporting all filetypes in the core NAudio library, and ensuring we are in PCM format

DestToSource ( long destBytes ) : long

Helper to convert dest to source bytes

SourceToDest ( long sourceBytes ) : long

Helper to convert source to dest bytes

Описание методов

AudioFileReader() публичный Метод

Initializes a new instance of AudioFileReader
public AudioFileReader ( string fileName ) : System
fileName string The file to open
Результат System

Dispose() защищенный Метод

Disposes this AudioFileReader
protected Dispose ( bool disposing ) : void
disposing bool True if called from Dispose
Результат void

Read() публичный Метод

Reads from this wave stream
public Read ( byte buffer, int offset, int count ) : int
buffer byte Audio buffer
offset int Offset into buffer
count int Number of bytes required
Результат int

Read() публичный Метод

Reads audio from this sample provider
public Read ( float buffer, int offset, int count ) : int
buffer float Sample buffer
offset int Offset into sample buffer
count int Number of samples required
Результат int