@sanghun jeon I am not sure if the code snippet is correctly indented or if it is an issue with this page formatting. Part of the snippet does not seem to be correctly indented.
Your call to both these methods are not required, a simple call to recognize_once_async() should actually return the required result. The call to get_token() is only printing the token but is not used elsewhere in the script.
You can refer the usage of the method in this sample, the sample also uses pronunciation assessment but that is not required. I think this snippet should help you recognize the result correctly.
speech_key='your_key'
service_region='your_region'
config = speechsdk.SpeechConfig(subscription=speech_key, region=service_region)
recognizer = speechsdk.SpeechRecognizer(speech_config=config)
result = recognizer.recognize_once_async().get()
if result.reason == speechsdk.ResultReason.RecognizedSpeech:
print("Recognized: {}".format(result.text))
elif result.reason == speechsdk.ResultReason.NoMatch:
print("No speech could be recognized: {}".format(result.no_match_details))
elif result.reason == speechsdk.ResultReason.Canceled:
cancellation_details = result.cancellation_details
print("Speech Recognition canceled: {}".format(cancellation_details.reason))
if cancellation_details.reason == speechsdk.CancellationReason.Error:
print("Error details: {}".format(cancellation_details.error_details))
If an answer is helpful, please click on or upvote which might help other community members reading this thread.