Tone limit 20KHz by Tech-TX · Pull Request #7179 · esp8266/Arduino (original) (raw)
Add 2 comments since I found out where the 5KHz upper limit on Tone output frequency was, apparently added for compatibility with the Arduino library some time in the past.
If you want the full 20KHz audio frequency range, change the two lines in Tone.cpp at line 38 to:
high = std::max(high, (uint32_t)25); // new 20KHz maximum Tone frequency low = std::max(low, (uint32_t)25);