public class Mp3WebStream : IWaveSource
An IWaveSource implementation for streaming mp3 streams like mp3 radio stations, etc.
ConnectionEstablished
Occurs when connection got established and the async argument of the constructor was set to true.
public ConnectionEstablished
Mp3WebStream(String address)
Initializes a new instance of the Mp3WebStream class.
public void Mp3WebStream(String address)
Parameters
address
StringThe address of the mp3 stream.
Mp3WebStream(String address, Boolean async)
Initializes a new instance of the Mp3WebStream class.
public void Mp3WebStream(String address, Boolean async)
Parameters
address
StringThe address of the mp3 stream.
async
BooleanIf set to true, the connection will be established asynchronously and the constructor will return immediately. Doing that, requires the usage of the ConnectionEstablished event which will notify the caller when the Mp3WebStream is ready for use. If set to false the constructor will block the current thread as long as it takes to establish the connection.
Mp3WebStream(Uri address)
Initializes a new instance of the Mp3WebStream class.
public void Mp3WebStream(Uri address)
Parameters
address
UriThe address of the mp3 stream.
Mp3WebStream(Uri address, Boolean async)
Initializes a new instance of the Mp3WebStream class.
public void Mp3WebStream(Uri address, Boolean async)
Parameters
address
UriThe address of the mp3 stream.
async
BooleanIf set to true, the connection will be established asynchronously and the constructor will return immediately. Doing that, requires the usage of the ConnectionEstablished event which will notify the caller when the Mp3WebStream is ready for use. If set to false the constructor will block the current thread as long as it takes to establish the connection.
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Dispose(Boolean disposing)
Releases unmanaged and - optionally - managed resources.
protected virtual void Dispose(Boolean disposing)
Parameters
disposing
Booleantrue to release both managed and unmanaged resources; false to release only unmanaged resources.
Finalize()
Finalizes an instance of the Mp3WebStream class.
protected void Finalize()
Read(Byte[] buffer, Int32 offset, Int32 count)
Reads a sequence of elements from the IReadableAudioSource and advances the position within the stream by the number of elements read.
public Int32 Read(Byte[] buffer, Int32 offset, Int32 count)
Parameters
buffer
Byte[]An array of elements. When this method returns, the buffer contains the specified array of elements with the values between offset and (offset + count - 1) replaced by the elements read from the current source.
offset
Int32The zero-based offset in the buffer at which to begin storing the data read from the current stream.
count
Int32The maximum number of elements to read from the current source.
Returns
The total number of elements read into the buffer.
Exceptions
System.ObjectDisposedException
Mp3WebStream
BufferedBytes
Gets the number buffered bytes.
public Int32 BufferedBytes { get; }
BufferSize
Gets the size of the internal buffer in bytes.
public Int32 BufferSize { get; }
CanSeek
Gets a value indicating whether the Mp3WebStream supports seeking.
public Boolean CanSeek { get; }
Remarks
This property will always be set to false.
Length
Gets the length of the waveform-audio data. The value of this property will always be set to zero.
public Int64 Length { get; }
Position
Gets or sets the current position. This property is not supported by the Mp3WebStream class.
public Int64 Position { get; set; }
Exceptions
System.NotSupportedException
The Mp3WebStream class does not support seeking.
StreamAddress
Gets the stream address.
public Uri StreamAddress { get; }
WaveFormat
Gets the WaveFormat of the decoded mp3 stream. If the internal decoder got not initialized yet, the value of the property is set to null.
public WaveFormat WaveFormat { get; }