Click or drag to resize
RecordPlayer Class
Class for recording and playback
Inheritance Hierarchy
SystemObject
  Alvas.AudioRecordPlayer

Namespace: Alvas.Audio
Assembly: Alvas.Audio (in Alvas.Audio.dll) Version: 2016.0.6173.41573
Syntax
public class RecordPlayer : INotifyPropertyChanged

The RecordPlayer type exposes the following members.

Constructors
  NameDescription
Public methodRecordPlayer
Initializes a new instance of the RecordPlayer class
Top
Methods
  NameDescription
Public methodBackward
Backwards current stream position
Public methodClose
Closes audio stream
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodForward
Forwards current stream position
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodOpen
Open existing audio file for recording and playback
Public methodPause
Pauses recording or playback
Public methodPlay
Plays audio stream
Public methodPlay(Int32)
Plays audio stream from stated position
Public methodRecord
Records audio stream
Public methodRecord(Int32)
Records audio stream from specified position in milliseconds.
Public methodRecord(Int32, WriteMode)
Records audio stream from specified position in milliseconds with specified mode.
Public methodStop
Stops recording or playback
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Fields
  NameDescription
Public fieldStatic memberBufferSizeInMSProperty
BufferSizeInMS property name
Public fieldStatic memberDurationProperty
Duration property name
Public fieldStatic memberPlayerVolumeMuteProperty
PlayerVolumeMute property name
Public fieldStatic memberPlayerVolumeProperty
PlayerVolume property name
Public fieldStatic memberPositionProperty
Position property name
Public fieldStatic memberRecorderLinesIndexProperty
RecorderLinesIndex property name
Public fieldStatic memberRecorderLinesProperty
RecorderLines property name
Public fieldStatic memberRecorderVolumeProperty
RecorderVolume property name
Public fieldStatic memberSilentLevelProperty
SilentLevel property name
Public fieldStatic memberSkipSilentProperty
SkipSilent property name
Public fieldStatic memberStateProperty
State property name
Public fieldStatic memberVolumeLevelProperty
VolumeLevel property name
Public fieldStatic memberVolumeScaleProperty
VolumeScale property name
Top
Properties
  NameDescription
Public propertyBufferSizeInMS
Gets or sets the audio buffer size in milliseconds. By default 500 ms.
Public propertyCanRecord
Indicates whether the stream can be recorded.
Public propertyDuration
Returns audio stream duration in ms
Public propertyFormatDetails
Gets format details for current audio stream
Public propertyPlayerID
Gets or sets the current player. If -1 the system uses suitable player.
Public propertyPlayerVolume
Sets and gets playback volume
Public propertyPlayerVolumeMute
Sets and gets playback mute
Public propertyPosition
Gets current position for audio stream
Public propertyRecorderID
Gets or sets the current recorder. If -1 the system uses suitable recorder.
Public propertyRecorderLines
Gets recorder lines
Public propertyRecorderLinesIndex
Gets and sets selected recorder lines index
Public propertyRecorderVolume
Sets and gets recording volume
Public propertySilentLevel
Sets and gets sound level, which will be silence
Public propertySkipSilent
Skip silence during recording
Public propertyState
Current device state
Public propertyCode exampleVolumeData
Volume audio data array for current audio operation.
Public propertyVolumeDataLength
Length of volume audio data array
Public propertyVolumeLevel
Volume level for current audio operation
Public propertyVolumeScale
Scales the volume of audio data. 100 is normal volume, 50 is reduced by half, 200 is increased in 2 times
Top
Events
  NameDescription
Public eventPropertyChanged
Occurs when a property changes values.
Top
Examples
This example shows simple using of RecordPlayer class.
public static void TestRecordPlayer()
{
    RecordPlayer rp = new RecordPlayer();
    rp.PropertyChanged += new PropertyChangedEventHandler(rp_PropertyChanged);
    rp.Open(new Mp3Reader(File.OpenRead("in.mp3")));
    rp.Play();
}

static void rp_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
    switch (e.PropertyName)
    {
        case RecordPlayer.StateProperty:
            RecordPlayer rp = ((RecordPlayer)sender);
            if (rp.State == DeviceState.Stopped)
            {
                rp.Close();
            }
            break;
    }
}
See Also