As for ripping from video, I'm no expert but on Winblows
- for Blu-rays I use MakeMKV either to make decrypted backups or remux the video to an mkv.
- for DVDs I use MakeMKV or DVD Decrypter.
MakeMKV has a FLAC profile that you can setup, so if you use that to remux2mkv and the source had at least LPCM audio, you'd just have to extract the resulting FLAC. mkvtoolnix/mkvextract or whatever works.
If I need to do anything else to get the audio, I usually use eac3to. I forgot if you needed any extra DLLs for audio like DTS-HD MA.
You could also probably use foobar2000 on just about anything (including mkvs) to convert to another audio format, lol.