jj1bdx/airspy-fmradion

MP3 output support via libsndfile

jj1bdx opened this issue · 6 comments

jj1bdx commented

Things to consider:

  • Supported output formats
    • Not giving too many options -> one option only
      • I don't want to make command parsing too complex
    • mono and joint-stereo -> automatically chosen
      • no dual-channel stereo (FM stereo is joint-stereo by definition)
    • bitrate -> VBR (LAME -V 1)
      • 320kbps stereo for archiving reference
      • 192kbps joint-stereo mode for a good FM recording quality
      • 48kbps mono for AM radio?
      • I'd rather choose 64kbps mono for AM radio in full-quality
    • ID3 header to add -> not doing this
      • Time info only, minimal -> the pps.txt file will do

See #74

Ubuntu 22.04 does not have MP3-capable libsndfile (1.0.31) in the package; MP3 output is supported since libsndfile 1.1.0 and later.

Ubuntu 22.04 does not have MP3-capable libsndfile (1.0.31) in the package; MP3 output is supported since libsndfile 1.1.0 and later.

This issue has been solved by introducing conditional compilation for libsndfile by detecting the version from the pkg-config info as 5554157 and 8a5c158.

I decided to use VBR with LAME -V 1 (i.e., compression level = 0.1) for the following reasons:

  • I didn't want to support multiple MP3 types
    • If you want precise parameter tuning, you can always feed the raw audio output into an external LAME program
  • The parameter set -V 1 gives a slightly higher quality than CBR 192kbps for stereo and 96kbps for mono
    • Approx. 220 to 230kbps in average
  • Using VBR will automatically choose the optimal bandwidth for given audio channels (i.e, for mono or stereo)

Tested on Ubuntu 22.04.4 LTS x86_64, macOS 14.4 with Mac mini 2023, and Raspberry Pi OS Lite 64bit for the MP3 capability. All worked OK.

#74 is merged to dev branch. Close this issue accordingly.