1
0
mirror of https://github.com/DarthAffe/CUE.NET.git synced 2025-12-12 16:58:29 +00:00

Updated AudioAnalyzer-Example

This commit is contained in:
Darth Affe 2016-03-26 20:39:36 +01:00
parent dbdc1c22e8
commit 1ba02cc613
3 changed files with 3 additions and 8 deletions

View File

@ -63,13 +63,15 @@ namespace Example_AudioAnalyzer_full
// Add a lack background. We want this to be semi-transparent to add some sort of fade-effect - this will smooth everything out a bit
// Note that this isn't a 'real effect' since it's update-rate dependent. A real effect would do always the same thing not mather how fast the keyboard updates.
_keyboard.Brush = new SolidColorBrush(Color.FromArgb(96, 0, 0, 0));
// Add our song-beat-effect. Remember to uncomment the update in the spectrum effect if you want to remove this.
_keyboard.AttachEffect(new SongBeatEffect(_soundDataProcessor, Color.FromArgb(127, 164, 164, 164)));
// Add our spectrum-effect using the soundDataProcessor and a rainbow from purple to red as gradient
_keyboard.AttachEffect(new AudioSpectrumEffect(_soundDataProcessor, new RainbowGradient(300, -14)));
// Hook onto the keyboard update and process data
_keyboard.Updating += (sender, args) => _soundDataProcessor.Process();
// If you don't like rainbows replace the gradient with anything you like. For example:
//_keyboard.AttachEffect(new AudioSpectrumEffect(_soundDataProcessor, new LinearGradient(new GradientStop(0f, Color.Blue), new GradientStop(1f, Color.Red))));

View File

@ -33,10 +33,6 @@ namespace Example_AudioAnalyzer_full
public override void Update(float deltaTime)
{
// calculate new data ... - we don't need to do this, since we know that the song beat-effect already calculated them
//_dataProcessor.Process();
// ... and update the brush
_audioSpectrumBrush.BarData = _dataProcessor.BarValues;
}

View File

@ -41,9 +41,6 @@ namespace Example_AudioAnalyzer_full
public override void Update(float deltaTime)
{
// calculate new data ...
_dataProcessor.Process();
// ... update the effect-data ...
if (_dataProcessor.SongBeat >= SONG_BEAT_THRESHOLD)
_currentEffect = FLASH_DURATION;