The encode() method of the AudioEncoder interface enqueues a control message to encode a given AudioData object.
encode()
MDN Reference