Calculate SPEECH TIME of the text in the “textarea” and add +1 item to the “input”

I’m creating a system for broadcasters to sell their productions.

  1. I need to create a script to calculate the SPEAKING TIME of the words inserted in the “textarea”.

  2. Then, between 01 and 40 seconds, add +1 item to the “input”.

For example:
Text with 01 to 40 seconds: 1 item in the input.
Text with 41 to 80 seconds: 2 input items.
Text with 91 to 120 seconds: 3 input items.
Text with 121 to 160 seconds: 4 input items.

That is, each “input” adds +1 to each beginning of text with 40 seconds.

Successively.

Example in practice:

Hello World. I am typing in textarea.

Time: 05 seconds
Characters: 37
Quantity that goes to the input: 1