Oh, it was only a suggestion ... if you end up needing higher resolution you could do something like this (except use an ESP32's output). You would essentially be creating your own PWM controlled DAC with higher bit resolution (13-bit for example). The PWM duty value would set the voltage. To get a sine wave, you would vary the duty cycle like this, but using an ESP32.
Probably best to keep it simple and start with using the ESP's DAC as you've suggested.