HenestrosaDev / audiotext

A desktop application that transcribes audio from files, microphone input or YouTube videos with the option to translate the content and create subtitles.
Other
155 stars 15 forks source link

Issue generating subtitles #19

Closed pordeciralgo closed 4 months ago

pordeciralgo commented 4 months ago

Steps to reproduce

  1. Tried to generate subtitles for this classic movie: https://1drv.ms/v/s!AvxL3H5dkUh1h4k-5Z8uG14x1YrLfQ?e=nAnSTF
  2. Settings: -Language: English (also tested with Spanish, same result) -Transcribe from File -Transcribe using WhisperX -Translate to English: NOT CHECKED -Generate subtitles: CHECKED -Highlight words: NOT CHECKED -Max. line count: 2 -Max. line width: 42 -Model size: large-v2 -Compute type: float32 -Batch size: 8 -Use CPU: NOT CHECKED Running 2.2.1 on Windows 10 x64
  3. Generate transcription works OK.

Expected behaviour

Save transcription generates .txt, .srt and .vtt files.

It does behave as expected with other audio files.

Actual behaviour

Save transcription gets stuck on an empty 0-byte .txt. Neither .srt nor .vtt are generated.

System information

pordeciralgo commented 4 months ago

Please let me know when you're downloaded the file, so I can unshare it. Thank you in advance.

HenestrosaDev commented 4 months ago

I've already downloaded the file. I'll take a look to see what's going on.

HenestrosaDev commented 4 months ago

It seems that the problem is caused by the ♪ symbols, which throw a UnicodeEncodeError in the save_transcription method of the main_controller when writing the transcription text to a .txt file.

This is the stacktrace for reference:

UnicodeEncodeError: 'charmap' codec can't encode character '\u266a' in position 0: character maps to <undefined>

I've already solved this by encoding the file with utf-8. I'll close the issue as soon as I release version 2.2.2, which should be sometime today or tomorrow.

pordeciralgo commented 4 months ago

That was fast! Thank you very much for your help :)

HenestrosaDev commented 4 months ago

I've just released the new version, so I'm closing this issue. Please create a new one if you encounter any problems.