Search found 4 matches

by hadikazemi
Sun Sep 27, 2009 12:14 pm
Forum: Recording Techniques
Topic: help for sound noise suppression ... (directSound)
Replies: 10
Views: 1782

Re: help for sound noise suppression ... (directSound)

hi
i use below code and it work very well !!!! (for 8bit wave file)

Code: Select all

for( cT = 0; cT < nSizeToWrite; cT=cT+1 )
{
	offset2 = 127 - *((BYTE*)pbSrcData+cT);
	offset = abs(offset2);
	avg = avg + offset*offset;
}
db = (float)sqrt(avg/nSizeToWrite)/256;
db = 20*log10(db);

if(db > -50) {
//record
by hadikazemi
Sun Sep 27, 2009 4:16 am
Forum: Recording Techniques
Topic: help for sound noise suppression ... (directSound)
Replies: 10
Views: 1782

Re: help for sound noise suppression ... (directSound)

hi tnx everyone speakers dont play silence... i want to be in place of speaker ... speaker get some sound samples (from wav file) , if speaker dont play any thing means those samples were silence. how speaker don't play some samples? i want to be in place of speaker and detect samples that speaker d...
by hadikazemi
Fri Sep 25, 2009 6:05 pm
Forum: Recording Techniques
Topic: help for sound noise suppression ... (directSound)
Replies: 10
Views: 1782

Re: help for sound noise suppression ... (directSound)

thanks every body ! i work for one company that they want from me to do this. i use below sample and my code do beter but not good ! i miss some low sound and some silence be recorded yet ! (my wave file is 16bit and i didn't attention) for( cT = 0; cT < nSizeToWrite; cT=cT+2 ) { offset = 127 - *((B...
by hadikazemi
Fri Sep 25, 2009 8:26 am
Forum: Recording Techniques
Topic: help for sound noise suppression ... (directSound)
Replies: 10
Views: 1782

help for sound noise suppression ... (directSound)

hi I used DirectSound for recording sound. I want to record only when someone speeches not when she's silent. So I checked average of capture buffer. If it is between 123 and 132, sounds aren't recorded: for( cT = 0; cT < nSizeToWrite; cT++ ) { avg = avg + *((BYTE*)pbSrcData+cT); } avg = avg / nSize...