diff --git a/entry/src/main/java/com/ohos/speechutilsdemo/AttrValue.java b/entry/src/main/java/com/ohos/speechutilsdemo/AttrValue.java index 268fcd9423c998efbe032c53ea0809bbd3f63d2a..d2a20be697f1c51417fa27d3c44a31ff6f81d670 100644 --- a/entry/src/main/java/com/ohos/speechutilsdemo/AttrValue.java +++ b/entry/src/main/java/com/ohos/speechutilsdemo/AttrValue.java @@ -2,7 +2,7 @@ * Copyright (C) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * You may obtain an copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/entry/src/main/java/com/ohos/speechutilsdemo/ListProvider.java b/entry/src/main/java/com/ohos/speechutilsdemo/ListProvider.java index 2736e3c521b072f816f33a794652394efc6f1c21..ce62c4ed088aece8b158d6169af86edbaa9eba80 100644 --- a/entry/src/main/java/com/ohos/speechutilsdemo/ListProvider.java +++ b/entry/src/main/java/com/ohos/speechutilsdemo/ListProvider.java @@ -2,7 +2,7 @@ * Copyright (C) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * You may obtain an copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/entry/src/main/java/com/ohos/speechutilsdemo/MainAbility.java b/entry/src/main/java/com/ohos/speechutilsdemo/MainAbility.java index 7ded0388cb7240337525527f85ae4e6a8baada15..e1cfb03d062dbd6f3e511e9970bcb5146e917ed4 100644 --- a/entry/src/main/java/com/ohos/speechutilsdemo/MainAbility.java +++ b/entry/src/main/java/com/ohos/speechutilsdemo/MainAbility.java @@ -2,7 +2,7 @@ * Copyright (C) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * You may obtain an copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/entry/src/main/java/com/ohos/speechutilsdemo/MyApplication.java b/entry/src/main/java/com/ohos/speechutilsdemo/MyApplication.java index 0a980d71c9f2fa201c2729dbd3644a38ffee1a9c..fcd3de2e0bf26b9fc294bdf7d02b5eae955ce386 100644 --- a/entry/src/main/java/com/ohos/speechutilsdemo/MyApplication.java +++ b/entry/src/main/java/com/ohos/speechutilsdemo/MyApplication.java @@ -2,7 +2,7 @@ * Copyright (C) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * You may obtain an copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * @@ -12,10 +12,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.ohos.speechutilsdemo; import ohos.aafwk.ability.AbilityPackage; +/** + * MyApplication + * + * @since 2021-04-06 + */ public class MyApplication extends AbilityPackage { @Override public void onInitialize() { diff --git a/entry/src/main/java/com/ohos/speechutilsdemo/slice/AsrAbilitySlice.java b/entry/src/main/java/com/ohos/speechutilsdemo/slice/AsrAbilitySlice.java index 39aaa6959d14d5c80d44493dd43067639778cc06..e6343c4af590243fdc33482b50b0d9982b313692 100644 --- a/entry/src/main/java/com/ohos/speechutilsdemo/slice/AsrAbilitySlice.java +++ b/entry/src/main/java/com/ohos/speechutilsdemo/slice/AsrAbilitySlice.java @@ -2,7 +2,7 @@ * Copyright (C) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * You may obtain an copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/entry/src/main/java/com/ohos/speechutilsdemo/slice/MainAbilitySlice.java b/entry/src/main/java/com/ohos/speechutilsdemo/slice/MainAbilitySlice.java index ba46ab7ccdb5138fde391494885671c22b23aef9..8d80f3143eff5a1e768e82bdbe0f00900dcbefa0 100644 --- a/entry/src/main/java/com/ohos/speechutilsdemo/slice/MainAbilitySlice.java +++ b/entry/src/main/java/com/ohos/speechutilsdemo/slice/MainAbilitySlice.java @@ -2,7 +2,7 @@ * Copyright (C) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * You may obtain an copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/entry/src/main/java/com/ohos/speechutilsdemo/slice/TtsAbilitySlice.java b/entry/src/main/java/com/ohos/speechutilsdemo/slice/TtsAbilitySlice.java index da9d5eaeb623a4d49943c3628bc0facf8f166c1f..80061dbe6e5c8fee9fd3d8cee20bc59317aec5aa 100644 --- a/entry/src/main/java/com/ohos/speechutilsdemo/slice/TtsAbilitySlice.java +++ b/entry/src/main/java/com/ohos/speechutilsdemo/slice/TtsAbilitySlice.java @@ -2,7 +2,7 @@ * Copyright (C) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * You may obtain an copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * diff --git a/speechutils/src/main/java/ee/ioc/phon/ohos/speechutils/utils/LogUtils.java b/speechutils/src/main/java/ee/ioc/phon/ohos/speechutils/utils/LogUtils.java index 7c0d380d947a7355e2e8ef9c31ae30fce80270c4..7a868b7b7dcd6280a12b8dbc46c97fef8e2a2ac6 100644 --- a/speechutils/src/main/java/ee/ioc/phon/ohos/speechutils/utils/LogUtils.java +++ b/speechutils/src/main/java/ee/ioc/phon/ohos/speechutils/utils/LogUtils.java @@ -21,7 +21,6 @@ import ohos.hiviewdfx.HiLogLabel; /** * description 日志类 * - * @author * @since 2021-03-20 */ public class LogUtils { diff --git a/speechutils/src/main/java/ee/ioc/phon/ohos/speechutils/view/MicButton.java b/speechutils/src/main/java/ee/ioc/phon/ohos/speechutils/view/MicButton.java index 87873e254514701c69d8b5782666943bea2e708a..eb1c5a8c4e011f74812a737304608079a26859dc 100644 --- a/speechutils/src/main/java/ee/ioc/phon/ohos/speechutils/view/MicButton.java +++ b/speechutils/src/main/java/ee/ioc/phon/ohos/speechutils/view/MicButton.java @@ -195,11 +195,12 @@ public class MicButton extends Component implements Component.EstimateSizeListen @Override public void onDraw(Component component, Canvas canvas) { - canvas.drawCircle((float) (width / (double)ER), (float) (height /(double)ER), getRadius(), backgroundPaint); + canvas.drawCircle((float) (width / (double) ER), (float) (height / (double) ER), getRadius(), backgroundPaint); PixelMap pixelMap = getPixelMap(ResourceTable.Media_microphone); - rectSrc = new RectFloat((float) ((width - imageSize) / (double)ER), - (float)((height - imageSize) / (double)ER), - (float)(width - ((width - imageSize) / (double)ER)), (float)(height - ((height - imageSize) / (double)ER))); + rectSrc = new RectFloat((float) ((width - imageSize) / (double) ER), + (float) ((height - imageSize) / (double) ER), + (float) (width - ((width - imageSize) / (double) ER)), + (float) (height - ((height - imageSize) / (double) ER))); pixelMapHolder = new PixelMapHolder(pixelMap); canvas.drawPixelMapHolderRect(pixelMapHolder, rectSrc, wavePaint); } @@ -212,8 +213,8 @@ public class MicButton extends Component implements Component.EstimateSizeListen private float getRadius() { double percent = (rmsdbLevel * Math.log(rmsdbLevel)) * NUM_001; percent = Math.min(Math.max(percent, 0f), YIF); - percent = (double)NUM_055 + (double)NUM_045 * percent; - return (float) (percent * ((float) min) / (double)ERF); + percent = (double) NUM_055 + (double) NUM_045 * percent; + return (float) (percent * ((float) min) / (double) ERF); } /**