|
How are you implementing your pages? are you using a tab control? On which pade is the rich text box?
|
|
|
|
|
Hello everybody, and sorry for my bad English, I'm trying to draw Wave forms from a wave file.
I know that in .Wav files data are codified by the PCM technique, and that i have 16 it for each amplitude coded.
So I came up with this code:
private void Plot()
{
int Num = 0;
WaveChart.Series.FindByName("WaveSerie").Points.Clear();
Double Dx = 1 / Ws.CurrentHeader.SampleRate;
for (int i = 0; i < Ws.CurrentBuffer.Length; i += 2)
{
Num = ((Ws.CurrentBuffer[i + 1] * 256) + Ws.CurrentBuffer[i]);
WaveChart.Series.FindByName("WaveSerie").Points.AddXY(Dx * i, Num);
}
}
It just take the 2 bytes read form the .Wav file, and merge them in order to make a 16 bit number, then It tries to draw the point obtained.
But it don't work, because I get an incorent drawing:
http://postimage.org/image/q647gboon/[^]
The correct Wave form is this [From Audacity]:
http://postimage.org/image/9bbrgrwcb/[^]
Ws is just a Class which read a .Wav file and puts in CurrentHeader the file header and in CurrentBuffer the Wave data.
Num is the number obtained by merging the 2 bytes from current buffer, it is the wave amplitude.
Where is the mistake ? Thank you, and sorry again for my English.
|
|
|
|
|
Hi,
in C# int and short are signed, however byte is unsigned by default.
I bet you're using an unsigned byte array, in which case your two-byte to integer conversion is wrong.
A simple if(x>=0x8000) x-=0x10000; could fix it.
|
|
|
|
|
Oh, such a stupid error ! It works ! Thank you very much !
|
|
|
|
|
You're welcome.
|
|
|
|
|
I want to import data from excel to sql server 2005. I am using C# for this purpose. I successfully exported the data of general format
to varchar. But, the problem arises while exporting the data of date type.
I have used date format in excel and want to export it in sql server 2005's datetime field.
The code that I have used is:-
SqlBulkCopy sqlBulk = new SqlBulkCopy(strConnection);
sqlBulk.DestinationTableName = "Data_Master_Inventory";
sqlBulk.ColumnMappings.Add("VendorRegistrationNo", "VendorRegistrationNo");
sqlBulk.ColumnMappings.Add("ProductCode", "ProductCode");
sqlBulk.ColumnMappings.Add("SerialNo", "SerialNo");
sqlBulk.ColumnMappings.Add("VendorProvidedSerialNo", "VendorProvidedSerialNo");
sqlBulk.ColumnMappings.Add("ModelName", "ModelName");
sqlBulk.ColumnMappings.Add("ProductCategoryCode", "ProductCategoryCode");
sqlBulk.ColumnMappings.Add("InventoryDate", "InventoryDate");
sqlBulk.WriteToServer(dReader);
Please provide me necessary solution.
|
|
|
|
|
Hi Rahul
U can refer these links
http://www.sqlteam.com/article/use-sqlbulkcopy-to-quickly-load-data-from-your-client-to-sql-server
http://www.codeproject.com/KB/database/SqlBulkCopy.aspx
http://www.codeproject.com/KB/database/TransferUsingSQLBulkCopy.aspx
http://stackoverflow.com/questions/2238328/sqlbulkcopy-writetoserver-example-what-am-i-doing-wrong
Thanks
Ravindra
|
|
|
|
|
Please use the appropriate editor buttons to make your links clickable.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
It's gonna be one of those kinds of days...
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
No change there then.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
hey! Please convert Url to Hyperlink! because it provide better readability and accessibility to other user.
|
|
|
|
|
Always wrap your code in "pre" tag.
|
|
|
|
|
How to take picture from camera(directx.capture)? (please help me)
|
|
|
|
|
Don't post the same question in both Q&A and the forums - is duplicates work and annoys people.
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
Compensated for 1-voting 'tard...
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
And then he 1-voted my post that called him a 'tard...
Some people... SHEESH!
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
Compensated - both of them!
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
OriginalGriff wrote: Compensated - both of them! Can excess compensation lead to decompensation, triggering an infinitely recursive bi-cycle ?
The front-wheel that turns in my mind contemplating this has so many spokes I experience it as solid, but I know that it is not: I can't see the back wheel
best, Bill
"Anyone who shows me my 'blind spots' gives me the gift of sight." ... a thought from the shallows of the deeply shallow mind of ... Bill
|
|
|
|
|
Lately I have been exploring the interesting world of the Tuple object in .NET 4. I find it interesting that a Tuple's internal Items (buckets ? ... or whatever is under the hood) can take any objects of any Type, and those objects can be accessed, via the getter, then used without casting.
And, nice that Tuple exposes Sort, Equivalence/Equality, and Comparison.
Given that Tuples are, by design, immutable: I am curious under what circumstances you would choose to use Tuples.
Appreciate any thoughts, and I do realize this is a more "general" kind of question than is usually asked here, but I can't think of a more appropriate forum on CP.
thanks, Bill
"Anyone who shows me my 'blind spots' gives me the gift of sight." ... a thought from the shallows of the deeply shallow mind of ... Bill
modified 5-Dec-11 4:16am.
|
|
|
|
|
Very rarely and for short periods only; for real work I write a class/struct. I think they're ridiculous.
|
|
|
|
|
I used it in a comment once:
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
modified 5-Dec-11 8:47am.
|
|
|
|
|
[groan] Comments like that should be in the Lounge
No comment
|
|
|
|
|
If we can't laugh at each other, who CAN we laugh at?
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
John Simmons / outlaw programmer wrote: who CAN we laugh at
Everyone else who are not us of course.
No comment
|
|
|
|
|