|
Hi!
For this you'll have to perform a fourier transformation.
Basically, your try to approximate the wave form you have by adding many sinus waves. That way you get the volume (amplitude) at certain frequencies, which will ultimately give you the pitch.
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
Thanks for the explanation.
|
|
|
|
|
Hi ,
I succeeded in performing the FFT on my wave file and even printed the results into a nice Spectogram.
But I don't know how to extract the pitch from these values. Do you have any pointers at to what function I need to perform on the FFT data?
Thanks
Gidon
|
|
|
|
|
Hi!
I'm afraid I don't have any further pointers on how to calculate the pitch value.
You should be able to get a pitch value by multipyling each frequency with the amplitude for this frequency and summing up the values.
That way you'd get a high value if you have many loud, high-frequency bands and a low value if there are more low-frequency bands.
But I must admit I don't know if that'll suite your needs.
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
Dear All,
How do i findout list of all the SQLServer Names or Data Sources in a domain ?
Please send me the code if anybody have
Urgent from Shiv
With Regards,
Siva
|
|
|
|
|
Hi all
How i can to get access to default value or MinValue of an system type.
Or constuct byself an MinValue (or default value) value for each type.
I understand this is possible to make with switch\case but i wont know is exist more convinet way.In run time.
Exmpl:
<br />
<br />
object GetDefaultValue(object SysTypeValue)<br />
{<br />
object defVal;<br />
<br />
......<br />
<br />
return defVal;<br />
}<br />
<br />
void Main()<br />
{<br />
System.Date dt = System.Date.Now();<br />
int i = 100;<br />
char c = 'a';<br />
byte b = 8;<br />
<br />
System.Console.WriteLine(GetDefaultValue(i).ToString());<br />
System.Console.WriteLine(GetDefaultValue(c).ToString());<br />
System.Console.WriteLine(GetDefaultValue(b).ToString());<br />
System.Console.WriteLine(GetDefaultValue(dt).ToString());<br />
<br />
<br />
}<br />
<br />
console:
0
0
0
01.01.0001 0:00:00
THANK
|
|
|
|
|
Not sure if the following works, but it should create an instance of passed type by using its default constructor.
object GetDefaultValue(object SysTypeValue)
{
return Activator.CreateInstance(SysTypeValue.GetType());
}
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
www.troschuetz.de
|
|
|
|
|
Hi,
i want to check the existence of an integer value in the textbox control with the following code:
if (Convert.ToInt16(tbStockTypeId.Text) <= 0)
works fine when an intger value is entered. but when i enter 'abc' it raises FormatException "Input string was not in a correct format."
Need help for its correction.
With Thanx
|
|
|
|
|
First check if the Text value is numeric before trying to convert it.
This can be done with a RegEx , or Char.IsNumeric
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
thanks for reply! J4amieC
Char.IsNumeric
is fine for a character, while i'm working with textbox string.
uroojkhan
|
|
|
|
|
try{<br />
int stocktype = Convert.ToInt16(tbStockTypeId.Text);<br />
if(stocktype <= 0) { <br />
}<br />
}<br />
catch(FormatException fexc){<br />
Messagebox(tbStockTypeId.Text + "Is not a number");<br />
}
Coulda, woulda, shoulda doesn't matter if you don't.
[MODIFIED]In this 32 bit world, use ToInt32 unless you have little memory.[/MODIFIED]
<marquee>
-- modified at 10:53 Friday 26th May, 2006
|
|
|
|
|
Although that would work absolutely fine, its generally considered bad practice to control program flow with exceptions.
Exceptions for exceptional behaviour - the user making an invalid entry is not exceptional, it is expected!
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
J4amieC wrote: the user making an invalid entry is not exceptional, it is expected
He he , I agree on this, but I don't understand why using try/catch is bad practice?
Coulda, woulda, shoulda doesn't matter if you don't.
<marquee>
|
|
|
|
|
I guess because throwing exceptions is just more resource intensive, its a lot quicker to first check if the value is valid.
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
mja, sounds reasonable.
tnx.
Coulda, woulda, shoulda doesn't matter if you don't.
<marquee>
|
|
|
|
|
thanks V!
about Exceptions agree with J4amieC.
Do remember (for Int16 and Int32) What u required is more important than what u have!
Regards,
uroojkhan
|
|
|
|
|
If you are using .NET 2.0 - why not use Int32.TryParse()?
<br />
short outint;<br />
if (!Int16.TryParse(tbStockTypeId.Text, out outint)) {<br />
throw new ArgumentException("Argument is not integer", "tbStockTypeId");<br />
}<br />
____________________________________________
Robin Panther http://www.robinland.com
|
|
|
|
|
with a lot of thanks Robin Panther!
its solved my problem.
Do remember (for Int16 and Int32) What u required is more important than what u have!
Regards,
uroojkhan
|
|
|
|
|
hi all,
is there something wrong with this code ?
DataTable dset1 = new DataTable();
string myconnection = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source=veritabani.mdb";
conn = new OleDbConnection(myconnection);
adp1 = new OleDbDataAdapter("Select * From Users", conn);
adp1.Fill(dset1);
conn.Open();
txtusername.DataBindings.Add("Text", dset1, "username");
txtpassword.DataBindings.Add("text", dset1, "password");
CurrencyManager addnewentry = (CurrencyManager)this.BindingContext[dset1];
addnewentry.AddNew();
conn.Close();
MessageBox.Show(" new user inserted!");
i get no error during processing codes above but i couldnt see the new row (new user and password) on access ?
where i am doing wrong ?
help please ...
|
|
|
|
|
i think u r opening connection late
u should put conn.Open() before
adp1 = new OleDbDataAdapter("Select * From Users", conn);
sorry i forgot that datadapters fill method opens the conection
expicitly so this might not be couse.
rahul
-- modified at 8:13 Friday 26th May, 2006
|
|
|
|
|
Hi
how do you implement the right arrow to configure a custom control in desing time.
As a example the DataGridView allow you to edit a colums or add a column, select the datasource...
Send me a how to do or a web address would be fine.
thanks
K
|
|
|
|
|
Hi,
how can I show the "Internet Options" dialog on my WinForm with C#,
Like in Internet Explorer? I Use Visual Studio 2005 and the .Net Framework 2.0.
Can I have some helpfull code?
Thank's
best regard
Adiphe
"...all is simple, but there is always simpler ..."
-- modified at 6:56 Friday 26th May, 2006
|
|
|
|
|
check out these links
http://support.microsoft.com/?kbid=329014
or
http://www.kbalertz.com/815716/invoke.dialog.Source.dialog.Internet.Options.dialog.WebBrowser.control.aspx
first one wasnt working on my browser for some reason, both are same articles.
Shajeel
|
|
|
|
|
Thank's Shajeel,
But I don't want to use all this ActiveX elements from the COM components.
Can we find a better simpler code for .Net 2.0?
best regard
Adiphe
"...all is simple, but there is always simpler ..."
|
|
|
|
|
try this
System.Diagnostics.Process.Start("C:\\Windows\\System32\\rundll32.exe", " shell32.dll,Control_RunDLL inetcpl.cpl,,0");
Shajeel
|
|
|
|