improve style/readability of code that discovers which audio file extension to use