975 B
975 B
Audio Reader
Embed a simple audio player button, useful for pronunciation guides.
Configuration
Enable the feature in .vuepress/config.ts:
export default defineUserConfig({
theme: plumeTheme({
markdown: {
audioReader: true,
},
})
})
Syntax
Inline syntax:
@[audioReader](src)
With options:
@[audioReader type="audio/mpeg" title="title" autoplay start-time="0" end-time="10" volume="0.7"](src)
Parameters:
src: Audio source URLtype: Audio MIME type (e.g.,audio/mpeg)title: Title displayed before the iconautoplay: Enable autoplaystart-time: Start time in secondsend-time: End time in secondsvolume: Volume (0-1)
Global Component
You can also use the <AudioReader /> component.
<AudioReader src="/audio/audio.mp3">[ˈɔːdioʊ]</AudioReader>
Example
audio 美 [ˈɔːdioʊ] @[audioReader](/audio/audio.mp3)