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.
  • Constructor Details

    • MotorTranscriptionDuration

      public MotorTranscriptionDuration()
  • Method Details

    • getDuration

      public static int getDuration​(ChatMotor chatMotor, File audioFile) throws IOException
      Retrieves the duration of the specified audio file.
      Parameters:
      chatMotor - the ChatMotor instance to use for executing API requests
      audioFile - 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 file
      IllegalArgumentException - if the audio file does not exist
      MotorNotImplemendException - if the method is invoked on an Android device, where this functionality is not implemented
      NullPointerException - if the audioFile parameter is null