Example #1
0
 public void Convert()
 {
     for (int i = 0; i < NSamples.GetLength(0); i++)
     {
         short[] channelSample = NSamples[i];
         if (channelSample != null)
         {
             CHAN_ID id         = (CHAN_ID)Enum.ToObject(typeof(CHAN_ID), i);
             short   noiseLevel = Config.GetConfig().GetChannelBackgroundNoiseLevel(id);
             int     len        = channelSample.Length;
             for (int j = 0; j < len; j++)
             {
                 if (channelSample[j] < 0)
                 {
                     channelSample[j] = (short)-channelSample[j];
                 }
                 if (channelSample[j] <= noiseLevel)
                 {
                     channelSample[j] = 0;
                 }
             }
         }
     }
 }
Example #2
0
 public override int GetHashCode()
 {
     return(this.GetType().FullName.GetHashCode() ^ Info.GetHashCode() ^ NSamples.GetHashCode() ^ NPlanes.GetHashCode() ^ _planes.GetHashCode() ^ Buffer.GetHashCode() ^ _map_infos.GetHashCode());
 }
Example #3
0
 public bool Equals(AudioBuffer other)
 {
     return(true && Info.Equals(other.Info) && NSamples.Equals(other.NSamples) && NPlanes.Equals(other.NPlanes) && _planes.Equals(other._planes) && Buffer.Equals(other.Buffer) && _map_infos.Equals(other._map_infos));
 }