ported audio encoder. unit test works, fg with encoder and scrambler seems to work well.