mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-11 13:49:41 -08:00
- Implemented pcmToWav function to convert PCM audio data to WAV format. - Updated onAudioChunk callback to receive both PCM and WAV buffers. - Modified TypeScript definitions to reflect changes in onAudioChunk parameter and append method.
27 lines
626 B
TypeScript
27 lines
626 B
TypeScript
import type Artplayer from 'artplayer';
|
|
|
|
export = artplayerPluginAsr;
|
|
export as namespace artplayerPluginAsr;
|
|
|
|
interface AudioChunk {
|
|
pcm: ArrayBuffer;
|
|
wav: ArrayBuffer;
|
|
}
|
|
|
|
interface AsrPluginOption {
|
|
length?: number;
|
|
interval?: number;
|
|
sampleRate?: number;
|
|
autoHideTimeout?: number;
|
|
onAudioChunk?: (chunk: AudioChunk) => void | Promise<void>;
|
|
}
|
|
|
|
interface AsrPluginInstance {
|
|
name: 'artplayerPluginAsr';
|
|
stop: () => void;
|
|
hide: () => void;
|
|
append: (subtitle: string) => void;
|
|
}
|
|
|
|
declare function artplayerPluginAsr(option?: AsrPluginOption): (art: Artplayer) => AsrPluginInstance;
|