Correction to ParseOgg function

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Correction to ParseOgg function

      You calculate the length with this instead of the current method in the source code:

      Source Code

      1. m_LengthMilli = 1000.f * ov_time_total(&vf, -1);


      Also, the size of the PCM buffer didn't take number of channels into account, I think.
      This old code:

      Source Code

      1. DWORD bytes = (DWORD)ov_pcm_total(&vf, -1); bytes *= 2;

      Needs to become this:

      Source Code

      1. DWORD bytes = (DWORD)ov_pcm_total(&vf, -1); bytes *= 2 * vi->channels;
    • RE: Correction to ParseOgg function

      Hey there - setting the length uses the following code right now outside of ParseOgg:

      m_LengthMilli = ( GetPCMBufferSize() * 1000 ) / GetFormat()->nAvgBytesPerSec;


      Perhapse should we move the m_LengthMilli setting inside ParseWave() and ParseOgg() ??
      Mr.Mike
      Author, Programmer, Brewer, Patriot
    • Oh yeah, I forgot to mention that I changed the way length was calculated for Oggs to use the API provided for them.

      So now this line is inside ParseOgg:

      Source Code

      1. m_LengthMilli = 1000.f * ov_time_total(&vf, -1);


      And the other line you noted is exclusively inside ParseWave.

      ...in the codebase that I'm currently working on, at least.
    • These mods are going into the GCC 3.0 codebase.
      Mr.Mike
      Author, Programmer, Brewer, Patriot