C# 클래스 Speech_App1, API-Platform

Speech_App1 class
상속: System.Web.UI.Page
파일 보기 프로젝트 열기: attdevsupport/API-Platform

보호된 메소드들

메소드 설명
BtnSubmit_Click ( object sender, EventArgs e ) : void

Method that calls SpeechToText api when user clicked on submit button

Page_Load ( object sender, EventArgs e ) : void

This function is called when the application page is loaded into the web browser. This function reads the web.config file and gets the values of the attributes

비공개 메소드들

메소드 설명
BypassCertificateError ( ) : void

Neglect the ssl handshake error with authentication server

ConvertToSpeech ( ) : void

This function invokes api SpeechToText to convert the given wav amr file and displays the result.

DisplayResult ( SpeechResponse, speechResponse ) : void

Displays the result onto the page

DrawPanelForFailure ( Panel panelParam, string message ) : void

Displays error message

DrawPanelForSuccess ( Panel panelParam, string message ) : void

Display success message

GetAccessToken ( AccessType type ) : bool

Get the access token based on Access Type

IsTokenValid ( ) : string

This function validates the expiry of the access token and refresh token. function compares the current time with the refresh token taken time, if current time is greater then returns INVALID_REFRESH_TOKEN function compares the difference of last access token taken time and the current time with the expiry seconds, if its more, returns INVALID_ACCESS_TOKEN otherwise returns VALID_ACCESS_TOKEN

IsValidFile ( string file ) : bool

Verifies whether the given file satisfies the criteria for speech api

MapContentTypeFromExtension ( string extension ) : string

Content type based on the file extension.

ReadAccessTokenFile ( ) : bool

This function reads the Access Token File and stores the values of access token, expiry seconds refresh token, last access token time and refresh token expiry time

ReadAndGetAccessToken ( ) : bool

Read access token file and validate the access token

ReadConfigFile ( ) : bool

Read parameters from configuraton file

메소드 상세

BtnSubmit_Click() 보호된 메소드

Method that calls SpeechToText api when user clicked on submit button
protected BtnSubmit_Click ( object sender, EventArgs e ) : void
sender object sender that invoked this event
e EventArgs eventargs of the button
리턴 void

Page_Load() 보호된 메소드

This function is called when the application page is loaded into the web browser. This function reads the web.config file and gets the values of the attributes
protected Page_Load ( object sender, EventArgs e ) : void
sender object Button that caused this event
e EventArgs Event that invoked this function
리턴 void