sebheron / TikTok-Reddit-Text-To-Speech

Reddit TTS generator designed for TikTok
https://sebheron.github.io/tiktok-reddit-text-to-speech/
MIT License
26 stars 0 forks source link

Running the program gives error code: "System.ArgumentOutOfRangeException: Non-negative number required. (Parameter 'maxValue')" #1

Closed noahesbjerg closed 2 years ago

noahesbjerg commented 2 years ago

After building the project, I open the "TTSGen.exe" file in CMD. After that, it asks me to provide a link to an Reddit post, and a background video. After doing that, it spits out this error:

Unhandled exception. System.Exception: Reddit Video Generator error. See inner exception for details.
 ---> System.ArgumentOutOfRangeException: Non-negative number required. (Parameter 'maxValue')
   at System.Random.ThrowMaxValueMustBeNonNegative()
   at System.Random.Next(Int32 maxValue)
   at RedditTextToSpeech.Logic.RedditVideoGenerator.GetVoice(String[] voices, String currentVoice) in C:\Users\noahl\Downloads\TikTok-Reddit-Text-To-Speech-main\RedditTextToSpeech.Logic\RedditVideoGenerator.cs:line 164
   at RedditTextToSpeech.Logic.RedditVideoGenerator.GenerateVideo(String url, String backgroundVideo, String output, Gender gender, TimeSpan startTime) in C:\Users\noahl\Downloads\TikTok-Reddit-Text-To-Speech-main\RedditTextToSpeech.Logic\RedditVideoGenerator.cs:line 62
   --- End of inner exception stack trace ---
   at RedditTextToSpeech.Logic.RedditVideoGenerator.GenerateVideo(String url, String backgroundVideo, String output, Gender gender, TimeSpan startTime) in C:\Users\noahl\Downloads\TikTok-Reddit-Text-To-Speech-main\RedditTextToSpeech.Logic\RedditVideoGenerator.cs:line 92
   at Program.<Main>$(String[] args) in C:\Users\noahl\Downloads\TikTok-Reddit-Text-To-Speech-main\RedditTextToSpeech.Presentation\Program.cs:line 52
   at Program.<Main>(String[] args)

The exact command that I used was: C:\Users\noahl\Downloads\TikTok-Reddit-Text-To-Speech-main\RedditTextToSpeech.Presentation\bin\Debug\net6.0\TTSGen.exe -url https://www.reddit.com/r/confession/comments/v2xhza/i_stole_another_girls_pair_of_pants_in_middle/ -background background.mp4

sebheron commented 2 years ago

It should be fixed in the PR #2. Feel free to try that branch and see if it fixes the issue.

noahesbjerg commented 2 years ago

It should be fixed in the PR #2. Feel free to try that branch and see if it fixes the issue.

Hi. I just tried the new branch. However, I still get the exact same error message:

Unhandled exception. System.Exception: Reddit Video Generator error. See inner exception for details.
 ---> System.ArgumentOutOfRangeException: Non-negative number required. (Parameter 'maxValue')
   at System.Random.ThrowMaxValueMustBeNonNegative()
   at System.Random.Next(Int32 maxValue)
   at RedditTextToSpeech.Logic.RedditVideoGenerator.GetVoice(String[] voices, String currentVoice) in C:\Users\noahl\Downloads\TikTok-Reddit-Text-To-Speech-Fix-GetVoices-bug\RedditTextToSpeech.Logic\RedditVideoGenerator.cs:line 164
   at RedditTextToSpeech.Logic.RedditVideoGenerator.GenerateVideo(String url, String backgroundVideo, String output, Gender gender, TimeSpan startTime) in C:\Users\noahl\Downloads\TikTok-Reddit-Text-To-Speech-Fix-GetVoices-bug\RedditTextToSpeech.Logic\RedditVideoGenerator.cs:line 62
   --- End of inner exception stack trace ---
   at RedditTextToSpeech.Logic.RedditVideoGenerator.GenerateVideo(String url, String backgroundVideo, String output, Gender gender, TimeSpan startTime) in C:\Users\noahl\Downloads\TikTok-Reddit-Text-To-Speech-Fix-GetVoices-bug\RedditTextToSpeech.Logic\RedditVideoGenerator.cs:line 92
   at Program.<Main>$(String[] args) in C:\Users\noahl\Downloads\TikTok-Reddit-Text-To-Speech-Fix-GetVoices-bug\RedditTextToSpeech.Presentation\Program.cs:line 52
   at Program.<Main>(String[] args)

