|
what sound API are u using or how have u read in and stored the raw data?
i guess how i would do it would be to either do a raw data check to see if the current sound buffer had a series of zeros in it. this wont work if you have microphone data because of noise etc.
otherwise you could FFT analyse the buffer to see if there exsists a freq in the audiable spectrum range with a magnitude of X, where X is your tolerance of quiteness.
|
|
|
|
|
Thanks for giving me the hint I will make an r&d on FFT.
but how could I know the audible limit of the sound wave file as the header donot contain this info.
I didnot used any API ,I am provided with the wave files recorded from a
software in PCM,16000kHz,1 channel mono,16 bit sample unit.
thanks
|
|
|
|
|
Thanks for giving me the hint I will make an r&d on FFT.
but how could I know the audible limit of the sound wave file as the header donot contain this info.
I didnot used any API ,I am provided with the wave files recorded from a
software in PCM,16000kHz,1 channel mono,16 bit sample unit.
I am the same kittu_vamshi.some settings could destroy my old id
thanks
killabyte
|
|
|
|
|
even i require some guidance on this problem.
hope my question may give you some idea on how to achieve this.
iam able to read each sample in binary format from the wave file.
now can you let me know, if i can understand from the sample packet, if there is a silence or any audible wave form in that?
killabyte wrote: otherwise you could FFT analyse the buffer to see if there exsists a freq in the audiable spectrum range with a magnitude of X, where X is your tolerance of quiteness
can you explain this a bit clearly?
if FFT, is going to solve this problem for me,
then please give me some guidance and justification.
i remember, i wrote some algorithm to find FFT long long ago.
thank you.
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
hmm where to begin... it really depends on your level of knowledge of DSP. i dont profess to be an expert but i have played around with matlab a fair bit mainly to analyse the data from a sensor i had and create a series of FIR filters accordingly.
i had assumed(DANGEROUS) that u will be reading in a file or streaming data in, and then analysing a small bit of this file/stream in a buffer.
so the raw data u have in the buffer is basically magnitude on the y axis and time on the x
(time is just the sample count normally).
once you have FFT'ed the buffer you now have a magnitude on the y axis and a freq on the x
you can then say if i dont have a magnitude of 'somevalue' in a freq range then i shall flag this as silence. and chop my file here.
this is a really simple overview, hope it helps.
|
|
|
|
|
really gives me some clue,
but still...
some more work around has to be done.
now, i have a sample, in an array of 2239 bytes for example.
(this sample is obtainied from the wav file by reading the bytespersample field from its header).
now, the concept of magnitude in connection with this binary is clearly not understood.
could you emphasise a bit more on this?
thanks again.
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
ok it sounds like your reading in the whole file so doing an FFT on this wont enable you to determine a position of the silence. (because u have no time reference anymore, but if your buffer size was small enough chunk then you could).
if your dealing with PCM data ( i think you 3 are the same person?) then you could just parse through the array looking for a series of zero value +/- a tolerance ,remembering that zero might be different according to your encoding IE. if the data type is signed or unsigned the zero value or centre point will be different (8bit signed zero pt = 0, 8bit unsigned zero point = 128).
|
|
|
|
|
but i observed a fully silent wave file(a wave file which is recorded with no input audio), i did not find 0 s there.
killabyte wrote: ( i think you 3 are the same person?)
no both of us breaking our heads on the same task.
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
chandu004 wrote: but i observed a fully silent wave file(a wave file which is recorded with no input audio), i did not find 0 s there.
so u had backround noise or you are using unsigned data encoding.
was the data obsevred about 32000?
|
|
|
|
|
thanks for your concern.
i will revise it once again and give you the correct details.
please give me some time.
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
here is some information i can provide you.
I read the header of a wave file and is as follows.
bytes per sample-2
bytes per second-44100
samplesrate-22050
in the data chunk, the data is as follows
99 FE,97 FE,99 FE,97 FE,94 FE,95 FE,97 FE,97 FE,-----
means, 2 bytes per sample, so can you suggest something from here.
NOTE: this is from a file that is recorded by un plugging the audio jack, means, the file is fully silent.
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
here is some information that i can provide you.
I read some fields of the header of a wave file and is as follows.
bytes per sample-2
bytes per second-44100
samplesrate-22050
in the data chunk, the data is as follows
99 FE,97 FE,99 FE,97 FE,94 FE,95 FE,97 FE,97 FE,-----
means, 2 bytes per sample, so can you suggest something from here.
NOTE: this is from a file that is recorded by un plugging the audio jack, means, the file is fully silent.
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
post your code that you use to read in the file data, and map the format header structs etc please.
|
|
|
|
|
iam unable to mail to the id provided by you.
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
Hi,
i have a doubt in a dialog based application created in vc++...
Whenever we create a dialog based application, if we press Esc Key, its getting closed... i dont want it to be closed ....
is it possible to do that??
Thanks,
Rakesh.
|
|
|
|
|
Rather than me answering this question I would suggest you to read here[^] and here[^]. And if this doesn't help then try this[^]
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
Override OnCancel Function.
|
|
|
|
|
Chandru080 wrote: Override OnCancel Function.
Which will prevent the dialog from being closed while the cancel button is clicked as well. The previous answer given to the OP was better.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
dear sir
i need a high speed method to make 4 image from one, that the first image have for example 2048*1536 pixel, and the four made is each 1024*768 , so i use the getpixel and setpixel method that is too slow :
vb.net code ::
For y = 0 To picy.Height - 1 Step 2
For x = 0 To picy.Width - 1 Step 2
pic(0).SetPixel(Int(x / 2), Int(y / 2), picy.GetPixel(x, y))
pic(1).SetPixel(Int(x / 2), Int(y / 2), picy.GetPixel(x + 1, y))
pic(2).SetPixel(Int(x / 2), Int(y / 2), picy.GetPixel(x + 1, y + 1))
pic(3).SetPixel(Int(x / 2), Int(y / 2), picy.GetPixel(x, y + 1))
Next x
Next y
please help me to find a very faster method in any languages, vc++ or vb or vc# or others , its not important i need a fast method,
thank you for attentions and cooperations.
|
|
|
|
|
Mortezai wrote: please help me to find a very faster method in any languages, vc++ or vb or vc# or others , its not important i need a fast method,
|
|
|
|
|
You may use GetDIBBits[<a href="http://msdn.microsoft.com/en-us/library/dd144879(VS.85).aspx" target="_blank" title="New Window">^</a>]/SetDIBBits[<a href="http://msdn.microsoft.com/en-us/library/dd162973(VS.85).aspx" target="_blank" title="New Window">^</a>] for direct access to bitmap memory, I do this way in my DLL [^] , you may have a look at the source code.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
#include <iostream>
using namespace std;
class Test
{
public:
Test()
{
}
int GetValue()
{
return 2;
}
};
int main()
{
Test* test = new Test();
cout << test->GetValue() << endl;
//test = NULL;
delete test;
cout << test->GetValue() << endl;
system("pause");
return 0;
}
Output:
2
2
I'm a beginer.
|
|
|
|
|
This works because executing GetValue doesn't access any part of a Test object. The function is resolved at compile time. It doesn't access any data members, so the fact that you've deleted the object doesn't affect the execution of the code.
But even though this case works, don't do this in production code or anything...please.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Well i got it,and thank you for your help.
|
|
|
|
|
Check this:
class Test
{
int p;
public:
Test()
{
p=2;
}
int GetValue()
{
return p;
}
~Test()
{
}
};
int main()
{
Test* t1 = new Test();
cout << t1->GetValue() <<endl;
delete t1;
t1=NULL;
cout <<t1->GetValue()<<endl;
system("pause");
return 0;
}
Beware of the consequences of writing this type of code that you wrote
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|