Click here to Skip to main content
15,887,027 members
Home / Discussions / WPF
   

WPF

 
QuestionAny Idea CFL in Silverlight? Pin
Tanmoy Mahish9-Jul-13 19:57
Tanmoy Mahish9-Jul-13 19:57 
AnswerRe: Any Idea CFL in Silverlight? Pin
Mycroft Holmes9-Jul-13 21:10
professionalMycroft Holmes9-Jul-13 21:10 
GeneralRe: Any Idea CFL in Silverlight? Pin
Tanmoy Mahish9-Jul-13 21:38
Tanmoy Mahish9-Jul-13 21:38 
GeneralRe: Any Idea CFL in Silverlight? Pin
Mycroft Holmes9-Jul-13 22:45
professionalMycroft Holmes9-Jul-13 22:45 
GeneralRe: Any Idea CFL in Silverlight? Pin
Tanmoy Mahish9-Jul-13 23:56
Tanmoy Mahish9-Jul-13 23:56 
GeneralRe: Any Idea CFL in Silverlight? Pin
Mycroft Holmes10-Jul-13 1:06
professionalMycroft Holmes10-Jul-13 1:06 
AnswerRe: Any Idea CFL in Silverlight? Pin
Richard MacCutchan10-Jul-13 1:40
mveRichard MacCutchan10-Jul-13 1:40 
Questionhow to use equalizer using naudio wpf Pin
thecco7-Jul-13 17:50
thecco7-Jul-13 17:50 
hello

Google Translator will translate into this one. Please note.

I have to use SVL and Naudio.

I need to develop an equalizer.

Included SVL, but it does not seem to be making is completed.

In spite of the language barrier, and ask

Please help me....

[Fields]
C#
private static NAudioEngine instance;
private static NAudioEngine instance2;
private static NAudioEngine instance3;
private readonly DispatcherTimer positionTimer = new DispatcherTimer(DispatcherPriority.ApplicationIdle);
private readonly BackgroundWorker waveformGenerateWorker = new BackgroundWorker();
private readonly int fftDataSize = (int)FFTDataSize.FFT2048;
private bool disposed;
private bool canPlay;
private bool canPause;
private bool canStop;
private bool isPlaying;
private bool inChannelTimerUpdate;
private double channelLength;
private double channelPosition;
private bool inChannelSet;
private IWavePlayer waveOutDevice = new DirectSoundOut(50);
private WaveStream activeStream;
private WaveChannel32 inputStream;
private SampleAggregator sampleAggregator;
private SampleAggregator waveformAggregator;
private string pendingWaveformPath;
private float[] fullLevelData;
private float[] waveformData;
private TagLib.File fileTag;
private TimeSpan repeatStart;
private TimeSpan repeatStop;
private bool inRepeatSet;

private double volumeChange;
private double volumeChange_Master;

private bool allPlay;
private bool allStop;
private bool allPause;

private double equalizerChange;
private  EqualizerEffect m_eqEffect;


[Apply Equalizer]
C#
if (waveOutDevice != null)
            {
                waveOutDevice.Pause();
                
              
                switch (i)
                {
                    case 1:
                        m_eqEffect.LoGainFactor.Value = (float)d;
                        m_eqEffect.LoDriveFactor.Value = (float)d;
                        break;
                    case 2:
                        m_eqEffect.MedGainFactor.Value = (float)d;
                        m_eqEffect.MedDriveFactor.Value = (float)d;
                        break;
                    case 3:
                        m_eqEffect.HiGainFactor.Value = (float)d;
                        m_eqEffect.HiDriveFactor.Value = (float)d;
                        break;
                }
                m_eqEffect.OnFactorChanges();
                waveOutDevice.Play();
                
            }