If it helps, then I am using Windows 11, with the Danish language pack installed.

sebheron commented 2 years ago

Oh woops, I can't run any tests right now to see if I've fixed the issue unfortunately. I think what's going on is your Windows TTS only features one male voice and so when attempting to Randomise the selection it tries to get a Random number between 0 and 0, obviously throwing an error. I "should've" fixed it in the branch now. If you get the chance, try it again and it should work.

noahesbjerg commented 2 years ago

Hi again. I just recompiled it with the new changes. While you did manage to fix the original error, a new one has now appeared.:

Unhandled exception. System.Exception: Reddit Video Generator error. See inner exception for details.
 ---> System.ArgumentException: 'name' cannot be an empty string. (Parameter 'name')
   at System.Speech.Internal.Helpers.ThrowIfEmptyOrNull(String s, String paramName)
   at System.Speech.Synthesis.SpeechSynthesizer.SelectVoice(String name)
   at RedditTextToSpeech.Logic.Services.WindowsSpeechSynthesisService.<>c__DisplayClass9_0.<GetSound>b__0() in C:\Users\noahl\Downloads\TikTok-Reddit-Text-To-Speech-Fix-GetVoices-bug\RedditTextToSpeech.Logic\Services\WindowsSpeechSynthesisService.cs:line 54
   at System.Threading.Tasks.Task.InnerInvoke()
   at System.Threading.Tasks.Task.<>c.<.cctor>b__272_0(Object obj)
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
   at RedditTextToSpeech.Logic.Services.WindowsSpeechSynthesisService.GetSound(String path, String voice, String text) in C:\Users\noahl\Downloads\TikTok-Reddit-Text-To-Speech-Fix-GetVoices-bug\RedditTextToSpeech.Logic\Services\WindowsSpeechSynthesisService.cs:line 49
   at RedditTextToSpeech.Logic.Factories.AudioClipFactory.GetAudioClip(String text, String voice) in C:\Users\noahl\Downloads\TikTok-Reddit-Text-To-Speech-Fix-GetVoices-bug\RedditTextToSpeech.Logic\Factories\AudioClipFactory.cs:line 32
   at RedditTextToSpeech.Logic.RedditVideoGenerator.GenerateVideo(String url, String backgroundVideo, String output, Gender gender, TimeSpan startTime) in C:\Users\noahl\Downloads\TikTok-Reddit-Text-To-Speech-Fix-GetVoices-bug\RedditTextToSpeech.Logic\RedditVideoGenerator.cs:line 65
   --- End of inner exception stack trace ---
   at RedditTextToSpeech.Logic.RedditVideoGenerator.GenerateVideo(String url, String backgroundVideo, String output, Gender gender, TimeSpan startTime) in C:\Users\noahl\Downloads\TikTok-Reddit-Text-To-Speech-Fix-GetVoices-bug\RedditTextToSpeech.Logic\RedditVideoGenerator.cs:line 92
   at Program.<Main>$(String[] args) in C:\Users\noahl\Downloads\TikTok-Reddit-Text-To-Speech-Fix-GetVoices-bug\RedditTextToSpeech.Presentation\Program.cs:line 52
   at Program.<Main>(String[] args)

Edit: I just checked in Windows. The Danish language pack has one TTS voice, which is a women. Could that be the issue?

noahesbjerg commented 2 years ago

Yep. It works if I specify -gender as female. :)

