File types: use metadata information.

@jankeromnes, this should make the sounds rock-solid!