-2

I'm new in android development. I'm now trying to play a single tone on a specific frequency on my cell phone. I didn't find any method that could play a specific tone. For example, only play a tone on 400Hz. Does anyone help me to find some method? Thank you.

PS:Some friends mentioned me that this question is same with another question. But after I test that code I got three frequencies.here is the spectrum I got from that question

Ma Hans
  • 11
  • 1
  • 1
    possible duplicate of the following question: http://stackoverflow.com/questions/2413426/playing-an-arbitrary-tone-with-android – Er. Kaushik Kajavadara Oct 17 '16 at 07:30
  • I've been tried that before, but what I achieved is I could see two more tones play together with the frequency I want to play. – Ma Hans Oct 17 '16 at 07:53

1 Answers1

0

There are a utility software under linux named 'sox' which can generate any single frequency you wanted. for example: sox -r 44100 -n 5.wav synth 60 sine 20
this command can generate a file named 5.wav, which is 20Hz sine wave with sample rate 44.1k and lasting 60 seconds. you can try android version: https://github.com/Kyborg2011/SoxPlaye

wen
  • 114
  • 1
  • 3