osmandapp / OsmAnd

OsmAnd
https://osmand.net
Other
4.66k stars 1.02k forks source link

Sample rate of audio notes #21028

Open blaueente opened 2 weeks ago

blaueente commented 2 weeks ago

I found that for audio notes the sampling rate is always 8000Hz, even if one selects AAC with a high bitrate. This is landline phone quality and makes notes sometimes hard to understand. Also this makes the user options to select better quality AAC or higher bitrates basically useless.

How to solve:

around AudioVideoNotesPlugin.java#L1207, please use this call to set the sampling rate:

MediaRecorder#setAudioSamplingRate It would be best if the user could choose the rate, just has he can select the bitrate. The usual options would be: 8000, 16000, 22050, 24000, 44100, 48000.

dmpr0 commented 2 weeks ago

ToDo

Format
Default AAC Audio sample rate
vshcherb commented 2 weeks ago

I think we will by default set 24 kHz, and avoid doing UI cause then task could be completed this release vs waiting next

blaueente commented 2 weeks ago

Maybe this table with recommended sample rates is helpful? So the sample rate could be automatically selected depending on the configured bitrate, that would be a simple array map: https://wiki.hydrogenaud.io/index.php?title=Fraunhofer_FDK_AAC#Recommended_Sampling_Rate_and_Bitrate_Combinations (I guess it is AAC-LC)

Btw, there are even codecs such as opus that do not care about input sample rate, opus just resamples any input that is not 48khz to 48khz, and filters out higher frequencies depending on configured bitrate. Not sure how AAC behaves in case of maximum sample rate but low bitrate, but I guess the mapping table is more suitable for it.