Class: AzureSTT::Transcription

Inherits:
Models::Base show all
Defined in:
lib/azure_stt/transcription.rb

Overview

Model for a transcription. Contains the results and static methods to create and retrieve the transcriptions.

Instance Method Summary collapse

Instance Method Details

#failed?Boolean

Is the status is failed ?

Returns:

  • (Boolean)


35
36
37
# File 'lib/azure_stt/transcription.rb', line 35

def failed?
  status == 'Failed'
end

#finished?Boolean

Is the process finished ? (Succeeded or failed)

Returns:

  • (Boolean)


53
54
55
# File 'lib/azure_stt/transcription.rb', line 53

def finished?
  succeeded? || failed?
end

#reportModels::Report

Get the report of a transcription from transcriptions/id/files route



64
65
66
# File 'lib/azure_stt/transcription.rb', line 64

def report
  @report ||= retrieve_report
end

#resultsArray[Models::Result]

Get the results of a transcription. The results are the files containing the speech-to-text. As a transcription process can have multiple files, the results are in an Array.

Returns:



75
76
77
# File 'lib/azure_stt/transcription.rb', line 75

def results
  @results ||= retrieve_results
end

#running?Boolean

Is the process still running ?

Returns:

  • (Boolean)


26
27
28
# File 'lib/azure_stt/transcription.rb', line 26

def running?
  status == 'Running'
end

#succeeded?Boolean

Has the process succeeded ?

Returns:

  • (Boolean)


44
45
46
# File 'lib/azure_stt/transcription.rb', line 44

def succeeded?
  status == 'Succeeded'
end