For more information see the MediaStream Recording API Editor's Draft.
Record audio: Echo cancellation: