| Name | Date | Size | #Lines | LOC | ||
|---|---|---|---|---|---|---|
| .. | - | - | ||||
| AppScope/ | 12-May-2024 | - | 36 | 33 | ||
| entry/ | 12-May-2024 | - | 2,513 | 2,159 | ||
| screenshots/device/ | 12-May-2024 | - | ||||
| .gitignore | D | 12-May-2024 | 142 | 11 | 11 | |
| README.md | D | 12-May-2024 | 1 KiB | 20 | 10 | |
| README_zh.md | D | 12-May-2024 | 2.6 KiB | 48 | 25 | |
| build-profile.json5 | D | 12-May-2024 | 1 KiB | 43 | 41 | |
| hvigorfile.ts | D | 12-May-2024 | 158 | 2 | 1 | |
| package.json | D | 12-May-2024 | 371 | 18 | 18 |
README.md
1# Media - Recorder 2 3### Introduction 4 5 This sample shows how to use audio recording and playback of the media service. 6 7### Usage 8 91. Start the sample app, touch the **Record** button at the bottom of the home screen to start recording. During the recording, you can touch the **Pause** button in the lower right corner to pause the recording, and touch the **Back** button at the top or the red **Stop** button to stop recording and return to the home screen. The recorded audio file is displayed on the home screen. 10 112. Touch an audio file to play it. On the audio playback page, you can touch the corresponding button to pause or resume the playback. 12 133. Touch and hold an audio file, and then you can select multiple audio files. After selecting one of them, you can touch the corresponding button at the bottom to rename or delete it. 14 154. Swipe left on an audio file to display the **Rename** and **Delete** buttons. Touch the corresponding button to rename or delete the audio file. 16 17### Constraints 18 19This sample can only be run on standard-system devices. 20
README_zh.md
1# 录音机 2 3### 介绍 4 5本示例使用[audio](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-audio.md)相关接口实现音频录制和播放的功能,使用[mediaLibrary](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-medialibrary.md)实现音频文件的管理。 6 7相关概念: 8 9AudioRecorder:音频录制的主要工作是捕获音频信号,完成音频编码并保存到文件中,帮助开发者轻松实现音频录制功能。它允许调用者指定音频录制的采样率、声道数、编码格式、封装格式、文件路径等参数。 10 11AudioPlayer:音频播放的主要工作是将音频数据转码为可听见的音频模拟信号并通过输出设备进行播放,同时对播放任务进行管理。 12 13使用说明: 14 151.启动应用,点击首页底部**录制**按钮跳转到录制界面开始录制音频,录制过程中可以点击右下角的**暂停**按钮暂停录制,点击顶部**返回键**或红色的**停止**按钮停止录音并返回首页,首页中展示录制好的音频文件。 16 172.点击**音频文件**可以播放该文件,播放界面可以点击按钮进行暂停和继续播放。 18 193.长按音频文件进入多选状态,可以选择音频文件,选择后可以点击底部的按钮进行重命名和删除操作。 20 214.左滑音频文件,可以滑出重命名和删除按钮,点击可以对该音频文件进行重命名和删除操作。 22 23### 效果预览 24 25|首页|录制界面| 26|--------------------------------|--------------------------------| 27|| | 28 29### 相关权限 30 31权限一:用户授权,访问媒体和文件 [ohos.permission.WRITE_MEDIA, ohos.permission.READ_MEDIA](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md) 32 33权限二:用户授权,使用麦克风 [ohos.permission.MICROPHONE](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/permission-list.md) 34 35### 依赖 36 37不涉及。 38 39### 约束与限制 40 411.本示例仅支持标准系统上运行。 42 432.本示例仅支持API9版本SDK,版本号:3.2.7.6。 44 453.本示例需要使用DevEco Studio 3.1 Canary1 (Build Version: 3.1.0.100, built on November 3, 2022)才可编译运行。 46 474.本示例需要使用@ohos.process系统权限的系统接口。使用Full SDK时需要手动从镜像站点获取,并在DevEco Studio中替换,具体操作可参考[替换指南](https://docs.openharmony.cn/pages/v3.2/zh-cn/application-dev/quick-start/full-sdk-switch-guide.md/)。 48