From 07c779b1c2f71f84a033b108d5e1c1442c40de9f Mon Sep 17 00:00:00 2001 From: "carlos.meng" <7754760+meng_zhengwei@user.noreply.gitee.com> Date: Thu, 28 Nov 2024 10:01:35 +0800 Subject: [PATCH 1/6] =?UTF-8?q?docs=20(Audio):=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=A8=A1=E7=BB=84=E9=9F=B3=E9=A2=91=E9=80=9A=E9=81=93=E8=BE=93?= =?UTF-8?q?=E5=87=BA=E8=A1=A8=E6=A0=BC=EF=BC=8C=E4=BF=AE=E5=A4=8DRecord.st?= =?UTF-8?q?ar=E6=96=B9=E6=B3=95=E6=8F=8F=E8=BF=B0=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1、更新EC200N、EC600S、EC600K、EC800K、EC800G、EC600G系列模组支持的音频通道 2、修复Record.star方法描述错误的问题 固件版本: N/A 是否需要文案翻译: 否 --- docs/API_reference/en/medialib/audio.Audio.md | 27 ++++++++++-------- docs/API_reference/zh/medialib/audio.Audio.md | 28 ++++++++++--------- .../API_reference/zh/medialib/audio.Record.md | 20 ++++++------- docs/API_reference/zh/medialib/audio.TTS.md | 16 ++++++----- 4 files changed, 49 insertions(+), 42 deletions(-) diff --git a/docs/API_reference/en/medialib/audio.Audio.md b/docs/API_reference/en/medialib/audio.Audio.md index 5d0b7a64..19eb62ed 100644 --- a/docs/API_reference/en/medialib/audio.Audio.md +++ b/docs/API_reference/en/medialib/audio.Audio.md @@ -65,18 +65,21 @@ Creates an audio object. **Channels Supported by the Module:** -| Module | Earpiece | Headphone | Speaker | -| ------------------- | ----------- | ----------- | ----------- | -| EC600N series | Supported | Unsupported | Unsupported | -| EC800N series | Supported | Unsupported | Unsupported | -| EC600M-CN(LA/LE) | Supported | Unsupported | Unsupported | -| EC800M-CN(LA/LE/GA) | Supported | Unsupported | Unsupported | -| EG915N | Supported | Unsupported | Unsupported | -| EG912N | Supported | Unsupported | Unsupported | -| EG912U | Supported | Unsupported | Unsupported | -| EC200U series | Unsupported | Unsupported | Supported | -| EC600U series | Supported | Supported | Supported | -| EG915U | Supported | Supported | Unsupported | +| Module Series | Earpiece | Headphone | Speaker | +| -------------------- | ----------- | ----------- | ----------- | +| EC200N/EC600N/EC800N | Supported | Unsupported | Unsupported | +| EC600M-CN(LA/LE) | Supported | Unsupported | Unsupported | +| EC800M-CN(LA/LE/GA) | Supported | Unsupported | Unsupported | +| EG810M | Supported | Unsupported | Unsupported | +| EG915N/EG912N | Supported | Unsupported | Unsupported | +| EG912U | Supported | Unsupported | Unsupported | +| EC200U | Unsupported | Unsupported | Supported | +| EC600U | Supported | Supported | Supported | +| EG915U | Supported | Supported | Unsupported | +| EC600S | Supported | Unsupported | Unsupported | +| EC600K/EC800K | Supported | Unsupported | Unsupported | +| EC800G-CN(GA/TT/LA) | Supported | Supported | Supported | +| EC600G-CN(LA) | Supported | Supported | Supported | ## Methods diff --git a/docs/API_reference/zh/medialib/audio.Audio.md b/docs/API_reference/zh/medialib/audio.Audio.md index 7552b6e8..7035f3f2 100644 --- a/docs/API_reference/zh/medialib/audio.Audio.md +++ b/docs/API_reference/zh/medialib/audio.Audio.md @@ -20,19 +20,21 @@ class audio.Audio(device) **模块输出通道对应表:** -| 模块型号 | 听筒 | 耳机 | 喇叭 | -| -------------------- | ------ | ------ | ------ | -| EC600N系列 | 支持 | 不支持 | 不支持 | -| EC800N系列 | 支持 | 不支持 | 不支持 | -| EC600MCN(LA、LE) | 支持 | 不支持 | 不支持 | -| EC800MCN(LA、LE、GA) | 支持 | 不支持 | 不支持 | -| EG810MCN_GA | 支持 | 不支持 | 不支持 | -| EG915N | 支持 | 不支持 | 不支持 | -| EG912N | 支持 | 不支持 | 不支持 | -| EG912U | 支持 | 不支持 | 不支持 | -| EC200U系列 | 不支持 | 不支持 | 支持 | -| EC600U系列 | 支持 | 支持 | 支持 | -| EG915U | 支持 | 支持 | 不支持 | +| 模块型号 | 听筒 | 耳机 | 喇叭 | +| --------------------- | ------ | ------ | ------ | +| EC200N/EC600N/EC800N | 支持 | 不支持 | 不支持 | +| EC600M-CN(LA、LE) | 支持 | 不支持 | 不支持 | +| EC800M-CN(LA、LE、GA) | 支持 | 不支持 | 不支持 | +| EG810M | 支持 | 不支持 | 不支持 | +| EG915N/EG912N | 支持 | 不支持 | 不支持 | +| EG912U | 支持 | 不支持 | 不支持 | +| EC200U | 不支持 | 不支持 | 支持 | +| EC600U | 支持 | 支持 | 支持 | +| EG915U | 支持 | 支持 | 不支持 | +| EC600S | 支持 | 不支持 | 不支持 | +| EC600K/EC800K | 支持 | 不支持 | 不支持 | +| EC800G-CN(GA、TT、LA) | 支持 | 支持 | 支持 | +| EC600G-CN(LA) | 支持 | 支持 | 支持 | ## 方法 diff --git a/docs/API_reference/zh/medialib/audio.Record.md b/docs/API_reference/zh/medialib/audio.Record.md index 67dcb6e5..70ded4c5 100644 --- a/docs/API_reference/zh/medialib/audio.Record.md +++ b/docs/API_reference/zh/medialib/audio.Record.md @@ -26,26 +26,26 @@ class audio.Record(device) | 模块型号 | 听筒 | 耳机 | 喇叭 | | --------------------- | ------ | ------ | ------ | -| EC600N系列 | 支持 | 不支持 | 不支持 | -| EC800N系列 | 支持 | 不支持 | 不支持 | +| EC200N/EC600N/EC800N | 支持 | 不支持 | 不支持 | | EC600M-CN(LA、LE) | 支持 | 不支持 | 不支持 | | EC800M-CN(LA、LE、GA) | 支持 | 不支持 | 不支持 | -| EG810MCN_GA | 支持 | 不支持 | 不支持 | -| EG915N | 支持 | 不支持 | 不支持 | -| EG912N | 支持 | 不支持 | 不支持 | +| EG810M | 支持 | 不支持 | 不支持 | +| EG915N/EG912N | 支持 | 不支持 | 不支持 | | EG912U | 支持 | 不支持 | 不支持 | -| EC200U系列 | 不支持 | 不支持 | 支持 | -| EC600U系列 | 支持 | 支持 | 支持 | +| EC200U | 不支持 | 不支持 | 支持 | +| EC600U | 支持 | 支持 | 支持 | | EG915U | 支持 | 支持 | 不支持 | - - +| EC600S | 支持 | 不支持 | 不支持 | +| EC600K/EC800K | 支持 | 不支持 | 不支持 | +| EC800G-CN(GA、TT、LA) | 支持 | 支持 | 支持 | +| EC600G-CN(LA) | 支持 | 支持 | 支持 | ## 方法 ### `Record.start` ```python -audio.start(file_name,seconds) +Record.start(file_name,seconds) ``` 该方法用于开始录音。 diff --git a/docs/API_reference/zh/medialib/audio.TTS.md b/docs/API_reference/zh/medialib/audio.TTS.md index 98ed2fb4..f16e5454 100644 --- a/docs/API_reference/zh/medialib/audio.TTS.md +++ b/docs/API_reference/zh/medialib/audio.TTS.md @@ -24,17 +24,19 @@ class audio.TTS(device) | 模块型号 | 听筒 | 耳机 | 喇叭 | | --------------------- | ------ | ------ | ------ | -| EC600N系列 | 支持 | 不支持 | 不支持 | -| EC800N系列 | 支持 | 不支持 | 不支持 | +| EC200N/EC600N/EC800N | 支持 | 不支持 | 不支持 | | EC600M-CN(LA、LE) | 支持 | 不支持 | 不支持 | | EC800M-CN(LA、LE、GA) | 支持 | 不支持 | 不支持 | -| EG810MCN_GA | 支持 | 不支持 | 不支持 | -| EG915N | 支持 | 不支持 | 不支持 | -| EG912N | 支持 | 不支持 | 不支持 | +| EG810M | 支持 | 不支持 | 不支持 | +| EG915N/EG912N | 支持 | 不支持 | 不支持 | | EG912U | 支持 | 不支持 | 不支持 | -| EC200U系列 | 不支持 | 不支持 | 支持 | -| EC600U-CN系列 | 支持 | 支持 | 支持 | +| EC200U | 不支持 | 不支持 | 支持 | +| EC600U | 支持 | 支持 | 支持 | | EG915U | 支持 | 支持 | 不支持 | +| EC600S | 支持 | 不支持 | 不支持 | +| EC600K/EC800K | 支持 | 不支持 | 不支持 | +| EC800G-CN(GA、TT、LA) | 支持 | 支持 | 支持 | +| EC600G-CN(LA) | 支持 | 支持 | 支持 | ## 方法 -- Gitee From cfc2fa82bbd4a59b150d44616a981e9632333e63 Mon Sep 17 00:00:00 2001 From: "carlos.meng" <7754760+meng_zhengwei@user.noreply.gitee.com> Date: Tue, 24 Dec 2024 18:23:52 +0800 Subject: [PATCH 2/6] =?UTF-8?q?docs=20(Audio):=20=E5=88=A0=E9=99=A4Record.?= =?UTF-8?q?getSize=E8=BF=94=E5=9B=9E=E6=96=87=E4=BB=B6=E5=A4=A7=E5=B0=8F?= =?UTF-8?q?=E4=B8=8E=E5=9B=9E=E8=B0=83=E4=B8=8D=E5=90=8C=E7=9A=84=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 为保持统一,所有平台录音文件数据统一返回文件头,回调返回数据与Record.getSize返回一致 固件版本: N/A 是否需要文案翻译: 否 --- docs/API_reference/zh/medialib/audio.Record.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/API_reference/zh/medialib/audio.Record.md b/docs/API_reference/zh/medialib/audio.Record.md index 70ded4c5..6d5c60c9 100644 --- a/docs/API_reference/zh/medialib/audio.Record.md +++ b/docs/API_reference/zh/medialib/audio.Record.md @@ -151,9 +151,7 @@ Record.getSize(file_name) **返回值描述:** -若获取成功,返回文件大小 (EC600N系列、EC800N系列、EC800M系列、EC600M系列、EG915N不返回文件头),单位字节。 - -> wav格式时,此值会比返回callback返回值大44 bytes(44 bytes为文件头);amr格式时,此值会比返回callback返回值大6 bytes(6 bytes为文件头)。 +若获取成功,返回文件大小 ,单位字节。 失败返回值如下: -- Gitee From 35ea024e4ab6ac3e053ef31b0243a247dafccff7 Mon Sep 17 00:00:00 2001 From: "carlos.meng" <7754760+meng_zhengwei@user.noreply.gitee.com> Date: Tue, 24 Dec 2024 18:30:40 +0800 Subject: [PATCH 3/6] =?UTF-8?q?docs=20(Audio):=20=E5=88=A0=E9=99=A4Record.?= =?UTF-8?q?getSize=E8=BF=94=E5=9B=9E=E6=96=87=E4=BB=B6=E5=A4=A7=E5=B0=8F?= =?UTF-8?q?=E4=B8=8E=E5=9B=9E=E8=B0=83=E4=B8=8D=E5=90=8C=E7=9A=84=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 为保持统一,所有平台录音文件数据统一返回文件头,回调返回数据与Record.getSize返回一致 固件版本: N/A 是否需要文案翻译: 否 --- docs/API_reference/en/medialib/audio.Record.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/API_reference/en/medialib/audio.Record.md b/docs/API_reference/en/medialib/audio.Record.md index 9c4d378f..756b7625 100644 --- a/docs/API_reference/en/medialib/audio.Record.md +++ b/docs/API_reference/en/medialib/audio.Record.md @@ -196,9 +196,7 @@ This method reads the size of the recording file. **Return Value:** -Returns the file size for successful execution. Unit: byte. (EC600N series, EC800N series, EC800M series, EC600M series, and EG915N modules do not return file headers). - -> For WAV format, this value is 44 bytes larger than the callback return value (44 bytes is the file header); for AMR format, this value is 6 bytes larger than the callback return value (6 bytes is the file header). +Returns the file size for successful execution. Unit: byte. The return values for failed execution are as follows: -- Gitee From 14d1adfb0f735b71d699d1902dd538658e15bf78 Mon Sep 17 00:00:00 2001 From: "carlos.meng" <7754760+meng_zhengwei@user.noreply.gitee.com> Date: Tue, 24 Dec 2024 18:35:03 +0800 Subject: [PATCH 4/6] =?UTF-8?q?docs=20(Audio):=20=E5=88=A0=E9=99=A4Record.?= =?UTF-8?q?getSize=E8=BF=94=E5=9B=9E=E6=96=87=E4=BB=B6=E5=A4=A7=E5=B0=8F?= =?UTF-8?q?=E4=B8=8E=E5=9B=9E=E8=B0=83=E4=B8=8D=E5=90=8C=E7=9A=84=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 为保持统一,所有平台录音文件数据统一返回文件头,回调返回数据与Record.getSize返回一致 固件版本: N/A 是否需要文案翻译: 否 --- docs/API_reference/zh/medialib/audio.Record.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/API_reference/zh/medialib/audio.Record.md b/docs/API_reference/zh/medialib/audio.Record.md index 6d5c60c9..c0fb3c2f 100644 --- a/docs/API_reference/zh/medialib/audio.Record.md +++ b/docs/API_reference/zh/medialib/audio.Record.md @@ -151,7 +151,7 @@ Record.getSize(file_name) **返回值描述:** -若获取成功,返回文件大小 ,单位字节。 +若获取成功,返回文件大小 ,单位字节。 失败返回值如下: -- Gitee From d850cc116fdb0bc9e912f956135e26f41966eb3f Mon Sep 17 00:00:00 2001 From: "carlos.meng" <7754760+meng_zhengwei@user.noreply.gitee.com> Date: Wed, 25 Dec 2024 15:01:52 +0800 Subject: [PATCH 5/6] =?UTF-8?q?docs=20(Audio):=20=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E5=BD=95=E9=9F=B3=E6=B5=81=E6=8E=A5=E5=8F=A3=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E7=9A=84=E6=A8=A1=E7=BB=84=E7=9A=84=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 目前所有支持Record的模组都已支持录音流功能 固件版本: N/A 是否需要文案翻译: 否 --- docs/API_reference/en/medialib/audio.Record.md | 4 ---- docs/API_reference/zh/medialib/audio.Record.md | 4 ---- 2 files changed, 8 deletions(-) diff --git a/docs/API_reference/en/medialib/audio.Record.md b/docs/API_reference/en/medialib/audio.Record.md index 756b7625..50ae7244 100644 --- a/docs/API_reference/en/medialib/audio.Record.md +++ b/docs/API_reference/en/medialib/audio.Record.md @@ -344,8 +344,6 @@ Record.stream_start(format, samplerate, time) This method starts recording audio streams. Note that when recording an audio stream, read the audio stream timely. Currently, a loop buffer is used. Failure to read the audio stream in time will result in data loss. -> Currently, only the EC200U/EC600U series modules support this function. - **Parameter:** - `format` - Integer type. Audio format. Currently supports AMR format. See constant. @@ -364,8 +362,6 @@ Record.stream_read(read_buf, len) This method reads the recording stream. -> Currently, only the EC600N/EC800N series modules support this feature. - **Parameter:** - `read_buf` - Bytearray type. Recording stream buffer. diff --git a/docs/API_reference/zh/medialib/audio.Record.md b/docs/API_reference/zh/medialib/audio.Record.md index c0fb3c2f..dec73c13 100644 --- a/docs/API_reference/zh/medialib/audio.Record.md +++ b/docs/API_reference/zh/medialib/audio.Record.md @@ -300,8 +300,6 @@ Record.stream_start(format, samplerate, time) 该方法用于开始录音音频流。注意:录制音频流的同时,应及时读取音频流。目前是采用循环buf,不及时读取,会导致数据丢失。 -> 目前仅EC200U/EC600U系列模组支持该功能。 - **参数描述:** - `format` - 音频格式,int型,目前支持 amr 格式,见常量。 @@ -320,8 +318,6 @@ Record.stream_read(read_buf, len) 该方法用于读取录音流。 -> 目前仅EC600N/EC800N系列模组支持该功能。 - **参数描述** - `read_buf` - 录音流buf,bytearray型 。 -- Gitee From b555e91f841a7c6ab6c3dacad5e5b7836170940d Mon Sep 17 00:00:00 2001 From: "carlos.meng" <7754760+meng_zhengwei@user.noreply.gitee.com> Date: Thu, 20 Feb 2025 17:58:42 +0800 Subject: [PATCH 6/6] =?UTF-8?q?docs=20(audio):=20=E5=BD=95=E9=9F=B3?= =?UTF-8?q?=E5=88=A0=E9=99=A4gain=E6=8E=A5=E5=8F=A3=EF=BC=8C=E6=96=B0?= =?UTF-8?q?=E5=A2=9Egain=5Fset=E5=92=8Cgain=5Fget=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 旧的gain接口不推荐客户使用,删除描述,新增gain_set和gain_get接口的描述 固件版本: N/A 是否需要文案翻译: 否 --- .../API_reference/en/medialib/audio.Record.md | 21 +++++++++++++-- .../API_reference/zh/medialib/audio.Record.md | 27 ++++++++++++++++--- 2 files changed, 43 insertions(+), 5 deletions(-) diff --git a/docs/API_reference/en/medialib/audio.Record.md b/docs/API_reference/en/medialib/audio.Record.md index 50ae7244..8c11f659 100644 --- a/docs/API_reference/en/medialib/audio.Record.md +++ b/docs/API_reference/en/medialib/audio.Record.md @@ -296,7 +296,7 @@ This method sets the callback function for the end of the recording. | 0 | Start playback | | 3 | Playback ends | -### Record.gain +### Record.gain_set ```python Record.gain(code_gain,dsp_gain) @@ -304,7 +304,7 @@ Record.gain(code_gain,dsp_gain) This method sets the recording gain. -> Currently, only the EC600N/EC800N series modules support this function. +> Currently, only the EC200N/EC600N/EC800N/EC600S/EG915N/EC600M/EC800M/EG810M/EG800P series modules support this function. **Parameter:** @@ -315,6 +315,23 @@ This method sets the recording gain. `0` - Successful execution; `-1`- Failed execution. +### Record.gain_get + +```python +Record.gain() +``` + +This method obtains the set recording gain. + +> Currently, only the EC200N/EC600N/EC800N/EC600S/EG915N/EC600M/EC800M/EG810M/EG800P series modules support this function. + +**Return Value:** + +The return value is a tuple, with the form of:`(code_gain, dsp_gain)` + +- `code_gain` - Integer type. Uplink codec gain. +- `dsp_gain` - Integer type. Uplink digital gain. + ### Record.amrEncDtx_enable ```python diff --git a/docs/API_reference/zh/medialib/audio.Record.md b/docs/API_reference/zh/medialib/audio.Record.md index dec73c13..3e9593f2 100644 --- a/docs/API_reference/zh/medialib/audio.Record.md +++ b/docs/API_reference/zh/medialib/audio.Record.md @@ -252,15 +252,15 @@ def cb(audio_msg): | 0 | 录音开始 | | 3 | 录音结束 | -### `Record.gain` +### `Record.gain_set` ```python -Record.gain(code_gain,dsp_gain) +Record.gain_set(code_gain,dsp_gain) ``` 该方法用于设置录音增益。 -> 目前仅EC600N/EC800N系列模组支持该功能。 +> 目前仅EC200N/EC600N/EC800N/EC600S/EG915N/EC600M/EC800M/EG810M/EG800P系列模组支持该功能。 **参数描述:** @@ -271,6 +271,27 @@ Record.gain(code_gain,dsp_gain) `0` 表示成功,`-1`表示失败。 +### `Record.gain_get` + +```python +Record.gain() +``` + +该方法获取设置的录音增益。 + +> 目前仅EC200N/EC600N/EC800N/EC600S/EG915N/EC600M/EC800M/EG810M/EG800P系列模组支持该功能。 + +**参数描述:** + +无参数 + +**返回值描述:** + +返回值是一个元组,返回值形式为:`(code_gain, dsp_gain)` + +- `code_gain` - 上行编解码器增益。 +- `dsp_gain` - 上行数字增益。 + ### `Record.amrEncDtx_enable` ```python -- Gitee