Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions,
see Getting Started with Amazon Web Services in China
(PDF).
Use ListSpeechSynthesisTasks with an Amazon SDK or CLI
The following code examples show how to use ListSpeechSynthesisTasks.
- CLI
-
- Amazon CLI
-
To list your speech synthesis tasks
The following list-speech-synthesis-tasks example lists your speech synthesis tasks.
aws polly list-speech-synthesis-tasks
Output:
{
"SynthesisTasks": [
{
"TaskId": "70b61c0f-57ce-4715-a247-cae8729dcce9",
"TaskStatus": "completed",
"OutputUri": "https://s3.us-west-2.amazonaws.com/amzn-s3-demo-bucket/70b61c0f-57ce-4715-a247-cae8729dcce9.mp3",
"CreationTime": 1603911042.689,
"RequestCharacters": 1311,
"OutputFormat": "mp3",
"TextType": "text",
"VoiceId": "Joanna"
}
]
}
For more information, see Creating long audio files in the Amazon Polly Developer Guide.
- SAP ABAP
-
- SDK for SAP ABAP
-
TRY.
" Only pass optional parameters if they have values
IF iv_max_results IS NOT INITIAL AND iv_status IS NOT INITIAL.
oo_result = lo_ply->listspeechsynthesistasks(
iv_maxresults = iv_max_results
iv_status = iv_status ).
ELSEIF iv_max_results IS NOT INITIAL.
oo_result = lo_ply->listspeechsynthesistasks(
iv_maxresults = iv_max_results ).
ELSEIF iv_status IS NOT INITIAL.
oo_result = lo_ply->listspeechsynthesistasks(
iv_status = iv_status ).
ELSE.
oo_result = lo_ply->listspeechsynthesistasks( ).
ENDIF.
DATA(lt_tasks) = oo_result->get_synthesistasks( ).
DATA(lv_count) = lines( lt_tasks ).
MESSAGE |Found { lv_count } synthesis tasks| TYPE 'I'.
CATCH /aws1/cx_plyinvalidnexttokenex.
MESSAGE 'Invalid NextToken.' TYPE 'E'.
CATCH /aws1/cx_plyservicefailureex.
MESSAGE 'Service failure occurred.' TYPE 'E'.
ENDTRY.
For a complete list of Amazon SDK developer guides and code examples, see
Using Amazon Polly with an Amazon SDK.
This topic also includes information about getting started and details about previous SDK versions.