Click here to Skip to main content
15,895,781 members
Articles / Web Development / HTML

How to change the pitch and tempo of a sound

Rate me:
Please Sign up or sign in to vote.
4.91/5 (34 votes)
24 Sep 2011LGPL36 min read 195.9K   14.9K   71  
This article shows how to change the pitch and tempo of a sound.
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

namespace LumiSoft.Media.Wave.Native
{
    /// <summary>
    /// This class represents WAVEHDR structure.
    /// </summary>
    [StructLayout(LayoutKind.Sequential)]
    internal struct WAVEHDR
    {
        /// <summary>
        /// Long pointer to the address of the waveform buffer.
        /// </summary>
        public IntPtr lpData;
        /// <summary>
        /// Specifies the length, in bytes, of the buffer.
        /// </summary>
        public uint dwBufferLength;
        /// <summary>
        /// When the header is used in input, this member specifies how much data is in the buffer. 
        /// When the header is used in output, this member specifies the number of bytes played from the buffer.
        /// </summary>
        public uint dwBytesRecorded;
        /// <summary>
        /// Specifies user data.
        /// </summary>
        public IntPtr dwUser;
        /// <summary>
        /// Specifies information about the buffer.
        /// </summary>
        public uint dwFlags;
        /// <summary>
        /// Specifies the number of times to play the loop.
        /// </summary>
        public uint dwLoops;
        /// <summary>
        /// Reserved. This member is used within the audio driver to maintain a first-in, first-out linked list of headers awaiting playback.
        /// </summary>
        public IntPtr lpNext;
        /// <summary>
        /// Reserved.
        /// </summary>
        public uint reserved;
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU Lesser General Public License (LGPLv3)


Written By
China China
E-mail:calinyara@gmail.com

Comments and Discussions