title
Products            Buy            Support Forum            Professional            About            Codec Central
 

mono conversions are overmodulated

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kurt

    • May 2002
    • 4

    mono conversions are overmodulated

    I convert files for use on an AM radio station. When I convert an MP3 or WAV stereo file to mono (Format: PCM; 44.100 kHz, 16 bit, Mono 86 kb/sec), it's way too hot. I have to reduce the gain by about 6 to 8 dB, and it's still distorted and clipped. Is there a way to reduce these levels so the end result isn't distorted?

    Kurt
  • daren
    dBpoweramp Enthusiast

    • Apr 2002
    • 153

    #2
    Hi,

    It's the way mono is created in these converters (by adding
    left and right together).

    My Real Audio, MP2, Dalet and AIFF codecs attenuate the
    left and right signals before adding.

    You could try;

    a) attenuating the audio before conversion (6dB is enough)
    b) convert first to AIFF mono and then to WAV (AIFF is also a linear format).

    Hey Spoon, how about putting in an attenuator in the WAV
    and MP3 codecs for mono conversions? I've got a routine for
    you if you want...

    Cheers,
    Daren.

    Comment

    • Unregistered

      #3
      This mono convertor is a good idea, by adding L and R channels some of the music quality that has been lost in the conversion from sound (analog) to memory (digital) will be restored.

      Comment

      • Spoon
        Administrator
        • Apr 2002
        • 44575

        #4
        Sure drop me the routine, I will drop it in the latest beta.
        Spoon
        www.dbpoweramp.com

        Comment

        • daren
          dBpoweramp Enthusiast

          • Apr 2002
          • 153

          #5
          Hi Spoon,

          Here is the attenuation routine I use:

          //================================================== =========================
          //routine to attenuate the pData buffer by 50% for stereo to mono conversions
          //================================================== =========================
          void CLWAVEOUT::Attenuate(char *pData, DWORD DataLength, int bps)
          {
          int i;

          switch(bps)
          {
          case 8:
          {
          unsigned char *pWorkerData = (unsigned char *)pData;
          int s;

          for (i=0;i<DataLength;i++)
          {
          s = (int) *pWorkerData;
          *pWorkerData = (unsigned char) (s / 2);
          pWorkerData++;
          }
          break;
          }

          case 16:
          {
          short int *pWorkerData = (short int *)pData;
          short int s;
          for (i=0;i<DataLength/2;i++)
          {
          s = *pWorkerData;
          *pWorkerData = (short int)(s / 2);
          pWorkerData++;
          }
          }
          }
          }


          I call this using the following line of code:

          //if we're making mono from stereo attenuate audio stream by 50%
          if ((MP2Stereo == 1) && (InputChannels==2))
          Attenuate(pSampleDataBuffer,DataSize,InputBitsPerS ample);

          The MP2Stereo is the same as MP3Stereo in your MP3 example codec.
          InputChannels and InputBitsPerSample are globals which get their
          values in the existing initialisation function:

          CLWAVEOUT::CLWAVEOUT (char *Filename, ENCompressionOpenResult &ReturnError, WAVEFORMATEX *WFXInputFormat)
          {

          InputBitsPerSample = WFXInputFormat->wBitsPerSample;
          InputChannels = WFXInputFormat->nChannels;
          }

          Not very exciting code, but it does the trick :-)

          Daren.

          Comment

          • daren
            dBpoweramp Enthusiast

            • Apr 2002
            • 153

            #6
            One more thing;

            You need to call this *before* sending your data to the Windows
            PCM ACM for stereo to mono conversion...

            Cheers,
            Daren.

            Comment

            • Spoon
              Administrator
              • Apr 2002
              • 44575

              #7
              Thanks
              Spoon
              www.dbpoweramp.com

              Comment

              Working...

              ]]>