mirror of
https://github.com/w-okada/voice-changer.git
synced 2025-02-11 20:52:32 +03:00
26 lines
598 B
TypeScript
26 lines
598 B
TypeScript
import { ClientState, useClient } from "@dannadori/voice-changer-client-js"
|
|
import { AUDIO_ELEMENT_FOR_PLAY_RESULT, CLIENT_TYPE } from "../const"
|
|
|
|
export type UseVCClientProps = {
|
|
audioContext: AudioContext | null
|
|
}
|
|
|
|
export type VCClientState = {
|
|
clientState: ClientState
|
|
}
|
|
|
|
export const useVCClient = (props: UseVCClientProps) => {
|
|
|
|
const clientState = useClient({
|
|
clientType: CLIENT_TYPE,
|
|
audioContext: props.audioContext,
|
|
audioOutputElementId: AUDIO_ELEMENT_FOR_PLAY_RESULT
|
|
})
|
|
|
|
const ret: VCClientState = {
|
|
clientState
|
|
}
|
|
|
|
return ret
|
|
|
|
} |