WORKAROUND Instead of restricting your app for those devices when your recording fails to meet the sample rate then pop up a dialog and ask the user if your app should "Emit" the required tone instead of recording.
The end user can then repeatedly play the desired frequency on you app via a button, they can adjust the piano string to match the frequency they hear from the device. [ inverse mode ] They should hear "beats" when the frequencies approach each other. On Wednesday, December 23, 2015 at 11:16:41 AM UTC-5, Robert Scott wrote: > > There is an audio recording problem with some devices, even newer ones. > The native audio recording sample rate appears to be a puny 8000 Hz, which > means it can only render frequencies up to 4000 Hz. This is a problem for > my piano tuning app which must detect frequencies above 4000 Hz. to tune > the top few notes. > > So far I have only gotten reports of this problem on certain models of the > LG G3 and the Nexus 7 (Asus). The worst part is these devices do not > return an error when we try to set up an audio input stream and request a > sample rate of 22050 Hz. Instead they take their 8000 samples per second > and up-sample by duplicating each sample 2 or 3 times to give us audio that > appears to be sampled at 22050 samples per second as requested, but it > still cannot faithfully render frequencies above 4000 Hz, so our piano > tuning app gives very strange results for the top few notes on the piano. > > Does anyone here work with audio input apps and can you confirm this > problem on any other devices? You can test it out by sideloading our app > from > > www.tunelab-world.com/atl.html > > It will run in free-trial mode well enough to test this out. To test for > the sampling rate problem, tap on the large "A4" and select the note "B7" > by tapping on the "7" first. Then on a different device or computer, > generate a tone at 3950 Hz. One such on-line source is > > onlinetonegenerator.com/ > > If this tone produces just one peak in the spectrum display at 3950 Hz, > then everything is fine. But if this produces two peaks - one at 3950 and > the other at 4050, then you have a device that is sampling at 8000 Hz and > then up-sampling to feed our app a fake 22050 samples per second. > > -Robert Scott > Hopkins, MN > > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/android-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/android-developers/460bc1e6-5fd5-4cb7-83be-3c8dfd77b8d1%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

