Leonidius20 / RecordingStudio

Audio recorder app for Android
GNU General Public License v3.0
95 stars 4 forks source link

Add sample rate and bit rate settings at least for opus codec #3

Closed pvagner closed 3 weeks ago

pvagner commented 2 months ago

The default opus encoder setup on Android is not taylored for storing recorded data. It's more suitable for low bandwidth. It's configured in narrow band with the default sample rate of 8000 Hz. In order to record an appropriate sounding opus recordings it should be possible to configure sample rate and bit rate. I am suggesting setting it to atleast 48000 Hz and 32 kbps as the default. Please have a look into the Opus FAQ to see which sampling rates are supported. I think the encoder as shipped on Android already does the resampling we just need an ability to configure the sampling rate correctly. Additionally opus files as recorded with this app are not yet playable when switching to the recordings tab.

Here is an output of running opusinfo on an opus recording recorded on my phone to illustrate what I am reffering to.

Processing file "2024-09-08-19-13-14.oga"...

New logical stream (#1, serial: 643c9869): type opus
WARNING: Implausibly low preskip in Opus stream (1)
Encoded with libopus
WARNING: EOS not set on stream 1 (normal for live streams)
Opus stream 1:
    Pre-skip: 52
    Playback gain: 0 dB
    Channels: 1
    Original sample rate: 8000 Hz
    Packet duration:   20.0ms (max),   20.0ms (avg),   20.0ms (min)
    Page duration:     20.0ms (max),   20.0ms (avg),   20.0ms (min)
    Total data length: 20475 bytes (overhead: 51.4%)
    Playback length: 0m:07.438s
    Average bitrate: 22.02 kbit/s, w/o overhead: 10.71 kbit/s
Leonidius20 commented 2 months ago

Thank you for the feedback. I am planning to add sample rate and bit rate settings for all codecs in a future version. Can't predict when it will be released though, hopefully sooner than later

Leonidius20 commented 1 month ago

Hey there! I wanted to let you know that the newest version (0.2.0) supports setting sample rate for all codecs and bit rate for some, including OPUS. Please check if it works as desired. As for OPUS files not playing on the Recordings tab - I could not reproduce the issue, could you check if it still exists in 0.2.0? it could have been due to issues with the list itself which were fixed in previous versions.