Click or drag to resize
RecordPlayerVolumeData Property
Volume audio data array for current audio operation.

Namespace: Alvas.Audio
Assembly: Alvas.Audio (in Alvas.Audio.dll) Version: 2016.0.6173.41573
Syntax
public short[] VolumeData { get; }

Property Value

Type: Int16
Examples
This example shows simple using of VolumeData property.
private void Init()
{
    slm = new SoundLevelMeter();
    slm.Dock = DockStyle.Fill;
    this.Controls.Add(slm);
    IntPtr pcmFormat = AudioCompressionManager.GetPcmFormat(2, 16, 44100);
    rp.VolumeDataLength = slm.ClientSize.Width;
    rp.PropertyChanged += new PropertyChangedEventHandler(rp_PropertyChanged);
    rp.Open(new WaveReadWriter(new MemoryStream(), AudioCompressionManager.FormatBytes(pcmFormat)));
    rp.Record();
}

SoundLevelMeter slm;
RecordPlayer rp = new RecordPlayer();

void rp_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
    if (e.PropertyName == RecordPlayer.VolumeLevelProperty)
    {
        slm.Data = rp.VolumeData;
    };
}
See Also