mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-25 00:23:53 +08:00
27 lines
531 B
TypeScript
27 lines
531 B
TypeScript
import { defineStore } from 'pinia'
|
|
|
|
export const useSpeedPitch = defineStore('speedPitch', () => {
|
|
const speedPitch = ref({
|
|
ttsVolume: 0,
|
|
ttsRate: 0,
|
|
ttsPitch: 0,
|
|
})
|
|
|
|
const updateSpeedPitch = (val: typeof speedPitch.value) => {
|
|
speedPitch.value = val
|
|
}
|
|
|
|
return {
|
|
speedPitch,
|
|
updateSpeedPitch,
|
|
}
|
|
}, {
|
|
persist: {
|
|
key: 'speedPitch',
|
|
serializer: {
|
|
serialize: state => JSON.stringify(state.speedPitch),
|
|
deserialize: value => ({ speedPitch: JSON.parse(value) }),
|
|
},
|
|
},
|
|
})
|