Class MediaTypeUtils
java.lang.Object
com.ibm.watson.speech_to_text.v1.util.MediaTypeUtils
public final class MediaTypeUtils extends Object
The utilities required for processing audio files using the
SpeechToText
service.- See Also:
SpeechToText
-
Method Summary
Modifier and Type Method Description static String
getMediaTypeFromFile(File file)
Returns the media type for a given file.static boolean
isValidMediaType(String mediaType)
Checks if the media type is supported by the service.
-
Method Details
-
getMediaTypeFromFile
Returns the media type for a given file.- Parameters:
file
- the file object for which media type needs to be provided- Returns:
- Internet media type for the file, or null if none found
-
isValidMediaType
Checks if the media type is supported by the service.- Parameters:
mediaType
- Internet media type for the file- Returns:
- true if it is supported, false if not.
-