AwesomeTTS / awesometts-anki-addon

AwesomeTTS text-to-speech add-on for Anki
GNU General Public License v3.0
483 stars 100 forks source link

Record and insert audio - issues with placement of audio tag #271

Open woj-tek opened 2 years ago

woj-tek commented 2 years ago

Hi, long time AwesomeTTS user. I noticed that "recently" (~couple of months, possibly with Anki switching to Qt6?) the behaviour of editor/ATTS changed slightly. Previously clipboard contents would be preferred when filling the entry field in "Add TTS audio to note" and the recorded audio tag would be inserted at the cursor location. Currently it always populates the entry form with contents of the field that we want to insert audio to and it inserts the resulting tag ([sound:…]) at the end of the field.

Is there a way/configuration option to restore previous workflow?

luc-vocab commented 2 years ago

Indeed Anki 2.1.50+ came with editor changes that has required some changes in AwesomeTTS. In the latest version of AwesomeTTS I tried to fix some behavior around that. Can you give me more information about your use case, do you manually set the insertion point to where you need it ? And what's the reason inserting the sound tag at the end doesn't work for you ?

woj-tek commented 2 years ago

Hi, thank you for quick response.

In this particular case it's simply a list of couple of example sentences:

Sentence 1.
Sentence 2.
Sentence 3.
Sentence 4.

My flow is usually like this: Select "Sentence 1", place cursor just after it (first line), hit cmd+T to open ATTS, hit enter -> tag is inserted in the first line. Repeat for remaining sentences. Currently it doesn't work - I have to explicitly paste Sentence 1 in the ATTS and then the result is inserted after Sentence 4.

As a workaround I simply copy whole thing, open ATTS and then select all but first sentence, cut it, insert and repeat until I run out of sentences, and then move them to the correct positions but it's not really convenient (as previously).


One more difference/change (possibly related to tracking cursor position): previously selected text would be replaced completely (convenient in overriding audio from different service).

luc-vocab commented 1 year ago

FYI HyperTTS now supports audio generation from a text selection, more details here: https://languagetools.anki.study/updates#2022-10-09

woj-tek commented 1 year ago

^^ It looks like AwesomeTTS supports this (audio from selection) as well right now but it still doesn't address the issue of using clipboard contents or inserting recording at the cursor location.

Is there anything I could do to help with this?

luc-vocab commented 1 year ago

also requested by Oliver over email

woj-tek commented 1 year ago

I don't know who Oliver is but again - is there anything I could do to help with this? :-)

luc-vocab commented 4 months ago

Looks like this is still an outstanding issue, particularly on windows.

It places the sound file at the very beginning actually. Regardless of where cursor is. [audio]Test

requested by ybranchy over email

luc-vocab commented 4 months ago

Doing some testing on this issue

Linux

seems like no matter what, cursor is placed at end of text. So i'm unable to reproduce ybranchy's issue, but waiting for more information (Anki version and AwesomeTTS)

woj-tek commented 4 months ago

On macOS it places audio always at the end of the text. It would be nice to insert it at the cursor position (so it would even be in the middle of the sentence)

luc-vocab commented 4 months ago

@woj-tek Anki version and AwesomeTTS version please

woj-tek commented 4 months ago

Anki: Version ⁨24.06.2 (33a92379)⁩ Python 3.9.18 Qt 6.6.2 PyQt 6.6.1

AwesomeTTS: v1.88.3

luc-vocab commented 3 months ago

reported by Leonardo over email:

luc-vocab commented 2 months ago

report by Mikulas over email:

When I record selected text using the button in the top bar, the recording gets placed after the selected text, as I would expect. However, if I record selected text using the keyboard shortcut (ctrl+t), the recording always gets placed at the beginning. I think this is unexpected behavior, i.e. bug.

luc-vocab commented 1 month ago

Reported by Luan over email AwesomeTTS 1.88.2

I use the "To generate single MP3 in note editor*, use keyboard shortcut:" setting in the settings, and use Ctrl + S as the shortcut to do this, instead of the default Ctrl + T. I position the cursor at the end of the sentence, and press the shortcut to generate the audio note. However, the tag goes to the beginning of the sentence:

https://github.com/user-attachments/assets/d1f6668b-22fc-4e9e-9697-d84e46caddea