Add 'record with playback' to settings menu#625
Conversation
killergerbah
left a comment
There was a problem hiding this comment.
Please update the AudioClip.fromCard call in handleCopy in App.tsx as well. That will ensure that this setting behaves consistently in all cases.
common/locales/en.json
Outdated
| "preCacheSubtitleDom": "Pre-cache Subtitle DOM", | ||
| "preCacheSubtitleDomHelperText": "If enabled, asbplayer will pre-render subtitle text elements in an offscreen element, and re-use those elements for subtitle display. This allows external code to persistently modify subtitle text before it is displayed.", | ||
| "recordingBind": "Recording", | ||
| "recordWithAudioPlayback": "Record with audio playback", |
There was a problem hiding this comment.
This copy should specify that it only applies to local video.
Something like: "Play audio while recording audio from local video"
Fixed |
common/components/AnkiDialog.tsx
Outdated
|
|
||
| const initialAudioClip = useMemo( | ||
| () => AudioClip.fromCard(card, settings.audioPaddingStart, settings.audioPaddingEnd, false), | ||
| () => AudioClip.fromCard(card, settings.audioPaddingStart, settings.audioPaddingEnd, settings.recordWithAudioPlayback), |
There was a problem hiding this comment.
Missed this on the first pass. You need to update the dependency array being passed to useMemo to ensure the audio clip changes whenever the setting changes.
There was a problem hiding this comment.
I'm not sure I understand, I added now the setting to the array below this line if that's what you meant. Correct me if i'm wrong
There was a problem hiding this comment.
Your change is the right one. If you're interested in learning why you can look up react hooks and dependency arrays.
common/components/AnkiDialog.tsx
Outdated
| }, []); | ||
|
|
||
| }, []); | ||
There was a problem hiding this comment.
The extra space will fail the Prettier formatting check on this repo. Easiest way to fix this is run Prettier on the file whenever you make a change.
common/app/components/App.tsx
Outdated
| settingsRef.current.audioPaddingStart, | ||
| settingsRef.current.audioPaddingEnd, | ||
| true | ||
| settings.recordWithAudioPlayback |
There was a problem hiding this comment.
Here, use settingsRef to access the setting.
|
Forgot to add de localization, try running workflow now |
|
Okay fixed formatting, now it should work. |
|
Thanks! |
Fixes issue #620
It's now configurable in settings menu:
