Exemple #1
0
        /// <summary>
        /// Splits sound data into its loudest chunks, ignoring the ambient noise
        /// surrounding them.
        /// </summary>
        /// 
        /// <remarks>
        /// This method assumes that the data is a lot louder than the noise around
        /// it. The first part of every bit sample has to be a large value, so when
        /// the average on the right of where we're looking jumps radically, we
        /// know we've found something.
        /// </remarks>
        /// 
        /// <param name="data">The data to split up.</param>
        /// <returns>The resultant chunks.</returns>
        public SoundData[] SplitChunks(SoundData data)
        {
            List<SoundData> chunks = TrimNoise(data.GetSoundEnumerator());

              SoundData[] output = new SoundData[chunks.Count];
              for (int i = 0; i < chunks.Count; ++i) {
            output[i] = chunks[i];
              }

              return output;
        }