Can I detect if some mobile was not able to play some audio file?

629 views Asked by At

I've noticed that some mobile phones are not able to play some video files. Sometimes it's .wav extension, and sometimes some other.

In such cases the app does not crash and no error is generated, but the audio file just silently does not get played.

How to detect such situations? Why is this happening on the first place?

PS. I need to detect this in Java code - programmatically

1

There are 1 answers

4
Lucifer On BEST ANSWER

Android Supported Media Formats read the document, it tells which kind of media files are supported by the android.

For crashing problem please put your code in try...catch block like below,

try
{
      // Code to play media file.
}
catch ( Exception e )
{
      // Display a Toast message, "File format doesn't support"
}