Преглед изворни кода

Squashed 'text2sam/' changes from 2917d02ea..2110229bb

2110229bb fix catalog versions
53f6f33b9 Proper fap_descriptions
39a756b59 Screenshots
a055bce74 categories part 1
af60bd27a Fixes for various apps. swd_probe: untested
e035b0ebc more manifestos, xbox controller and videopoker ufbt fixes
a89fe9821 API 31 / unzip sources
REVERT: 2917d02ea Merge pull request #1 from Willy-JL/main
REVERT: bee71e876 Simplify app, play on clicking save without exiting
REVERT: 12de385e1 Message actually saves on exit (sam.txt)
REVERT: 70f5f8d38 Update README.md
REVERT: 55f23824d Change underscore to space \o/
REVERT: 469b1bcfd Update application.fam
REVERT: 9f2048b46 Add files via upload

git-subtree-dir: text2sam
git-subtree-split: 2110229bbfd233f3fe164250764278ed1d89fe89
Willy-JL пре 2 година
родитељ
комит
a78c2dd124
4 измењених фајлова са 10 додато и 6 уклоњено
  1. 1 0
      README-catalog.md
  2. 5 1
      application.fam
  3. BIN
      img/1.png
  4. 4 5
      stm32_sam.cpp

+ 1 - 0
README-catalog.md

@@ -0,0 +1 @@
+A simple app that converts your text to speech. Run the app, type your text using the keyboard, and press the "Save" button—Flipper Zero will play back the text in audible form.

+ 5 - 1
application.fam

@@ -12,6 +12,10 @@ App(
     stack_size=4 * 1024,
     # stack_size=2 * 1024,
     fap_icon="icon.png",
-    fap_category="",
+    fap_category="Media",
     order=20,
+    fap_author="@Round-Pi & (Fixes by @Willy-JL)",
+    fap_weburl="https://github.com/Round-Pi/flipperzero-text2sam",
+    fap_version="1.2",
+    fap_description="Convert text to speech on your Flipper Zero with SAM (Software Automatic Mouth).",
 )


+ 4 - 5
stm32_sam.cpp

@@ -5400,15 +5400,14 @@ void STM32SAM::sam(
         }
     }
 
+    if(i < 256) {
+        input[i] = phonetic ? '\x9b' : '[';
+    }
+
     if(!phonetic) {
-        strncat(input, "[", 256);
         if(!TextToPhonemes((unsigned char*)input)) {
-            // PrintUsage();
             return;
         }
-
-    } else {
-        strncat(input, "\x9b", 256);
     }
 
     SetInput(input);