You probably want to use the Java Sound API:
https://www.baeldung.com/java-sound-api-capture-mic. This doesn't have anything to do with Kotlin Multiplatform unless you're planning on sharing parts of the application with another platform. Also KMM means Kotlin Multiplatform for Mobile, not Desktop. First step to getting the right guidance is asking the right question... What's your actual use case?