This commit is contained in:
Cogent Apps
2023-03-14 11:00:40 +00:00
parent 4a5e8c9e16
commit 645b66b988
104 changed files with 11064 additions and 1565 deletions

23
app/src/store/voices.ts Normal file
View File

@@ -0,0 +1,23 @@
import { createSlice, PayloadAction } from '@reduxjs/toolkit';
import type { RootState } from '.';
import { defaultElevenLabsVoiceID } from '../tts/defaults';
const initialState = {
voice: defaultElevenLabsVoiceID,
};
export const voicesSlice = createSlice({
name: 'voices',
initialState,
reducers: {
setVoice: (state, action: PayloadAction<string|null>) => {
state.voice = action.payload || '';
},
},
})
export const { setVoice } = voicesSlice.actions;
export const selectVoice = (state: RootState) => state.voices.voice;
export default voicesSlice.reducer;