How to change speaker output

hello
I am making an app for XREAL Light.
When playing sound in an app, I want to output it from the smartphone’s speaker instead of XREAL Light’s built-in speaker. How can I implement this?