isAudio static method

bool isAudio(
  1. String filePath
)

Checks if string is an audio file.

Implementation

static bool isAudio(String filePath) {
  final ext = filePath.toLowerCase();

  return ext.endsWith(".mp3") ||
      ext.endsWith(".wav") ||
      ext.endsWith(".wma") ||
      ext.endsWith(".amr") ||
      ext.endsWith(".ogg");
}