Kaljurand / K6nele

An Android app that offers speech-to-text user interfaces to other apps
http://kaljurand.github.io/K6nele/
Apache License 2.0
267 stars 83 forks source link

Record in 44100Hz, downsample to 16000Hz #24

Open Kaljurand opened 9 years ago

Kaljurand commented 9 years ago

Original issue 20 created by Kaljurand on 2011-12-31T13:33:09.000Z:

The Android documentation says that "44100Hz is currently the only rate that is guaranteed to work on all devices, but other rates such as 22050, 16000, and 11025 may work on some devices".

We currently record in 16kHz which could be the reason why recording completely fails on some devices (e.g. Samsung Galaxy Gio). The solution would be to record in the single officially supported sample rate (44.1kHz) and then downsample the result to the best size/quality sample rate (16kHz).

See also:

http://developer.android.com/reference/android/media/AudioRecord.html#AudioRecord(int, int, int, int, int)

Kaljurand commented 9 years ago

Comment #1 originally posted by Kaljurand on 2012-02-15T11:41:45.000Z:

Recording fails even with 44100 Hz on Samsung Galaxy Ace.