コード例 #1
0
        /// <summary>
        /// Converts the contents of the SourceBuffer into the DestinationBuffer
        /// </summary>
        /// <param name="bytesToConvert">The number of bytes in the SourceBuffer
        /// that need to be converted</param>
        /// <param name="sourceBytesConverted">The number of source bytes actually converted</param>
        /// <returns>The number of converted bytes in the DestinationBuffer</returns>
        public int Convert(int bytesToConvert, out int sourceBytesConverted)
        {
            if (bytesToConvert % sourceFormat.BlockAlign != 0)
            {
                Debug.WriteLine(String.Format("NOT A WHOLE NUMBER OF BLOCKS", bytesToConvert));
                bytesToConvert -= (bytesToConvert % sourceFormat.BlockAlign);
            }

            return(streamHeader.Convert(bytesToConvert, out sourceBytesConverted));
        }
コード例 #2
0
        /// <summary>
        /// Converts the contents of the SourceBuffer into the DestinationBuffer
        /// </summary>
        /// <param name="bytesToConvert">The number of bytes in the SourceBuffer
        /// that need to be converted</param>
        /// <param name="sourceBytesConverted">The number of source bytes actually converted</param>
        /// <returns>The number of converted bytes in the DestinationBuffer</returns>
        public int Convert(int bytesToConvert, out int sourceBytesConverted)
        {
            if (bytesToConvert % sourceFormat.BlockAlign != 0)
            {
                System.Diagnostics.Debug.WriteLine(String.Format("Not a whole number of blocks: {0} ({1})", bytesToConvert, sourceFormat.BlockAlign));
                bytesToConvert -= (bytesToConvert % sourceFormat.BlockAlign);
            }

            return(streamHeader.Convert(bytesToConvert, out sourceBytesConverted));
        }
コード例 #3
0
        /// <summary>
        /// Converts the contents of the SourceBuffer into the DestinationBuffer
        /// </summary>
        /// <param name="bytesToConvert">The number of bytes in the SourceBuffer
        /// that need to be converted</param>
        /// <param name="sourceBytesConverted">The number of source bytes actually converted</param>
        /// <returns>The number of converted bytes in the DestinationBuffer</returns>
        public int Convert(int bytesToConvert, out int sourceBytesConverted)
        {
            if (bytesToConvert % sourceFormat.BlockAlign != 0)
            {
                NAudioLogger.Instance.LogWarning(string.Format("Not a whole number of blocks: {0} ({1})", bytesToConvert, sourceFormat.BlockAlign));
                bytesToConvert -= (bytesToConvert % sourceFormat.BlockAlign);
            }

            return(streamHeader.Convert(bytesToConvert, out sourceBytesConverted));
        }