There are a couple of flaws here:

1. /sdcard is probably invalid.

2. This only detects if there is a player advertising that it handles
audio/wma files. This does not mean that the player is correct, nor
does it mean that anything other than the player can play WMA files
(e.g., via MediaPlayer)

On Tue, Aug 23, 2011 at 9:10 PM, James <[email protected]> wrote:
> Of course there is:
> -----------------------------------------------------------------------------------------------------
>  Intent intent = new Intent(android.content.Intent.ACTION_VIEW);
>  Uri data = Uri.fromFile(new File("/sdcard/test.wma"));
> intent.setDataAndType(data, "audio/wma");
>  List<ResolveInfo> resolveInfos=
> getPackageManager().queryIntentActivities (intent, 0);
> boolean wmaCodecReady=resolveInfos.size()>0;
> --------------------------------------------------------------------------------------------------------------
> the above code may not pass compile and is just FYI.
> Hope it helps!
>
> On Aug 24, 6:40 am, b0b <[email protected]> wrote:
>> Is there a sensible way to detect if a particular audio decoder  which
>> may or may not be present depending on manufaturers,  is available
>> (for example: WMA) ?
>>
>> Right now I'm asking the user. There has to be a better way ?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android 3.1 Programming Books: http://commonsware.com/books

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to