noahesbjerg commented 2 years ago

FFMPEG is now giving me issues. Not sure if you want me to create a seperate thread for this. But the issue I am getting is:

ffmpeg version 2022-02-17-git-2812508086-full_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 11.2.0 (Rev7, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      57. 21.100 / 57. 21.100
  libavcodec     59. 21.100 / 59. 21.100
  libavformat    59. 17.102 / 59. 17.102
  libavdevice    59.  5.100 / 59.  5.100
  libavfilter     8. 27.100 /  8. 27.100
  libswscale      6.  5.100 /  6.  5.100
  libswresample   4.  4.100 /  4.  4.100
  libpostproc    56.  4.100 / 56.  4.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\Users\noahl\Downloads\videoplayback.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2021-03-01T22:44:31.000000Z
  Duration: 00:07:50.51, start: 0.000000, bitrate: 486 kb/s
  Stream #0:0[0x1](und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 640x360 [SAR 1:1 DAR 16:9], 387 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
    Metadata:
      creation_time   : 2021-03-01T22:44:31.000000Z
      handler_name    : ISO Media file produced by Google Inc. Created on: 03/01/2021.
      vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 95 kb/s (default)
    Metadata:
      creation_time   : 2021-03-01T22:44:31.000000Z
      handler_name    : ISO Media file produced by Google Inc. Created on: 03/01/2021.
      vendor_id       : [0][0][0][0]
Output #0, mp4, to 'a4c540d2-0116-499b-b71b-cf492fb4a2bf.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    encoder         : Lavf59.17.102
  Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 640x360 [SAR 1:1 DAR 16:9], q=2-31, 387 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
    Metadata:
      creation_time   : 2021-03-01T22:44:31.000000Z
      handler_name    : ISO Media file produced by Google Inc. Created on: 03/01/2021.
      vendor_id       : [0][0][0][0]
  Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 95 kb/s (default)
    Metadata:
      creation_time   : 2021-03-01T22:44:31.000000Z
      handler_name    : ISO Media file produced by Google Inc. Created on: 03/01/2021.
      vendor_id       : [0][0][0][0]
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=  653 fps=0.0 q=-1.0 Lsize=    1465kB time=00:00:26.09 bitrate= 459.8kbits/s speed=4.37e+03x
video:1141kB audio:306kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.229530%
ffmpeg version 2022-02-17-git-2812508086-full_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 11.2.0 (Rev7, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      57. 21.100 / 57. 21.100
  libavcodec     59. 21.100 / 59. 21.100
  libavformat    59. 17.102 / 59. 17.102
  libavdevice    59.  5.100 / 59.  5.100
  libavfilter     8. 27.100 /  8. 27.100
  libswscale      6.  5.100 /  6.  5.100
  libswresample   4.  4.100 /  4.  4.100
  libpostproc    56.  4.100 / 56.  4.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'a4c540d2-0116-499b-b71b-cf492fb4a2bf.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf59.17.102
  Duration: 00:00:26.12, start: 0.000000, bitrate: 459 kb/s
  Stream #0:0[0x1](und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 640x360 [SAR 1:1 DAR 16:9], 357 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
    Metadata:
      handler_name    : ISO Media file produced by Google Inc. Created on: 03/01/2021.
      vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 96 kb/s (default)
    Metadata:
      handler_name    : ISO Media file produced by Google Inc. Created on: 03/01/2021.
      vendor_id       : [0][0][0][0]
Input #1, png_pipe, from '11cc1aa0-032f-4005-aad0-982454c5afef.png':
  Duration: N/A, bitrate: N/A
  Stream #1:0: Video: png, rgba(pc), 410x110 [SAR 3779:3779 DAR 41:11], 25 fps, 25 tbr, 25 tbn
Input #2, png_pipe, from '699e3a3d-348d-4d51-8791-9f6de7a0fcc9.png':
  Duration: N/A, bitrate: N/A
  Stream #2:0: Video: png, rgba(pc), 410x148 [SAR 3779:3779 DAR 205:74], 25 fps, 25 tbr, 25 tbn
Input #3, png_pipe, from 'd951493f-c699-435f-b3fa-ad360e078ad6.png':
  Duration: N/A, bitrate: N/A
  Stream #3:0: Video: png, rgba(pc), 410x70 [SAR 3779:3779 DAR 41:7], 25 fps, 25 tbr, 25 tbn
Guessed Channel Layout for Input Stream #4.0 : mono
Input #4, wav, from 'd61d1d55-b284-46e7-a8e6-87c4851b4023.wav':
  Duration: 00:00:25.58, bitrate: 512 kb/s
  Stream #4:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 32000 Hz, mono, s16, 512 kb/s
[overlay @ 0000028c49f3c700] [Eval @ 000000970d7fef50] Missing ')' or too many args in 'between(t,0,4,9894999)'
[overlay @ 0000028c49f3c700] Error when evaluating the expression 'between(t,0,4,9894999)' for enable
[AVFilterGraph @ 0000028c49898800] Error initializing filter 'overlay' with args '(main_w-overlay_w)/2:(main_h-overlay_h)/2:enable = between(t,0,4,9894999)'
Error initializing complex filters.
Invalid argument
Unhandled exception. System.ComponentModel.Win32Exception (2): An error occurred trying to start process 'C:\Users\noahl\Downloads\TikTok-Reddit-Text-To-Speech-Fix-GetVoices-bug\RedditTextToSpeech.Presentation\bin\Debug\net6.0\8d7f117c-9561-4116-b618-d5a3ecbf2a7c.mp4' with working directory 'C:\Users\noahl'. The file could not be found
   at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at Program.<Main>$(String[] args) in C:\Users\noahl\Downloads\TikTok-Reddit-Text-To-Speech-Fix-GetVoices-bug\RedditTextToSpeech.Presentation\Program.cs:line 58
   at Program.<Main>(String[] args)
sebheron commented 2 years ago

Yep. It works if I specify -gender as female. :)

That's good to know, it's useful to plan for these kinds of edge cases. I'll try to catch these errors in a future update and display some more meaningful text.

FFMPEG is now giving me issues.

This could be a version specific issue, or something within the post itself. I'll try to run some tests to see if I can fix the issue shortly :)

noahesbjerg commented 2 years ago

Cheers.

Yep. It works if I specify -gender as female. :)

