I am using apache tika for detecting the mime type of audio and video files. For some reason tika reports the mime type of the wma file (Windows Media Audio format owned by Microsoft) as application/octet-stream. Do you know a better way to find mime type of file in java? Or can I use tika itself to query this information?
finding mime type of wma files using java
2.2k Views Asked by Ajith Jose At
2
There are 2 best solutions below
1
Gagravarr
On
Tika should be able to detect the files if you supply a filename for them, eg
Metadata m = new Metadata();
m.add(Metadata.RESOURCE_NAME_KEY, filename);
detector.detect(stream, m);
I've opened https://issues.apache.org/jira/browse/TIKA-629 to track the lack of mime magic detection for if you don't have the filename to hand.
Related Questions in JAVA
- Add image to JCheckBoxMenuItem
- How to access invisible Unordered List element with Selenium WebDriver using Java
- Inheritance in Java, apparent type vs actual type
- Java catch the ball Game
- Access objects variable & method by name
- GridBagLayout is displaying JTextField and JTextArea as short, vertical lines
- Perform a task each interval
- Compound classes stored in an array are not accessible in selenium java
- How to avoid concurrent access to a resource?
- Why does processing goes slower on implementing try catch block in java?
- Redirect inside java interceptor
- Push toolbar content below statusbar
- Animation in Java on top of JPanel
- JPA - How to query with a LIKE operator in combination with an AttributeConverter
- Java Assign a Value to an array cell
Related Questions in AUDIO
- Play multiple audio files in a slider
- Unity3d AudioSource not creatable
- JavaFX can't play mp3 files
- iPhone simultaneous sound output
- Phonegap Build App - Play Audio
- HTML5 Audio pause not working
- Java boolean play button issue (play over and over again with each click)
- import a sound externally or from the library? AS3
- Set audio source
- Saving a sound bite as a ringtone
- Using OnAudioFilterRead with playOnAwake
- Audio recorded with Samsung does not play on iOS
- fftw of 16bit Audio :: peak appearing wrong at 2f
- How to Export an audio file with effect in iOS
- Tried multiple solutions onsite, none worked: Play <audio> on Konami code
Related Questions in MIME
- Gmail API playground: Send method, converted MIME raw header not populating email fields on send
- HTML image not showing up in MIME message sent via Gmail API in VBA, Used 3D
- Identifying a pdf file and upload it to folder
- How to create MIME-atachment text/xml in Java?
- Python SMTP/MIME Message body
- Why can't insert my subject of gmail header info into a sqlite3 database?
- MIME-attach in java SOAPMessage
- Plain text emails displayed as attachment on some email clients
- Trying to send "alternative" with MIME but it also shows up in capable mail client
- TypeError: object of type 'method' has no len() | Trying to attach file to email msg
- "All Supported" in "Files of type:" combobox of QFileDialog
- SMTP dot-stuffing within MIME boundaries
- Zip sent via email is invalid on first attempt
- php bug? reading mime enc on a 1 byte file?
- android get full path to my application via share option
Related Questions in WMA
- C# - Modify WMA extended properties programatically (possibly with NAudio)
- J2ME WMA Delivery Report
- SMS goes to the inbox when the mobile is disconnected
- finding mime type of wma files using java
- How to merge wma files to mp3 (with header editing)?
- J2ME SMS receive not responding
- C#: convert WAV to xWMA
- SMS sent from j2me not recieved by non-java phones like android and gsm modem
- receiving sms j2me
- IOS: stop audio when I return in a view
- How to I encode a url in my midlet
- How can I make my midlet send an SMS message to multiple recipients
- Receive sms on specific port j2me
- Write WMA tags in PHP
- Can a native Blackberry application (not MIDlet) use MIDP Push Registry?
Related Questions in APACHE-TIKA
- How to parse and index a big file in multi parts so it can consume less memory while reading a file in input-stream?
- Solr 5.1.0 - Apache TikaEntityProcessor Cannot Find My Files
- How to add new mime type to apache tika
- Adding to custom detector class to apache tika
- Tika text extraction not working on HDFS
- How to properly configure AutoDetectParser in Tika?
- How to parse octet-stream files using Apache Tika?
- Error Submitting PDF's using SolrJ and Solr 5.1.0
- how to extract content of '.msg' files generated by outlook?
- Parsing open graph tags with nutch (into ElasticSearch)
- OneNote support for Apache Tika parsers
- Tika unable to parse after detecting mime-type
- Apache Tika and Apache Solr integration through Java API
- Httpclient asp.net core curl equivalent
- Error indexing text from Apache Tika in Solr
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
As per Microsoft support: http://support.microsoft.com/kb/284094, the mime type of WMA should be
audio/x-ms-wma. As per: http://kb.iu.edu/data/agtj.html the mime-typeapplication/octet-streamrepresents a binary file. I am not sure why TIKA is failing to recognize the proper mime type but it is the fallback/backup strategy to returnapplication/octet-streamif the actual mime is not recognizable. The reason for failure could be many:Have a look at the below links for finding out mime-types in Java: