Increase only low bit section of a song

Apr 17, 2013 at 7:56 AM
Edited Apr 17, 2013 at 11:27 AM
hi,
Help me mark. I have a problem on a project.I want to only Increase Low bit section Of a track.High bit section are same.i follow and use naudio project. I want particular portion of code.
Coordinator
Apr 18, 2013 at 4:11 PM
Probably a low shelving filter would be what you want, allowing you to boost low frequencies. NAudio does not include one out of the box, so you'd need to find an algorithm and port it to C# as an implementation of ISampleProvider
Apr 18, 2013 at 4:18 PM
Edited Apr 19, 2013 at 8:35 AM
i write the code on SimpleCompressorStream class.like that:



public override int Read(byte[] array, int offset, int count)
    {
        lock (this)
        {
            if (Enabled)
            {
                if (sourceBuffer == null || sourceBuffer.Length < count)
                    sourceBuffer = new byte[count];
                int sourceBytesRead = sourceStream.Read(sourceBuffer, 0, count);
                int sampleCount = sourceBytesRead / (bytesPerSample * channels);
                double right1 = Decibels.LinearToDecibels(Math.Abs(BitConverter.ToDouble(sourceBuffer, 0)));
                if (right1 < -450.0  )
                {
                    if (MakeUpGain < 20)
                        MakeUpGain += 1;
                }
                else if (right1 > -450.0 && right1 < -300.0)
                {
                    if (MakeUpGain < 10)
                    {
                        MakeUpGain += 1.0;
                    }
                    else
                    {
                        MakeUpGain -= 1.0;
                    }
                }
                else if (right1 > -300.0 )
                {
                    if (MakeUpGain < 1)
                    {
                        MakeUpGain += 1.0;
                    }
                    else
                    {
                        MakeUpGain -= 1.0;
                    }
                }
                else
                {
                    if (MakeUpGain != 1)
                    {
                        MakeUpGain -= 1.0;
                    }
                    else
                    {
                        MakeUpGain += 1.0;
                    }
                  //  MakeUpGain = -3;
                }
                //if (right1 > -850.0 && right1 < -440 && MakeUpGain < 8)
                //{
                //    for (int i = 0; i > right1; i++) 
                //    {

                //    }
                //}
                for (int sample = 0; sample < sampleCount; sample++)
                {
                    int start = sample * bytesPerSample * channels;
                    double in1;
                    double in2;

                    ReadSamples(sourceBuffer, start, out in1, out in2);
                    simpleCompressor.Process(ref in1, ref in2);
                    WriteSamples(array, offset + start, in1, in2);

                }
                return count;
            }
            else
            {
                return sourceStream.Read(array, offset, count);
            }
        }

    }
But problem is that when low bit instantly increase high bit then a noise arise. otherwise it will be worked.send me code.
Apr 20, 2013 at 6:47 AM
anyone can help me.I want the code .pls help me.