[File Open]
C#
if (System.IO.File.Exists(path))
           {
               try
               {
                   waveOutDevice= new DirectSoundOut(50);

                   if (path.EndsWith(".wav"))
                   {
                       ActiveStream = new WaveFileReader(path);
                   }
                   else if (path.EndsWith(".mp3"))
                   {
                       ActiveStream = new Mp3FileReader(path);
                   }
                   else
                   {
                       throw new InvalidOperationException("Unsupported extension");
                   }

                   if (ActiveStream.WaveFormat.Encoding != WaveFormatEncoding.Pcm)
                   {
                       ActiveStream = WaveFormatConversionStream.CreatePcmStream(ActiveStream);
                       ActiveStream = new BlockAlignReductionStream(ActiveStream);
                   }

                   // Provide conversion to 16 bits if needed
                   if (ActiveStream.WaveFormat.BitsPerSample != 16)
                   {
                       var format = new WaveFormat(ActiveStream.WaveFormat.SampleRate,
                       16, ActiveStream.WaveFormat.Channels);
                       ActiveStream = new WaveFormatConversionStream(format, ActiveStream);
                   }

                   inputStream = new WaveChannel32(ActiveStream);
                   sampleAggregator = new SampleAggregator(fftDataSize);
                   inputStream.Sample += inputStream_Sample;
                   ChannelLength = inputStream.TotalTime.TotalSeconds;
                   FileTag = TagLib.File.Create(path);
                   GenerateWaveformData(path);
                   CanPlay = true;
                   inputStream.Volume = 0.5f;
                   waveOutDevice.Volume = 1f;

                   m_eqEffect = new EqualizerEffect();
                   m_eqEffect.SampleRate = activeStream.WaveFormat.SampleRate;
                   m_eqEffect.LoDriveFactor.Value = 75;
                   m_eqEffect.LoGainFactor.Value = 0;
                   m_eqEffect.MedDriveFactor.Value = 40;
                   m_eqEffect.MedGainFactor.Value = 0;
                   m_eqEffect.HiDriveFactor.Value = 30;
                   m_eqEffect.HiGainFactor.Value = 0;
                   m_eqEffect.Init();
                   m_eqEffect.OnFactorChanges();

                   ActiveStream = new DSPEffectStream(inputStream, m_eqEffect);
                   waveOutDevice.Init(inputStream);

               }
               catch
               {
                   ActiveStream = null;
                   CanPlay = false;
               }
           }



Used 3 instance

Used IWavePlayer

Help me.....

Trouble apply anyhow ...
Question[SOLVED] WPF Printing in milimeters Pin
Saksida Bojan5-Jul-13 22:16
Saksida Bojan5-Jul-13 22:16 
SuggestionRe: WPF Printing in milimeters Pin
AlphaDeltaTheta7-Jul-13 21:18
AlphaDeltaTheta7-Jul-13 21:18 
GeneralRe: WPF Printing in milimeters Pin
Saksida Bojan7-Jul-13 23:59
Saksida Bojan7-Jul-13 23:59 
QuestionWhat is the use of somefile.g.i.cs auto-generated file in Wpf? Pin
Mohammed Hameed3-Jul-13 20:24
professionalMohammed Hameed3-Jul-13 20:24 
AnswerRe: What is the use of somefile.g.i.cs auto-generated file in Wpf? Pin
Pete O'Hanlon3-Jul-13 20:45
mvePete O'Hanlon3-Jul-13 20:45 
GeneralRe: What is the use of somefile.g.i.cs auto-generated file in Wpf? Pin
Mohammed Hameed3-Jul-13 21:10
professionalMohammed Hameed3-Jul-13 21:10 
GeneralRe: What is the use of somefile.g.i.cs auto-generated file in Wpf? Pin
Pete O'Hanlon3-Jul-13 21:44
mvePete O'Hanlon3-Jul-13 21:44 
GeneralRe: What is the use of somefile.g.i.cs auto-generated file in Wpf? Pin
Mohammed Hameed3-Jul-13 21:55
professionalMohammed Hameed3-Jul-13 21:55 
AnswerRe: What is the use of somefile.g.i.cs auto-generated file in Wpf? Pin
Richard MacCutchan3-Jul-13 21:12
mveRichard MacCutchan3-Jul-13 21:12 
GeneralRe: What is the use of somefile.g.i.cs auto-generated file in Wpf? Pin
Mohammed Hameed3-Jul-13 21:20
professionalMohammed Hameed3-Jul-13 21:20 
GeneralRe: What is the use of somefile.g.i.cs auto-generated file in Wpf? Pin
Richard MacCutchan3-Jul-13 22:29
mveRichard MacCutchan3-Jul-13 22:29 
AnswerRe: What is the use of somefile.g.i.cs auto-generated file in Wpf? Pin
AlphaDeltaTheta4-Jul-13 20:37
AlphaDeltaTheta4-Jul-13 20:37 
GeneralRe: What is the use of somefile.g.i.cs auto-generated file in Wpf? Pin
Mohammed Hameed4-Jul-13 21:03
professionalMohammed Hameed4-Jul-13 21:03 
QuestionCode first or Database First Pin
Hossein Khalaj3-Jul-13 18:50
Hossein Khalaj3-Jul-13 18:50 
AnswerRe: Code first or Database First Pin
Mycroft Holmes3-Jul-13 19:43
professionalMycroft Holmes3-Jul-13 19:43 
Questionspeed up Silverlight project Pin
Member 91093872-Jul-13 23:15
Member 91093872-Jul-13 23:15 
AnswerRe: speed up Silverlight project Pin
Pete O'Hanlon2-Jul-13 23:28
mvePete O'Hanlon2-Jul-13 23:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.