Table of Contents

Class PipelineComputationExtensions

QOL extensions for pipeline computation tasks and results.

public static class PipelineComputationExtensions
Inheritance
object
PipelineComputationExtensions

Methods

GetSpeechToTextResult(BhashiniComputeResponse)

Gets the transcribed text from a BhashiniComputeResponse.

public static string GetSpeechToTextResult(this BhashiniComputeResponse pipelineResponse)

Parameters

pipelineResponse BhashiniComputeResponse

The current BhashiniComputeResponse.

Returns

string

The transcribed text.

GetTextToSpeechResult(BhashiniComputeResponse)

Gets the audio from a BhashiniComputeResponse.

public static Task<AudioClip> GetTextToSpeechResult(this BhashiniComputeResponse pipelineResponse)

Parameters

pipelineResponse BhashiniComputeResponse

The current BhashiniComputeResponse.

Returns

Task<AudioClip>

The synthesized audio.

Remarks

This method only supports Wav, Mp3 and Pcm*.

*Utilities.Audio is required.

GetTranslateResult(BhashiniComputeResponse)

Gets the translated text from a BhashiniComputeResponse.

public static string GetTranslateResult(this BhashiniComputeResponse pipelineResponse)

Parameters

pipelineResponse BhashiniComputeResponse

The current BhashiniComputeResponse.

Returns

string

The translated text.

ToSpeechToTextTask(BhashiniPipelineTaskConfiguration, string, BhashiniAudioFormat, int)

public static BhashiniComputeTask ToSpeechToTextTask(this BhashiniPipelineTaskConfiguration pipelineData, string sourceLanguage = null, BhashiniAudioFormat audioFormat = BhashiniAudioFormat.Wav, int sampleRate = 44100)

Parameters

pipelineData BhashiniPipelineTaskConfiguration

The current BhashiniPipelineTaskConfiguration.

sourceLanguage string

The language of the speech. If null, takes it from the BhashiniPipelineTaskConfiguration.

audioFormat BhashiniAudioFormat

The format the audio should be sent in, defaults to Wav.

sampleRate int

The sample rate of the audio, defaults to 44100.

Returns

BhashiniComputeTask

A configured BhashiniComputeTask object.

ToTextToSpeechTask(BhashiniPipelineTaskConfiguration, BhashiniVoiceType, string)

public static BhashiniComputeTask ToTextToSpeechTask(this BhashiniPipelineTaskConfiguration pipelineData, BhashiniVoiceType voiceType = BhashiniVoiceType.Default, string sourceLanguage = null)

Parameters

pipelineData BhashiniPipelineTaskConfiguration

The current BhashiniPipelineTaskConfiguration.

voiceType BhashiniVoiceType

The voice type. If not given, takes the first available one from the BhashiniPipelineTaskConfiguration.

sourceLanguage string

The language of the text. If null, takes it from the BhashiniPipelineTaskConfiguration.

Returns

BhashiniComputeTask

A configured BhashiniComputeTask object.

ToTranslateTask(BhashiniPipelineTaskConfiguration, string, string)

Converts the current BhashiniPipelineTaskConfiguration to a translation BhashiniComputeTask.

public static BhashiniComputeTask ToTranslateTask(this BhashiniPipelineTaskConfiguration pipelineData, string sourceLanguage = null, string targetLanguage = null)

Parameters

pipelineData BhashiniPipelineTaskConfiguration

The current BhashiniPipelineTaskConfiguration.

sourceLanguage string

The language of the input text. If null, takes it from the BhashiniPipelineTaskConfiguration.

targetLanguage string

The language of the output text. If null, takes it from the BhashiniPipelineTaskConfiguration.

Returns

BhashiniComputeTask

A configured BhashiniComputeTask object.