That's good to know, it's useful to plan for these kinds of edge cases. I'll try to catch these errors in a future update and display some more meaningful text.

FFMPEG is now giving me issues.

This could be a version specific issue, or something within the post itself. I'll try to run some tests to see if I can fix the issue shortly :)

Cheers.

sebheron commented 2 years ago

Unhandled exception. System.ComponentModel.Win32Exception (2): An error occurred trying to start process 'C:\Users\noahl\Downloads\TikTok-Reddit-Text-To-Speech-Fix-GetVoices-bug\RedditTextToSpeech.Presentation\bin\Debug\net6.0\8d7f117c-9561-4116-b618-d5a3ecbf2a7c.mp4' with working directory 'C:\Users\noahl'. The file could not be found

Managed to figure out that the working directory for FFMPEG was causing issues. Latest branch update should have fixed it.

noahesbjerg commented 2 years ago

Unhandled exception. System.ComponentModel.Win32Exception (2): An error occurred trying to start process 'C:\Users\noahl\Downloads\TikTok-Reddit-Text-To-Speech-Fix-GetVoices-bug\RedditTextToSpeech.Presentation\bin\Debug\net6.0\8d7f117c-9561-4116-b618-d5a3ecbf2a7c.mp4' with working directory 'C:\Users\noahl'. The file could not be found

Managed to figure out that the working directory for FFMPEG was causing issues. Latest branch update should have fixed it.

Hi. I sadly still get the exact same error message:

