4

I have managed to decode MP3 files using MediaCodec. But failing at decoding wmafiles of mime type = x/ms-wma. The code works as expected for MP3 files, and i see MP3Extractor is instantiated in [MediaExtractor](http://androidxref.com/4.1.2/xref/frameworks/av/media/libstagefright/MediaExtractor.cpp)

But there's no such class WMAExtractor in libstagefright,

If this is the problem then how MediaPlayer can able to play wma files ??

Where am i missing things up, or where the mess up??

Can anyone direct me understand this scenario very well

How can i decode wma files ?

NOTE when i select a wma file, i see in log

Received message for kKeyCodecConfig

The device under test is Samsung GTS9300

fadden
  • 51,356
  • 5
  • 116
  • 166
nmxprime
  • 1,506
  • 3
  • 25
  • 52
  • 1
    I deleted my answer since I just discovered my phone plays WMA as well. :) I looked at the ADB output for clues. No dice. – selbie Jul 18 '14 at 06:57
  • On my HTC M8, WMA plays fine with MediaPlayer. A casual internet search suggests IHVs may bundle additional codecs with the phones. That doesn't answer your question though. Sorry. :( – selbie Jul 18 '14 at 07:16
  • @selbie, Thanks, and i agree that x/ms-wma is proprietary, and hence Android cannot have it AOSP licensed release (correct me if i am wrong). So Handset vendors bundle their custom/legacy codecs to support it, though – nmxprime Jul 18 '14 at 08:03
  • look at ffmpeg or vlc on android for libs to handle codecs missing from base android. – Robert Rowntree Jul 19 '14 at 15:25
  • @RobertRowntree, I do hope so that vendors have exposed wma codec, so trying to do the stuff without external library as far as possible, I knew if it's impossible with only Android source tree, then next is external libraries such you sugested – nmxprime Jul 21 '14 at 03:55

1 Answers1

1

For wma i.e. Windows Media Audio, the container format typically would be ASF i.e. Advanced System Format or AVI i.e. Audio Video Interleave format. AFAIK, wma doesn't have an in-built container specification like MP3 and hence, is dependent on other container formats like asf and avi.

Most asf files have wma audio content and hence, if your device supports asf files, you should be able to play them. Most samsung devices do play asf and hence, it should work out of the box.

Even though the platform may expose a wma MediaCodec i.e. codec component, you should have a corresponding MediaExtractor and hence, you should check if asf or avi is supported. My bet would be on asf.

Ganesh
  • 5,880
  • 2
  • 36
  • 54