Silence Detection MP3

B

Ben Pope

Senger said:
How I can detect a silence in MP3 File??

Your speakers don't make any noise when playing it at that point?

I'm not sure how your question relates to C++, perhaps you should find a
specific library that supports MP3 and then ask in a newsgroup or forum
where that library is topical.

Ben Pope
 
T

Tomás

Senger posted:
How I can detect a silence in MP3 File??

Assuming 16-Bit Audio:


typedef unsigned short uint16;

bool IsSampleSilent(uint16 sample)
{
return sample;
}


-Tomás
 
R

Rolf Magnus

Tomás said:
Senger posted:


Assuming 16-Bit Audio:


typedef unsigned short uint16;

bool IsSampleSilent(uint16 sample)
{
return sample;
}

Only for a (quite odd) special case of silence.
 
S

Senger

But It is possible to found the silent without processing the mp3 file?
For example:

ptr2 = pScriptFilepath;
fp = fopen(ptr2, "rb");
if(fp == NULL)return false;

fseek(fp,0,SEEK_END);
filesize = ftell(fp);
data = malloc(filesize);
fseek(fp,0,SEEK_SET);
bufsize = filesize / 8;
++bufsize;
bufsize *= 8;

memScriptFile = (char *) new char [bufsize];
if(memScriptFile == NULL)
{
fclose(fp);
return 0;
}

cChars = fread(memScriptFile, 1, filesize, fp);
nScriptFileSize = cChars;
fclose(fp);

for (int k=0; k<cChars; k++){
//read byte and verify if is silent.
if is silent, record the position in array...
}
I don´t now if this solution if is possibile because the MP3 file is a
encorder file....
I will try with directx, but i can´t find any kind of help to use
them....

Tks!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top