|
|
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]
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]
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]
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);
}
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 ...
|
|
|
|
|
Hello
I am using DrawingContext to draw text, and then i print visual throu PrintDialog. I want to convert input from milimeters. I do not know formula and on google i only found a few pieces, but i realy want to be printer independet.
I found on a Some page
1 mm = 3.779528 px
Is this printer independet. I am writing an application that will print on normal A4 printer or on 60mm x Reciept type printers. My app is already printing, but some values i want to be in pixel and some in mm.
Thank you
Edit: Upon remote testing i noticed that no matter if Printer is 600DPI or 300dpi. I can simply ignore these values
modified 22-Jul-13 5:30am.
|
|
|
|
|
Saksida Bojan wrote: 1 mm = 3.779528 px
WPF uses Device Independent Pixels, you may have a hard-time with this asumption
Beauty cannot be defined by abscissas and ordinates; neither are circles and ellipses created by their geometrical formulas.
Source
|
|
|
|
|
I Know WPF is DPI indipented when putting it on screen.
Does that extend to Printing? I am using Drawing Context and all values are pixel based. My Printer has resolution 600dpi. But other printer that is currently not awaible is STAR SP 200 Series. It is a 300DPI Matrix type printer.
|
|
|
|
|
Hi,
Can somebody highlight the uses please. Also, there are lot of unused usings being created in this files, is there anyway we can suppress them?
http://authenticcode.com
|
|
|
|
|
When you use Visual Studio to write your project (no matter what type of app you are writing), it does a lot of background build work. The .g.cs and .g.i.cs files are auto-generated from XAML files when the build process runs; the .g.i.cs is the part that ties into the Intellisense builder.
As far as removing the unused usings, you'd have to edit the source template. On my machine, running Visual Studio 2012, they are located under C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\ItemTemplates\CSharp\WPF\1033 . Obviously, you'd have to pick your appropriate VS install location, but this should give you a head start.
|
|
|
|
|
Hi Pete,
Thanks a lot for the explanation.
If I comment out all code in g.i.cs file then also my app runs fine without any issues and intellisense also works fine. Then, what's the actual use?
http://authenticcode.com
|
|
|
|
|
Remember that it's auto-generated, and I said the auto-build is always running.
|
|
|
|
|
Okay. Thanks.
I could not find relevant template although there are all other templates present.
http://authenticcode.com
|
|
|
|
|
Mohammed Hameed wrote: lot of unused usings being created in this files Right click on any of the using statements and select "Organize Usings" -> "Remove Unused Usings".
Use the best guess
|
|
|
|
|
But that is a auto-generated file, if we manually remove the usings then it will again recreate when we rebuild the project. Therefore I need a permanent fix, something like as suggested by Pete to edit the template but unfortunately I'm unable to find that template.
http://authenticcode.com
|
|
|
|
|
If it's an auto generated file then you should not be modifying it in the first place. Also, why does it matter, as these statements are only used by the compiler?
Use the best guess
|
|
|
|
|
Some of them are required for starting the app, intellisense, assembly identification etc.
Take a look at the App.g.cs (for a desktop wpf app). It loads the BAML (compiled XAML, embedded as a resource in the assembly) to the XAML parser. Without it probably your WPF application will not run. They just contain few lines of code so not a thing of worry as they aren't huge memory/cycle eating hogs!
Beauty cannot be defined by abscissas and ordinates; neither are circles and ellipses created by their geometrical formulas.
Source
|
|
|
|
|
Thank you Amitosh. Now I got the clear idea and thanks for mentioning BAML.
http://authenticcode.com
|
|
|
|
|
Hi,
I writing an app with Wpf, MVMM, Prism and Entity Framework, I have a conflict for using entity framework.
Which one is better? Code First or Database First?
Also :
- The database is existing.
- I want just save a single entity (with AutoDetectedChangedEnable)
- Working with Observable Collection in binding.
Thanks a lot
Hossein
|
|
|
|
|
Hossein Khalaj wrote: The database is existing
I would think that makes you question irrelevant for this project!
Personally I can't conceive of a code first project, it is all about the database, but then I'm purely a LOB developer.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I used multiple silverlight project in my solution based on microsoft prism framework. my application is very slow and consume over 200m of memory. what to do?
|
|
|
|
|
Profile it to find out what's getting called repeatedly and unecessarily, or what is being loaded when it doesn't need to be. There are many suitable profilers you could use.
|
|
|
|
|
i wanna to get audio buffer to mediaelement. when playing wmv file in mediaelement.
|
|
|
|
|
Hi,
I have a requirement, where i need to draw line dynamically with the help of mouse using WPF. Finally i need to capture X-Axis & Y-Axis measurement once a curve line drawn, how to do that?
|
|
|
|
|
Have you looked around on htis site for projects, as there are many articles on the subject.
HEres one
WPF DrawTools[^]
|
|
|
|
|
Im using MVVM. I have a form and a grid view below the form. Once I save data in GridView, it goes to database and show in GridView. I want to load data to the controls when select a particular row in GridView.
This is my GridView in View
<ListView SelectedValue="_row" ItemsSource="{Binding PromExams}" Name="ListViewEmployeeDetails" Margin="13,159,38,0" Height="183" VerticalAlignment="Top" >
<ListView.View>
<GridView x:Name="grdTest" >
<GridViewColumn Header="Part 1 Marks" DisplayMemberBinding="{Binding Part1Marks}" Width="100"/>
<GridViewColumn Header="Part 2 Marks" DisplayMemberBinding="{Binding Part2Marks}" Width="100"/>
<GridViewColumn Header="Total" DisplayMemberBinding="{Binding Total}" Width="100"/>
<GridViewColumn Header="Average" DisplayMemberBinding="{Binding Average}" Width="100"/>
</GridView>
</ListView.View>
</ListView>
how can I do that
|
|
|
|
|
i want to implement audio bars in mediaelemnt ...
|
|
|
|
|
I dont understand, could you expalain or elaborate?
|
|
|
|