Class MotorTranscriptionDuration
java.lang.Object
com.chatmotorapi.api.transcription.MotorTranscriptionDuration
public class MotorTranscriptionDuration extends Object
Provides utility method to retrieve the duration of audio files.
This class leverages system-specific features to determine the duration of an audio file, using ffmpeg.
Android platforms is not supported.
Android platforms is not supported.
-
Constructor Summary
Constructors Constructor Description MotorTranscriptionDuration()
-
Method Summary
Modifier and Type Method Description static int
getDuration(ChatMotor chatMotor, File audioFile)
Retrieves the duration of the specified audio file.
-
Constructor Details
-
MotorTranscriptionDuration
public MotorTranscriptionDuration()
-
-
Method Details
-
getDuration
Retrieves the duration of the specified audio file.- Parameters:
chatMotor
- the ChatMotor instance to use for executing API requestsaudioFile
- the audio file from which the duration is to be determined- Returns:
- the duration of the audio file in milliseconds
- Throws:
IOException
- if an I/O error occurs when accessing the audio fileIllegalArgumentException
- if the audio file does not existMotorNotImplemendException
- if the method is invoked on an Android device, where this functionality is not implementedNullPointerException
- if the audioFile parameter is null
-