This is totally off the wall, but I had to do it today. I needed the audio track from an MKV file. If you got here from Google, there's several desktop apps that can do this, but I don't like that approach; I'd much rather do things on a command line.

I used a few tools from mkvtoolnix to do it. Install instructions are beyond the scope of this post, but are available here.

First, you need to know the tracks that make up the file. To do this, you can use the mkvinfo command:

mkvinfo My_File.mkv

This will output something like this:

With that output, I was able to determine what track I needed to extract. (Take note of the track ID for mkvextract and mkvmerge.)

To extract that track from the file, all I had to do was use the mkvextract command:

mkvextract tracks My_File.mkv 2:audio.ac3

Once extracted, I was able to play/stream the file using VLC.