Returns the frequency in Hz represented by the given X coordinate position of a visual control.
Namespace: Un4seen.Bass.Misc
Assembly: Bass.Net (in Bass.Net.dll) Version: 2.4.17.5
Syntax
Parameters
- x
- Type: SystemInt32
The X coordinate from which to get the frequency (between 0 and control.Width-1). - samplerate
- Type: SystemInt32
The current samplerate of the channel which was used to render the visual (e.g. use BASS_ChannelGetInfo(Int32, BASS_CHANNELINFO) to retrieve the current samplerate of the respective channel).
Return Value
Type: Int32The frequency in Hz which is represented by the X coordinate of the visual.
Remarks
Examples
private void pictureBoxSpectrum_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e) { if (_vis == null) return; int freq = _vis.GetFrequencyFromPosX(e.X, 44100); float amp = _vis.GetAmplitudeFromPosY(e.Y, this.pictureBoxSpectrum.Height); this.labelVis.Text = String.Format( "Freq={0}Hz, Amp={1}", freq, amp ); }
See Also