-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
wangxue08
committed
Feb 27, 2024
1 parent
102c410
commit cb31af1
Showing
7 changed files
with
476 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 50 additions & 2 deletions
52
packages/cw/cw_audio_library/components/cw-audio-record/docs/examples.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,53 @@ | ||
### 基本用法 | ||
|
||
``` html | ||
<cw-audio-record></cw-audio-record> | ||
``` vue | ||
<template> | ||
<div> | ||
<div style="display: flex; flex-direction: column;"> | ||
<u-button @click="startRecord">开始录音</u-button> | ||
<u-button @click="pauseRecord">暂停录音</u-button> | ||
<u-button @click="resumeRecord">恢复录音</u-button> | ||
<u-button @click="stopRecord">停止录音</u-button> | ||
<u-button @click="downloadPCM">下载PCM格式录音</u-button> | ||
<u-button @click="downloadWAV">下载WAV格式录音</u-button> | ||
<u-button @click="downloadMP3">下载MP3格式录音</u-button> | ||
<u-button @click="upload">上传录音</u-button> | ||
</div> | ||
<cw-audio-record ref='audioRecord'></cw-audio-record> | ||
</div> | ||
</template> | ||
<script> | ||
export default { | ||
methods:{ | ||
startRecord() { | ||
this.$refs.audioRecord.startRecord() | ||
}, | ||
pauseRecord() { | ||
this.$refs.audioRecord.pauseRecord() | ||
}, | ||
resumeRecord() { | ||
this.$refs.audioRecord.resumeRecord() | ||
}, | ||
stopRecord() { | ||
this.$refs.audioRecord.stopRecord() | ||
}, | ||
downloadPCM() { | ||
this.$refs.audioRecord.downloadPCM() | ||
}, | ||
downloadWAV() { | ||
this.$refs.audioRecord.downloadWAV() | ||
}, | ||
downloadMP3() { | ||
this.$refs.audioRecord.downloadMP3() | ||
}, | ||
upload() { | ||
this.$refs.audioRecord.uploadRecord() | ||
} | ||
} | ||
} | ||
</script> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.