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 answers
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
- I need the BIRT.war that is compatible with Java 17 and Tomcat 10
- Creating global Class holder
- No method found for class java.lang.String in Kafka
- Issue edit a jtable with a pictures
- getting error when trying to launch kotlin jar file that use supabase "java.lang.NoClassDefFoundError"
- Does the && (logical AND) operator have a higher precedence than || (logical OR) operator in Java?
- Mixed color rendering in a JTable
- HTTPS configuration in Spring Boot, server returning timeout
- How to use Layout to create textfields which dont increase in size?
- Function for making the code wait in javafx
- How to create beans of the same class for multiple template parameters in Spring
- How could you print a specific String from an array with the values of an array from a double array on the same line, using iteration to print all?
- org.telegram.telegrambots.meta.exceptions.TelegramApiException: Bot token and username can't be empty
- Accessing Secret Variables in Classic Pipelines through Java app in Azure DevOps
- Postgres && statement Error in Mybatis Mapper?
Related Questions in AUDIO
- how to play a sounds in c# forms?
- Winsound not working isn't working at all
- Ringing noise overpowering voice / Recording audio with Max 9814 microphone on Raspberry pi pico using ADC Pin / Circuitpython
- How to take first x seconds of Audio from a wav file read from AWS S3 as binary stream using Python?
- gluon attach audio doesn't play any sound on android
- Implementing trim and fade filters with ffmpeg - MP3
- Unable to set device connection state as INPUT device type is none
- Is there a way to differentiate music and talking from a video?
- How to concatenate audio tracks and make them start a certain moment using Python?
- Combine two audio in different languages to one natural sounding
- STM32 - Serial Audio Interface (SAI) - dual data line transmit possible?
- playing mp3 downloaded via curllib gets cut short
- How to stream PCM audio to a speakers both on mac and linux in Node.js?
- Scikit-Maad -From the function rois.find_rois_cwt, I want to get a csv of the outputs so I can do my own analysis on it
- Using MediaPlayer slows down SoundPool sound effect
Related Questions in MIME
- How to process MIME format with inline image separated into a different boundary using TIdMessage?
- Remove (not clear) attachments from email
- How to send multipart/mime SOAP request
- MIME for preview text in subject line of email
- mime getType fails on valid mime-type
- HTML Email Weirdness
- Flutter transform MIME format in UI
- Vite+react (.jsx) with github
- How can I get my IIS web server to serve a ".log" file as text and not instead offer me a save/download
- How to get the text of the email body?
- How to convert html source from an email body to valid html?
- Image embedded in email also becomes an attachment
- Differences in MIME type between Firefox and Chrome when uploading CSV
- Setting File Type for Emailed Attachments
- C# Error : Message[Precondition check failed.] Location[ - ] Reason[failedPrecondition] Domain[global]
Related Questions in WMA
- C#: convert WAV to xWMA
- FFmpeg C API WMAV2 AVCodecParserContext not found even though CLI can parse WMAs on MacOS
- Tradingview pine script coding
- How do I get WMA if index size is greater than window size?
- How to merge wma files to mp3 (with header editing)?
- "ASFUnicodeAttribute" problem when printing wma song titles with mutagen
- Naudio fails to fully read WMA, OGG, and AC3 audio files
- How to convert WMA (audio) to an array of frequencies and durations
- Audio WMA incorrectly reported as video/x-ms-wma
- is reading .wma sound files in R possible?
- JW Player fails with error with wma files: Task Queue failed at step 5
- How do I get the bitrate from a WMA file in C#?
- How to play a wma audio file using Qt or any other cpp framework on linux?
- Erron on file.Save() 'Size is less than zero'
- Monogame Content Manager - WAV/MP3 Importer Terrible Final Quality
Related Questions in APACHE-TIKA
- getting osd output from tesseract on (need the script value Latin, cyrillic...) tika-server
- Why HOCR output does not work as expected for apache-tika
- The text in One Note file type is not being extracted properly by apache tika
- How to install new tesseract ocr language for apache/tika:2.9.1.0-full?
- High CPU consumption by Apache Tika
- Tika returns garbled text from PDF file
- Error trying to convert RTF to HTML using TIKA
- Apache Tika not returning text for embedding images in Microsoft Word documents (.doc, .docx)
- How to enable PDFParser in new Tika v2.9.0?
- Validate if the incoming MultipartFile is password protected or not for the file types (.docx, .doc, .ppt, .pptx, .xls, .xlsx) in java
- TIKA failing to parse CFF font
- High CPU usage while parse pdf document with Apache tika
- Skip all not support textual extraction parsers in tika-server
- tika-app-2.9.0. incompatibility with xmlbeans-5.0.3
- Apache Tika SQL3Lite parser
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?
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)
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: