Alvas.Audio Class Library

PlayerEx Class

PlayerEx is a component for playing sound in PCM, IMA ADPCM, Microsoft ADPCM, CCITT A-Law, CCITT u-Law, GSM 6.10, Windows Media Audio V2, MPEG Layer-3 (mp3) and other wave file format.

For a list of all members of this type, see PlayerEx Members.

System.Object
   MarshalByRefObject
      Component
         PlayerEx

[Visual Basic]
Public Class PlayerEx
    Inherits 
[C#]
public class PlayerEx : Component

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Example

This example shows simple using of PlayerEx class.

public static void TestPlayerEx()
{
    PlayerEx plex = new PlayerEx();
    plex.Done += new PlayerEx.DoneEventHandler(plex_Done);
    Mp3Reader mr = new Mp3Reader(File.OpenRead("in.mp3"));
    IntPtr format = mr.ReadFormat();
    byte[] data = mr.ReadData();
    mr.Close();
    plex.OpenPlayer(format);
    plex.AddData(data);
    plex.StartPlay();
}

static void plex_Done(object sender, DoneEventArgs e)
{
    if (e.IsEndPlaying)
    {
        ((PlayerEx)sender).ClosePlayer();
    }
}
 

Requirements

Namespace: Alvas.Audio

Assembly: Alvas.Audio (in Alvas.Audio.dll)

See Also

PlayerEx Members | Alvas.Audio Namespace