Silence Detection MP3

Discussion in 'C++' started by Senger, Mar 10, 2006.

  1. Senger

    Senger Guest

    How I can detect a silence in MP3 File??
    Senger, Mar 10, 2006
    #1
    1. Advertising

  2. Senger

    Ben Pope Guest

    Senger wrote:
    > 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
    --
    I'm not just a number. To many, I'm known as a string...
    Ben Pope, Mar 10, 2006
    #2
    1. Advertising

  3. Senger

    Tomás Guest

    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
    Tomás, Mar 10, 2006
    #3
  4. Senger

    Rolf Magnus Guest

    Tomás wrote:

    > 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;
    > }


    Only for a (quite odd) special case of silence.
    Rolf Magnus, Mar 11, 2006
    #4
  5. Senger

    Senger Guest

    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!!
    Senger, Mar 13, 2006
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Richard Brookes

    Using httpHandlers to allows access to mp3 files

    Richard Brookes, Jul 9, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    393
    Richard Brookes
    Jul 9, 2003
  2. Daniel Dyer
    Replies:
    6
    Views:
    19,813
    Knute Johnson
    Jan 22, 2006
  3. Asle Frantzen

    Mp3-player - how to play an mp3?

    Asle Frantzen, Jul 8, 2003, in forum: C++
    Replies:
    5
    Views:
    659
    Kelsey Bjarnason
    Jul 22, 2003
  4. HY Tech
    Replies:
    0
    Views:
    608
    HY Tech
    Sep 7, 2003
  5. Sam Stephenson
    Replies:
    9
    Views:
    222
    Caleb Clausen
    Nov 7, 2005
Loading...

Share This Page