{"id":551,"date":"2023-03-30T17:48:06","date_gmt":"2023-03-30T09:48:06","guid":{"rendered":"https:\/\/doc.orionstar.com\/en\/?post_type=lsvr_kba&#038;p=551"},"modified":"2026-11-03T11:00:18","modified_gmt":"2026-11-03T03:00:18","slug":"speech-ability","status":"publish","type":"lsvr_kba","link":"https:\/\/doc.orionstar.com\/en\/knowledge-base\/speech-ability\/","title":{"rendered":"Speech"},"content":{"rendered":"\n<p class=\"has-medium-font-size\"><strong>Introduction<\/strong><\/p>\n\n\n\n<p>Speech covers two abilities: listening and speaking.<\/p>\n\n\n\n<p>Listening: ASR results are returned through SkillCallback, and NLP results are returned through ModuleCallBack.<\/p>\n\n\n\n<p>Speaking: you can choose from a variety of voices in the settings.<\/p>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Create a Speech Service Callback<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">SkillCallback mSkillCallback = new SkillCallback() {\n    @Override\n    public void onSpeechParResult(String s) throws RemoteException {\n        \/\/interim speech recognition result\n    }\n    @Override\n    public void onStart() throws RemoteException {\n        \/\/recognition started\n    }\n    @Override public void onStop() throws RemoteException {\n        \/\/recognition ended\n    }\n    @Override public void onVolumeChange(int volume) throws RemoteException {\n        \/\/volume of the recognized voice changed\n    }\n    \/**\n      @param status 0 : normal return\n      1 : other return\n      2 : noise or single_other return\n      3 : timeout\n      4 : forcibly canceled\n      5 : ASR result ended early without going through NLU\n      6 : other return when the semantics are the same in full-duplex mode\n      *\/\n    @Override\n    public void onQueryEnded(int status) throws RemoteException {\n        \/\/status\n    }\n    @Override\n    public void onQueryAsrResult(String asrResult) throws RemoteException {\n        \/\/asrResult: final recognition result\n    }\n}<\/pre>\n\n\n\n<p>Supported platforms:<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-regular\"><table><tbody><tr><td>GreetingBot<\/td><td>GreetingBot Mini<\/td><td>LuckiBot<\/td><td>DeliverBot Max<\/td><td>BigScreenBot<\/td><\/tr><tr><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Connect to the Speech Service<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">final SkillApi skillApi = new SkillApi();\nskillApi.connectApi(context, new ApiListener() {\n    @Override\n    public void handleApiDisabled() {\n    }\n    @Override\n    public void handleApiConnected() {\n        \/\/speech service connected; register the speech callback\n        skillApi.registerCallBack(mSkillCallback);\n    }\n    @Override\n    public void handleApiDisconnected() {\n        \/\/speech service disconnected\n    }\n});<\/pre>\n\n\n\n<p>Supported platforms:<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-regular\"><table><tbody><tr><td>GreetingBot<\/td><td>GreetingBot Mini<\/td><td>LuckiBot<\/td><td>DeliverBot Max<\/td><td>BigScreenBot<\/td><\/tr><tr><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"has-medium-font-size\"><strong>TTS Playback<\/strong><\/p>\n\n\n\n<p>Method name: playText<\/p>\n\n\n\n<p>How to call<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">skillApi.playText(text, new TextListener() {\n    @Override\n    public void onStart() {\n        \/\/playback started\n    }\n    @Override\n    public void onStop() {\n        \/\/playback stopped\n    }\n    @Override\n    public void onError() {\n        \/\/playback error\n    }\n    @Override\n    public void onComplete() {\n        \/\/playback completed\n    }\n});<\/pre>\n\n\n\n<p>Parameters<\/p>\n\n\n\n<div class=\"is-layout-flex wp-container-2 wp-block-columns has-small-font-size\">\n<div class=\"is-layout-flow wp-block-column\" style=\"flex-basis:100%\">\n<blockquote class=\"wp-block-quote has-small-font-size\">\n<ul>\n<li><strong>text<\/strong>: the text to play with TTS &nbsp;&nbsp;<strong><mark class=\"has-inline-color has-vivid-red-color\">Note<\/mark><\/strong>: JSON content cannot be played. Avoid long strings that we cannot support in TTS text, such as hyperlinks or garbled character sequences, as they may cause the call to fail. We recommend keeping a single TTS playback within 300 characters, with a maximum of 1000. If the text is too long, play it with TTS in segments.<\/li>\n<\/ul>\n<\/blockquote>\n<\/div>\n<\/div>\n\n\n\n<p>Supported platforms:<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-regular\"><table><tbody><tr><td>GreetingBot<\/td><td>GreetingBot Mini<\/td><td>LuckiBot<\/td><td>DeliverBot Max<\/td><td>BigScreenBot<\/td><\/tr><tr><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Streaming TTS Playback<\/strong> (Requires ROM 10.3 or Later)<\/p>\n\n\n\n<p>Method name: playText<\/p>\n\n\n\n<p>How to call<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>skillApi.playText(new TTSEntity(textSid, streamSid, text), new TextListener() {\n    @Override\n    public void onStart() {\n    \/\/called when a text item starts, not when the passage starts\n    }\n\n    @Override\n    public void onStop() {\n    \/\/text playback stopped\n    }\n\n    @Override\n    public void onError() {\n    \/\/playback error\n    }\n\n    @Override\n    public void onStreamComplete(String streamSid, String textSid) {\n    \/\/text playback completed\n    }\n});<\/code><\/pre>\n\n\n\n<p>Parameters<\/p>\n\n\n\n<div class=\"is-layout-flex wp-container-4 wp-block-columns has-small-font-size\">\n<div class=\"is-layout-flow wp-block-column\" style=\"flex-basis:100%\">\n<blockquote class=\"wp-block-quote has-small-font-size\">\n<ul>\n<li><strong>textSid<\/strong>: text ID. Different text items must have different IDs. Format: UUID. Can be empty, in which case an ID is assigned automatically.<\/li>\n\n\n\n<li><strong>streamSid<\/strong>: passage ID. All text in the same passage must use the same ID. Format: UUID. Can be empty, in which case each call is treated as a separate passage and each playText call interrupts the previous one.<\/li>\n\n\n\n<li><strong>text<\/strong>: the text to play with TTS &nbsp;&nbsp;<strong><mark class=\"has-inline-color has-vivid-red-color\">Note<\/mark><\/strong>: JSON content cannot be played. Avoid long strings that we cannot support in TTS text, such as hyperlinks or garbled character sequences, as they may cause the call to fail. We recommend keeping a single TTS playback within 300 characters, with a maximum of 1000. If the text is too long, play it with TTS in segments.<\/li>\n<\/ul>\n<\/blockquote>\n<\/div>\n<\/div>\n\n\n\n<p>Usage: Suppose you have a passage of 10 sentences that arrive one by one. When the passage starts, generate a unique <strong>streamSid<\/strong>, use a different <strong>textSid<\/strong> for each sentence, and call the <strong>playText<\/strong> API 10 times. Because the 10 sentences share the same <strong>streamSid<\/strong>, the calls do not interrupt each other, so you can call the <strong>playText<\/strong> API while the previous sentence is still playing. When each sentence finishes playing, you receive a completion event in the <strong>onStreamComplete<\/strong> callback, which tells you which sentence finished so that you can highlight it. <strong>Note<\/strong>: Different passages must use different <strong>streamSid<\/strong> values and can interrupt each other. Two <strong>playText<\/strong> calls with an empty <strong>streamSid<\/strong> are also treated as two different passages and will interrupt each other.<\/p>\n\n\n\n<p>Supported platforms:<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-regular\"><table><tbody><tr><td>GreetingBot<\/td><td>GreetingBot Mini<\/td><td>LuckiBot<\/td><td>DeliverBot Max<\/td><td>BigScreenBot<\/td><\/tr><tr><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Stop TTS Playback<\/strong><\/p>\n\n\n\n<p>Method name: stopTTS<\/p>\n\n\n\n<p>How to call:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">skillApi.stopTTS();<\/pre>\n\n\n\n<p>Supported platforms:<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-regular\"><table><tbody><tr><td>GreetingBot<\/td><td>GreetingBot Mini<\/td><td>LuckiBot<\/td><td>DeliverBot Max<\/td><td>BigScreenBot<\/td><\/tr><tr><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Set the Listening Mode<\/strong><\/p>\n\n\n\n<p>          The robot has two listening modes: single listening and long listening (continuous listening). In single listening mode, the user must wake up the robot before each utterance. In continuous listening mode, the robot keeps listening in the background and returns a callback each time the user finishes a sentence. In API development, use this method to switch between long listening and single listening.<\/p>\n\n\n\n<p class=\"has-vivid-red-color has-text-color\">Note: This API only takes effect when both the &#8220;Speech Recognition&#8221; and &#8220;Continuous Listening&#8221; switches are turned on in the robot settings.<\/p>\n\n\n\n<p>Method name: setRecognizeMode<\/p>\n\n\n\n<p>How to call:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">skillApi.setRecognizeMode(isContinue);<\/pre>\n\n\n\n<p>Parameters<\/p>\n\n\n\n<div class=\"is-layout-flex wp-container-6 wp-block-columns has-small-font-size\">\n<div class=\"is-layout-flow wp-block-column\" style=\"flex-basis:100%\">\n<blockquote class=\"wp-block-quote has-small-font-size\">\n<ul>\n<li><strong>isContinue<\/strong>: boolean. true: continuous recognition; false: single recognition<\/li>\n<\/ul>\n<\/blockquote>\n<\/div>\n<\/div>\n\n\n\n<p>Supported platforms:<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-regular\"><table><tbody><tr><td>GreetingBot<\/td><td>GreetingBot Mini<\/td><td>LuckiBot<\/td><td>DeliverBot Max<\/td><td>BigScreenBot<\/td><\/tr><tr><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Set the Listening Mode &#8212;&#8212; Large Model<\/strong> (Effective on ROM 10.1 and Later)<\/p>\n\n\n\n<p>          Works the same way as setRecognizeMode. After a large language model has been integrated, call this API if you want to turn off long listening without turning off the return of streaming data.<\/p>\n\n\n\n<p class=\"has-vivid-red-color has-text-color\">Note: This API only takes effect when the &#8220;Speech Recognition&#8221; switch is turned on in the robot settings.<\/p>\n\n\n\n<p>Method name: setRecognizeModeNew<\/p>\n\n\n\n<p>How to call:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">skillApi.setRecognizeModeNew(isContinue, isCloseStreamData);<\/pre>\n\n\n\n<p>Parameters<\/p>\n\n\n\n<div class=\"is-layout-flex wp-container-8 wp-block-columns has-small-font-size\">\n<div class=\"is-layout-flow wp-block-column\" style=\"flex-basis:100%\">\n<blockquote class=\"wp-block-quote has-small-font-size\">\n<ul>\n<li><strong>isContinue<\/strong>: boolean. true: continuous recognition; false: single recognition<\/li>\n\n\n\n<li><strong>isCloseStreamData<\/strong>: boolean. Only when the <strong>isContinue<\/strong> parameter is <strong>false<\/strong> <strong>does the <strong>isCloseStreamData<\/strong> parameter take effect<\/strong>. true: switch to single listening and turn off streaming data; false: switch to single listening without turning off streaming data<\/li>\n<\/ul>\n<\/blockquote>\n<\/div>\n<\/div>\n\n\n\n<p>Supported platforms:<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-regular\"><table><tbody><tr><td>GreetingBot<\/td><td>GreetingBot Mini<\/td><td>LuckiBot<\/td><td>DeliverBot Max<\/td><td>BigScreenBot<\/td><\/tr><tr><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Turn Speech Recognition Off or On<\/strong><\/p>\n\n\n\n<p class=\"has-vivid-red-color has-text-color\">Note: This API only takes effect when both the &#8220;Speech Recognition&#8221; and &#8220;Continuous Listening&#8221; switches are turned on in the robot settings.<\/p>\n\n\n\n<p>Remark: This switch turns speech recognition off or on. When it is off, speech features are completely disabled, and voice wake-up and the like no longer work. If you only need single listening, just set the listening mode (setRecognizeMode) to false; the robot then does not listen unless the user wakes it up.<\/p>\n\n\n\n<p>Method name: setRecognizable<\/p>\n\n\n\n<p>How to call:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">skillApi.setRecognizable(enable);<\/pre>\n\n\n\n<p>Parameters<\/p>\n\n\n\n<div class=\"is-layout-flex wp-container-10 wp-block-columns\">\n<div class=\"is-layout-flow wp-block-column\" style=\"flex-basis:100%\">\n<blockquote class=\"wp-block-quote has-small-font-size\">\n<ul>\n<li><strong>enable<\/strong>: boolean. true: on; false: off<\/li>\n<\/ul>\n<\/blockquote>\n<\/div>\n<\/div>\n\n\n\n<p>Supported platforms:<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-regular\"><table><tbody><tr><td>GreetingBot<\/td><td>GreetingBot Mini<\/td><td>LuckiBot<\/td><td>DeliverBot Max<\/td><td>BigScreenBot<\/td><\/tr><tr><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Set the Speech Recognition Area<\/strong><\/p>\n\n\n\n<p>Method name: setAngleCenterRange<\/p>\n\n\n\n<p>How to call:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">skillApi.setAngleCenterRange(angleCenter, angleRange);<\/pre>\n\n\n\n<p>Parameters<\/p>\n\n\n\n<div class=\"is-layout-flex wp-container-12 wp-block-columns has-small-font-size\">\n<div class=\"is-layout-flow wp-block-column\" style=\"flex-basis:100%\">\n<blockquote class=\"wp-block-quote has-small-font-size\">\n<ul>\n<li><strong>angleCenter<\/strong>: center angle, the center of the robot&#8217;s sound pickup. float, [0,360)<\/li>\n\n\n\n<li><strong>angleRange<\/strong>: range angle, the range of the robot&#8217;s sound pickup. float, [0,120]    <mark class=\"has-inline-color has-vivid-red-color\">Note that this parameter is deprecated. Check the supported models below; on other models the <strong>angleRange<\/strong> setting has no effect.<\/mark><\/li>\n<\/ul>\n<\/blockquote>\n<\/div>\n<\/div>\n\n\n\n<p>When setting the pickup center <strong>angleCenter<\/strong>, any angle value is allowed, but multiples of 60 degrees give performance more consistent with the straight-ahead direction. For example, 0, 60 or 120 degrees work better.<\/p>\n\n\n\n<p><strong>On models with a fixed pickup area<\/strong>, the pickup area is a sector extending 30 degrees to the left and right of the <strong>angleCenter<\/strong> angle. The pickup area has boundaries, but they are not stable (they are affected by the distribution of ambient noise). For example, if you set <strong>angleCenter<\/strong> to 0, the theoretical pickup range is from 30 degrees to 330 degrees as shown below, and the boundaries may extend beyond this range depending on the environment.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/orionstar-doc.obs.ap-southeast-1.myhuaweicloud.com\/wp-content\/uploads\/2025\/02\/20250214-110247.jpeg\" alt=\"\" class=\"wp-image-51188\" \/><\/figure><\/div>\n\n\n<p><strong>Currently only the first-generation algorithm supports setting the range angle with this API; the second-generation algorithm does not.<\/strong><\/p>\n\n\n\n<p>Supported platforms:<\/p>\n\n\n\n<div class=\"is-layout-constrained wp-block-group\"><div class=\"wp-block-group__inner-container\">\n<figure class=\"wp-block-table is-style-regular\"><table><tbody><tr><td>GreetingBot 1.0<\/td><td>GreetingBot 1.1<\/td><td>BigScreenBot Retail Edition<\/td><td>Baohuaping<\/td><td>Other platforms<\/td><\/tr><tr><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><td>No<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div><\/div>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Get NLP Results from Text<\/strong><\/p>\n\n\n\n<p>Method name: queryByText<\/p>\n\n\n\n<p>How to call:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">skillApi.queryByText(text);<\/pre>\n\n\n\n<p>Parameters<\/p>\n\n\n\n<div class=\"is-layout-flex wp-container-15 wp-block-columns has-small-font-size\">\n<div class=\"is-layout-flow wp-block-column\" style=\"flex-basis:100%\">\n<blockquote class=\"wp-block-quote has-small-font-size\">\n<ul>\n<li><strong>text<\/strong>: the text to query, String<\/li>\n<\/ul>\n<\/blockquote>\n<\/div>\n<\/div>\n\n\n\n<p>Supported platforms:<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-regular\"><table><tbody><tr><td>GreetingBot<\/td><td>GreetingBot Mini<\/td><td>LuckiBot<\/td><td>DeliverBot Max<\/td><td>BigScreenBot<\/td><\/tr><tr><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>Note: This API has no return value. The query result is returned through ModuleCallback&#8217;s onSendRequest as a voice command.<\/strong><\/p>\n\n\n\n<p class=\"has-medium-font-size\" id=\"audio-data-capture\"><strong><a href=\"#audio-data-capture\" target=\"_blank\" rel=\"noreferrer noopener\">Audio Data Capture<\/a><\/strong><\/p>\n\n\n\n<p>This method can be used to capture raw audio. It is implemented with Android&#8217;s built-in Recorder. However, because of the special nature of the robot&#8217;s microphone array, data can only be obtained from the Recorder with the correct parameters.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/audio sample rate (fixed at 16000)\nprivate final int AUDIO_RATE = 16000;\n\/\/Buffer length\n\/\/(change the length as needed; the larger the buffer, the longer each frame, and very short recordings may not be saved)\nprivate final int AUDIO_BUF_LEN = 5 * 2 * 16000;\n\/\/channel (stereo)\nint channelConfig = AudioFormat.CHANNEL_IN_STEREO;\nint minRecBufSize = AudioRecord.getMinBufferSize(AUDIO_RATE, channelConfig, AudioFormat.ENCODING_PCM_16BIT);\nint recBufSize = minRecBufSize * 2;\nAudioRecord audioRecorder =new AudioRecord(AudioSource.MIC, AUDIO_RATE, AudioFormat.CHANNEL_IN_STEREO, AudioFormat.ENCODING_PCM_16BIT, recBufSize);\n\n...\n...\n\n\n\/\/buffersize\n\/\/(change the length as needed; the larger the buffer, the longer each frame, and very short recordings may not be saved)\nmBufferSize = AUDIO_BUF_LEN\n\n\/\/data capture\nbyte[] tempBufRec = new byte[mBufferSize];\nbyte[] bfOutLeft = new byte[channelConfig == AudioFormat.CHANNEL_IN_STEREO ? mBufferSize \/ 2 : mBufferSize];\nbyte[] bfOutRight = new byte[channelConfig == AudioFormat.CHANNEL_IN_STEREO ? mBufferSize \/ 2 : mBufferSize];\n\nint readBytes = mAudioRecorder.read(tempBufRec, 0, mBufferSize);\nif (readBytes == mBufferSize) {\n    deinterleaveData(tempBufRec, bfOutLeft, bfOutRight, minRecBufSize);\n    \/\/separated data; bfOutLeft is the data you need\n    saveData(bfOutLeft)\n}\n\n\n\n...\n...\n...\n\n\/\/separate left and right channel data\nprivate void deinterleaveData(byte[] src, byte[] leftdest, byte[] rightdest, int len)\n{\n    int rIndex = 0;\n    int lIndex = 0;\n    for (int i = 0; i &lt; len; )\n    {\n        leftdest[rIndex] = src[i];\n        leftdest[rIndex + 1] = src[i + 1];\n        rIndex = rIndex + 2;\n        rightdest[lIndex] = src[i + 2];\n        rightdest[lIndex + 1] = src[i + 3];\n        lIndex = lIndex + 2;\n        i = i + 4;\n    }\n}<\/pre>\n\n\n\n<p>Supported platforms:<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-regular\"><table><tbody><tr><td>GreetingBot<\/td><td>GreetingBot Mini<\/td><td>LuckiBot<\/td><td>DeliverBot Max<\/td><td>BigScreenBot<\/td><\/tr><tr><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>The audio configuration parameters of this method can be used to integrate other audio\/video SDKs. Agora and Tencent TRTC, which have been integrated this way, both capture audio normally.<\/p>\n\n\n\n<p>The audio capture demo code can be found here: <a href=\"https:\/\/orion-base-test-1256573505.cos.ap-beijing.myqcloud.com\/cn_docs_file\/2021-12-20_17%3A27%3A28_OrionAudioRecord.zip\">Click here<\/a><\/p>\n\n\n\n<p><strong>Note 1: All parameters (except BufferSize) are fixed and must not be changed; otherwise no data may be captured.<\/strong><\/p>\n\n\n\n<p><strong>Note 2: Because of the special nature of VOIP call protocols, the robot does not currently support VOIP call protocols.<\/strong><\/p>\n\n\n\n<div class=\"is-layout-flex wp-container-17 wp-block-columns\">\n<div class=\"is-layout-flow wp-block-column\">\n<blockquote class=\"wp-block-quote\">\n<p class=\"has-small-font-size\"><em>VOIP call protocols require the microphone to act as a <\/em><strong>communication device<\/strong><em>, not a <\/em><strong>media device<\/strong><em>. However, the robot&#8217;s 6-microphone array can only be used as a media microphone, not as a communication device. Therefore the robot does not support any recording based on communication devices, including VOIP.<\/em><\/p>\n<\/blockquote>\n<\/div>\n<\/div>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Text to MP3<\/strong><\/p>\n\n\n\n<p>Method name: textToMp3<\/p>\n\n\n\n<p>How to call:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">boolean status = RobotApi.getInstance().textToMp3(reqId, text, path, name,\n    new CommandListener(){\n        @Override\n        public void onResult(int result, String message) {\n\n            if (Definition.RESULT_OK == result) {\n                try {\n                    JSONObject jsonObject = new JSONObject(message);\n                    int code = jsonObject.optInt(\"code\");\n                    String errMessage = jsonObject.optString(\"message\");\n                    if (code == 0) {\n                        mediaPlayer = new MediaPlayer();\n                        mediaPlayer.setDataSource(path + File.separator + name);\n                        mediaPlayer.prepare();\n                        mediaPlayer.start();\n                    } else{\n\n                    }\n                } catch (JSONException | IOException e) {\n                    e.printStackTrace();\n                }\n            }else {\n\n            }\n\n        }\n\n  });<\/pre>\n\n\n\n<p>Parameters<\/p>\n\n\n\n<div class=\"is-layout-flex wp-container-19 wp-block-columns has-small-font-size\">\n<div class=\"is-layout-flow wp-block-column\" style=\"flex-basis:100%\">\n<blockquote class=\"wp-block-quote has-small-font-size\">\n<ul>\n<li><strong>reqId<\/strong>: int command id; pass 0<\/li>\n\n\n\n<li><strong>text<\/strong>&nbsp;String, the text to convert<\/li>\n\n\n\n<li><strong>path<\/strong>&nbsp;String, the file path<\/li>\n\n\n\n<li><strong>name<\/strong>&nbsp;String, the file name<\/li>\n\n\n\n<li><strong>listener<\/strong>&nbsp;CommandListener message callback {&#8220;code&#8221;:0, &#8220;message&#8221;:&#8221;err msg&#8221;}<\/li>\n<\/ul>\n<\/blockquote>\n<\/div>\n<\/div>\n\n\n\n<p>Return value<\/p>\n\n\n\n<div class=\"is-layout-flex wp-container-21 wp-block-columns\">\n<div class=\"is-layout-flow wp-block-column\" style=\"flex-basis:100%\">\n<blockquote class=\"wp-block-quote has-small-font-size\">\n<ul>\n<li>int result 0: command executed \/ -1: not executed<\/li>\n<\/ul>\n<\/blockquote>\n<\/div>\n<\/div>\n\n\n\n<p>Supported platforms:<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-regular\"><table><tbody><tr><td>GreetingBot<\/td><td>GreetingBot Mini<\/td><td>LuckiBot<\/td><td>DeliverBot Max<\/td><td>BigScreenBot<\/td><\/tr><tr><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><td>Yes<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"has-vivid-red-color has-text-color\">Note:<\/p>\n\n\n\n<ol class=\"has-vivid-red-color has-text-color\">\n<li>This is a test API. Do not use it in production business logic. The TTS output is not affected by any TTS settings such as voice or speech rate; only the default audio is produced.<\/li>\n\n\n\n<li>To call this API, the app must request sdcard access permission; otherwise an error is reported.<\/li>\n\n\n\n<li>On successful conversion, an MP3 file is created (or overwritten) at the specified path&nbsp;<\/li>\n\n\n\n<li>You are responsible for managing this file.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Speech covers two abilities: listening and speaking. Listening: ASR results are returned through SkillCallback, and NLP results are returned through ModuleCallBack. Speaking: you can choose from a variety of voices in the settings. Create a Speech Service Callback Supported platforms: GreetingBot GreetingBot Mini LuckiBot DeliverBot Max BigScreenBot Yes Yes Yes Yes Yes Connect to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":[],"lsvr_kba_cat":[6],"lsvr_kba_tag":[],"_links":{"self":[{"href":"https:\/\/doc.orionstar.com\/en\/wp-json\/wp\/v2\/lsvr_kba\/551"}],"collection":[{"href":"https:\/\/doc.orionstar.com\/en\/wp-json\/wp\/v2\/lsvr_kba"}],"about":[{"href":"https:\/\/doc.orionstar.com\/en\/wp-json\/wp\/v2\/types\/lsvr_kba"}],"author":[{"embeddable":true,"href":"https:\/\/doc.orionstar.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/doc.orionstar.com\/en\/wp-json\/wp\/v2\/comments?post=551"}],"version-history":[{"count":7,"href":"https:\/\/doc.orionstar.com\/en\/wp-json\/wp\/v2\/lsvr_kba\/551\/revisions"}],"predecessor-version":[{"id":929,"href":"https:\/\/doc.orionstar.com\/en\/wp-json\/wp\/v2\/lsvr_kba\/551\/revisions\/929"}],"wp:attachment":[{"href":"https:\/\/doc.orionstar.com\/en\/wp-json\/wp\/v2\/media?parent=551"}],"wp:term":[{"taxonomy":"lsvr_kba_cat","embeddable":true,"href":"https:\/\/doc.orionstar.com\/en\/wp-json\/wp\/v2\/lsvr_kba_cat?post=551"},{"taxonomy":"lsvr_kba_tag","embeddable":true,"href":"https:\/\/doc.orionstar.com\/en\/wp-json\/wp\/v2\/lsvr_kba_tag?post=551"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}