Hi there,
I work as Google Apps Script developer. I believe that you want an Addon that will show a sidebar with a button to hit to start recording voice, then by inserting it to the doc, I assume that you mean convert the voice into text and place it inside the doc, right?
By the way, Google Script that is used to code Google Add Ons for Docs, Sheets or Forms is based on JavaScript, not Java. You can google the difference between them!
I will be happy to hear more details form you!
Sincerely,
Mohamed