ffmpeg version 2022-02-17-git-2812508086-full_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 11.2.0 (Rev7, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      57. 21.100 / 57. 21.100
  libavcodec     59. 21.100 / 59. 21.100
  libavformat    59. 17.102 / 59. 17.102
  libavdevice    59.  5.100 / 59.  5.100
  libavfilter     8. 27.100 /  8. 27.100
  libswscale      6.  5.100 /  6.  5.100
  libswresample   4.  4.100 /  4.  4.100
  libpostproc    56.  4.100 / 56.  4.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\Users\noahl\Downloads\videoplayback.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2021-03-01T22:44:31.000000Z
  Duration: 00:07:50.51, start: 0.000000, bitrate: 486 kb/s
  Stream #0:0[0x1](und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 640x360 [SAR 1:1 DAR 16:9], 387 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
    Metadata:
      creation_time   : 2021-03-01T22:44:31.000000Z
      handler_name    : ISO Media file produced by Google Inc. Created on: 03/01/2021.
      vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 95 kb/s (default)
    Metadata:
      creation_time   : 2021-03-01T22:44:31.000000Z
      handler_name    : ISO Media file produced by Google Inc. Created on: 03/01/2021.
      vendor_id       : [0][0][0][0]
Output #0, mp4, to 'C:\Users\noahl\b6877b76-4167-4bcd-906b-3a0c03d4c046.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    encoder         : Lavf59.17.102
  Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 640x360 [SAR 1:1 DAR 16:9], q=2-31, 387 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
    Metadata:
      creation_time   : 2021-03-01T22:44:31.000000Z
      handler_name    : ISO Media file produced by Google Inc. Created on: 03/01/2021.
      vendor_id       : [0][0][0][0]
  Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 95 kb/s (default)
    Metadata:
      creation_time   : 2021-03-01T22:44:31.000000Z
      handler_name    : ISO Media file produced by Google Inc. Created on: 03/01/2021.
      vendor_id       : [0][0][0][0]
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 1863 fps=0.0 q=-1.0 Lsize=    3983kB time=00:01:14.51 bitrate= 437.9kbits/s speed=5.27e+03x
video:3062kB audio:874kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.221565%
ffmpeg version 2022-02-17-git-2812508086-full_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 11.2.0 (Rev7, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      57. 21.100 / 57. 21.100
  libavcodec     59. 21.100 / 59. 21.100
  libavformat    59. 17.102 / 59. 17.102
  libavdevice    59.  5.100 / 59.  5.100
  libavfilter     8. 27.100 /  8. 27.100
  libswscale      6.  5.100 /  6.  5.100
  libswresample   4.  4.100 /  4.  4.100
  libpostproc    56.  4.100 / 56.  4.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\Users\noahl\b6877b76-4167-4bcd-906b-3a0c03d4c046.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf59.17.102
  Duration: 00:01:14.52, start: 0.000000, bitrate: 437 kb/s
  Stream #0:0[0x1](und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 640x360 [SAR 1:1 DAR 16:9], 336 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
    Metadata:
      handler_name    : ISO Media file produced by Google Inc. Created on: 03/01/2021.
      vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 96 kb/s (default)
    Metadata:
      handler_name    : ISO Media file produced by Google Inc. Created on: 03/01/2021.
      vendor_id       : [0][0][0][0]
Input #1, png_pipe, from 'C:\Users\noahl\c4898789-6b2e-4cf5-9131-dcd1880f2d00.png':
  Duration: N/A, bitrate: N/A
  Stream #1:0: Video: png, rgba(pc), 410x87 [SAR 3779:3779 DAR 410:87], 25 fps, 25 tbr, 25 tbn
Input #2, png_pipe, from 'C:\Users\noahl\90b58b28-4368-411a-88d7-2102829da93a.png':
  Duration: N/A, bitrate: N/A
  Stream #2:0: Video: png, rgba(pc), 410x63 [SAR 3779:3779 DAR 410:63], 25 fps, 25 tbr, 25 tbn
Input #3, png_pipe, from 'C:\Users\noahl\eab4a8a1-6b50-4ad3-87e2-c0fb8d46f666.png':
  Duration: N/A, bitrate: N/A
  Stream #3:0: Video: png, rgba(pc), 410x51 [SAR 3779:3779 DAR 410:51], 25 fps, 25 tbr, 25 tbn
Input #4, png_pipe, from 'C:\Users\noahl\0e2962c8-7a55-43fb-bafd-b93d453fd628.png':
  Duration: N/A, bitrate: N/A
  Stream #4:0: Video: png, rgba(pc), 410x63 [SAR 3779:3779 DAR 410:63], 25 fps, 25 tbr, 25 tbn
Input #5, png_pipe, from 'C:\Users\noahl\1b79ebde-57b8-4c88-a39b-72df0e624b39.png':
  Duration: N/A, bitrate: N/A
  Stream #5:0: Video: png, rgba(pc), 410x63 [SAR 3779:3779 DAR 410:63], 25 fps, 25 tbr, 25 tbn
Input #6, png_pipe, from 'C:\Users\noahl\aedb47dc-7099-4a5c-8e89-a829dac647bc.png':
  Duration: N/A, bitrate: N/A
  Stream #6:0: Video: png, rgba(pc), 410x31 [SAR 3779:3779 DAR 410:31], 25 fps, 25 tbr, 25 tbn
Input #7, png_pipe, from 'C:\Users\noahl\d62f491c-a1fa-4896-8232-52450bc42f35.png':
  Duration: N/A, bitrate: N/A
  Stream #7:0: Video: png, rgba(pc), 410x121 [SAR 3779:3779 DAR 410:121], 25 fps, 25 tbr, 25 tbn
Input #8, png_pipe, from 'C:\Users\noahl\8824fad9-c12c-4eb2-a1d9-362d8ff648fd.png':
  Duration: N/A, bitrate: N/A
  Stream #8:0: Video: png, rgba(pc), 410x90 [SAR 3779:3779 DAR 41:9], 25 fps, 25 tbr, 25 tbn
Input #9, png_pipe, from 'C:\Users\noahl\7decc4a5-589a-4c77-92e8-08009e15a3b5.png':
  Duration: N/A, bitrate: N/A
  Stream #9:0: Video: png, rgba(pc), 410x102 [SAR 3779:3779 DAR 205:51], 25 fps, 25 tbr, 25 tbn
Input #10, png_pipe, from 'C:\Users\noahl\4e86387b-6580-4957-bacd-c1eab4c47900.png':
  Duration: N/A, bitrate: N/A
  Stream #10:0: Video: png, rgba(pc), 410x109 [SAR 3779:3779 DAR 410:109], 25 fps, 25 tbr, 25 tbn
Input #11, png_pipe, from 'C:\Users\noahl\d100fbe8-7391-4854-b647-63ab8a74b02d.png':
  Duration: N/A, bitrate: N/A
  Stream #11:0: Video: png, rgba(pc), 410x109 [SAR 3779:3779 DAR 410:109], 25 fps, 25 tbr, 25 tbn
Guessed Channel Layout for Input Stream #12.0 : mono
Input #12, wav, from 'C:\Users\noahl\{Guid.NewGuid()}.wav':
  Duration: 00:01:14.00, bitrate: 512 kb/s
  Stream #12:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 32000 Hz, mono, s16, 512 kb/s
[overlay @ 000001efb4dd8480] [Eval @ 00000005ca1ff220] Missing ')' or too many args in 'between(t,0,3,6945)'
[overlay @ 000001efb4dd8480] Error when evaluating the expression 'between(t,0,3,6945)' for enable
[AVFilterGraph @ 000001efb4e00540] Error initializing filter 'overlay' with args '(main_w-overlay_w)/2:(main_h-overlay_h)/2:enable = between(t,0,3,6945)'
Error initializing complex filters.
Invalid argument
Unhandled exception. System.ComponentModel.Win32Exception (2): An error occurred trying to start process 'C:\Users\noahl\Downloads\TikTok-Reddit-Text-To-Speech-Fix-GetVoices-bug\RedditTextToSpeech.Presentation\bin\Debug\net6.0\cadabefd-a689-481c-927a-d340d7921027.mp4' with working directory 'C:\Users\noahl'. The file could not be found
   at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at Program.<Main>$(String[] args) in C:\Users\noahl\Downloads\TikTok-Reddit-Text-To-Speech-Fix-GetVoices-bug\RedditTextToSpeech.Presentation\Program.cs:line 58
   at Program.<Main>(String[] args)
sebheron commented 2 years ago

Unhandled exception. System.ComponentModel.Win32Exception (2): An error occurred trying to start process 'C:\Users\noahl\Downloads\TikTok-Reddit-Text-To-Speech-Fix-GetVoices-bug\RedditTextToSpeech.Presentation\bin\Debug\net6.0\cadabefd-a689-481c-927a-d340d7921027.mp4' with working directory 'C:\Users\noahl'. The file could not be found

Ok so its trying to start the file as a process, but is looking in the wrong directory. I'm really hoping I've fixed it now 😅

noahesbjerg commented 2 years ago

Unhandled exception. System.ComponentModel.Win32Exception (2): An error occurred trying to start process 'C:\Users\noahl\Downloads\TikTok-Reddit-Text-To-Speech-Fix-GetVoices-bug\RedditTextToSpeech.Presentation\bin\Debug\net6.0\cadabefd-a689-481c-927a-d340d7921027.mp4' with working directory 'C:\Users\noahl'. The file could not be found

Ok so its trying to start the file as a process, but is looking in the wrong directory. I'm really hoping I've fixed it now 😅

I still ge the same error. At least it actually created the .wav and .png files in the correct directory now. But I still get the exact same error:

ffmpeg version 2022-02-17-git-2812508086-full_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 11.2.0 (Rev7, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      57. 21.100 / 57. 21.100
  libavcodec     59. 21.100 / 59. 21.100
  libavformat    59. 17.102 / 59. 17.102
  libavdevice    59.  5.100 / 59.  5.100
  libavfilter     8. 27.100 /  8. 27.100
  libswscale      6.  5.100 /  6.  5.100
  libswresample   4.  4.100 /  4.  4.100
  libpostproc    56.  4.100 / 56.  4.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\Users\noahl\Downloads\TikTok-Reddit-Text-To-Speech-Fix-GetVoices-bug\RedditTextToSpeech.Presentation\bin\Debug\net6.0\background.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2021-07-01T12:37:08.000000Z
  Duration: 00:34:50.03, start: 0.000000, bitrate: 1583 kb/s
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 1453 kb/s, 29.97 fps, 29.97 tbr, 11988 tbn (default)
    Metadata:
      creation_time   : 2021-07-01T12:37:08.000000Z
      handler_name    : ISO Media file produced by Google Inc. Created on: 07/01/2021.
      vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      creation_time   : 2021-07-01T12:37:08.000000Z
      handler_name    : ISO Media file produced by Google Inc. Created on: 07/01/2021.
      vendor_id       : [0][0][0][0]
Output #0, mp4, to 'C:\Users\noahl\743317a1-791b-49e0-b409-520cb9ce6462.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    encoder         : Lavf59.17.102
  Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 1453 kb/s, 29.97 fps, 29.97 tbr, 11988 tbn (default)
    Metadata:
      creation_time   : 2021-07-01T12:37:08.000000Z
      handler_name    : ISO Media file produced by Google Inc. Created on: 07/01/2021.
      vendor_id       : [0][0][0][0]
  Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      creation_time   : 2021-07-01T12:37:08.000000Z
      handler_name    : ISO Media file produced by Google Inc. Created on: 07/01/2021.
      vendor_id       : [0][0][0][0]
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=   86 fps=0.0 q=-1.0 Lsize=     477kB time=00:00:02.83 bitrate=1379.8kbits/s speed=1.63e+03x
video:428kB audio:45kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.864153%
ffmpeg version 2022-02-17-git-2812508086-full_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 11.2.0 (Rev7, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      57. 21.100 / 57. 21.100
  libavcodec     59. 21.100 / 59. 21.100
  libavformat    59. 17.102 / 59. 17.102
  libavdevice    59.  5.100 / 59.  5.100
  libavfilter     8. 27.100 /  8. 27.100
  libswscale      6.  5.100 /  6.  5.100
  libswresample   4.  4.100 /  4.  4.100
  libpostproc    56.  4.100 / 56.  4.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\Users\noahl\743317a1-791b-49e0-b409-520cb9ce6462.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf59.17.102
  Duration: 00:00:03.00, start: 0.000000, bitrate: 1301 kb/s
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 1223 kb/s, 29.97 fps, 29.97 tbr, 11988 tbn (default)
    Metadata:
      handler_name    : ISO Media file produced by Google Inc. Created on: 07/01/2021.
      vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 129 kb/s (default)
    Metadata:
      handler_name    : ISO Media file produced by Google Inc. Created on: 07/01/2021.
      vendor_id       : [0][0][0][0]
Input #1, png_pipe, from 'C:\Users\noahl\a90771e6-3b64-4028-9ccc-f56b9623ff2b.png':
  Duration: N/A, bitrate: N/A
  Stream #1:0: Video: png, rgba(pc), 410x63 [SAR 3779:3779 DAR 410:63], 25 fps, 25 tbr, 25 tbn
Guessed Channel Layout for Input Stream #2.0 : mono
Input #2, wav, from 'C:\Users\noahl\a8de8b29-0b05-484b-b859-d5f573ae6a56.wav':
  Duration: 00:00:02.32, bitrate: 512 kb/s
  Stream #2:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 32000 Hz, mono, s16, 512 kb/s
[overlay @ 00000253a3ee8d40] [Eval @ 0000008e0d7fefb0] Missing ')' or too many args in 'between(t,0,2,8195)'
[overlay @ 00000253a3ee8d40] Error when evaluating the expression 'between(t,0,2,8195)' for enable
[AVFilterGraph @ 00000253a47c5700] Error initializing filter 'overlay' with args '(main_w-overlay_w)/2:(main_h-overlay_h)/2:enable = between(t,0,2,8195)'
Error initializing complex filters.
Invalid argument
Unhandled exception. System.ComponentModel.Win32Exception (2): An error occurred trying to start process 'C:\Users\noahl\b8fbe3ac-5106-4c7f-ad43-d420be367f47.mp4' with working directory 'C:\Users\noahl'. The file could not be found
   at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at Program.<Main>$(String[] args) in C:\Users\noahl\Downloads\TikTok-Reddit-Text-To-Speech-Fix-GetVoices-bug\RedditTextToSpeech.Presentation\Program.cs:line 58
   at Program.<Main>(String[] args)

But yeah, it looks like it is creating the mp4 file in the correct directory, but it is trying to open the file from my users directory instead.....

sebheron commented 2 years ago

Missing ')' or too many args in 'between(t,0,2,8195)'

This seems to be the actual issue. The decimal point is coming out as a comma, this might be able to be fixed by forcing the program to use a US language culture? I've tried to add this, honestly not sure if it will work, but it might :)

noahesbjerg commented 2 years ago

Missing ')' or too many args in 'between(t,0,2,8195)'

This seems to be the actual issue. The decimal point is coming out as a comma, this might be able to be fixed by forcing the program to use a US language culture? I've tried to add this, honestly not sure if it will work, but it might :)

Yep, that fixed it. And all those issues, just because I am using a Danish language pack 😂 I'll close the issue now. Cheers. You should just be able to merge this into the master branch now.