I am facing an issue regarding playing the tone on a particular frequency.
I used the ToneGenerator
class as instructed by ChatGPT. I am unable to play it on a specific frequency.
I tried this:
private val generator = ToneGenerator(AudioManager.STREAM_RING, 100)
fun Beep(frequency: Float) {
generator.startTone(ToneManager.TONE_DTMF_0, 1000, 200) // Desired Frequency: 200
}
But it seems the 3rd parameter doesn't exist now. Is it possible to use the same tone generator to play any frequency?