Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Error/Bug
    4. [gelöst] BUG: sayit funktioniert bei win nicht zuverlässig.

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    UNSOLVED [gelöst] BUG: sayit funktioniert bei win nicht zuverlässig.

    This topic has been deleted. Only users with topic management privileges can see it.
    • apollon77
      apollon77 @bahnuhr last edited by apollon77

      @bahnuhr sagte in BUG: sayit funktioniert unter win nicht zuverlässig.:

      Copied

      Das wird über einen Stream gemacht ... und mit genau denen hatten wir bei Windows schonmal Probleme beim Logging.

      Update nochmal ... ich hab mal jetzt copyFile von nodejs verwendet ... gibts aber erst ab nodejs 8, aber da sist jetzt EOL ... also braucht nodejs 8.5+ dann jetzt!

      sigi234 1 Reply Last reply Reply Quote 1
      • bahnuhr
        bahnuhr Forum Testing Most Active last edited by

        @apollon77
        Hallo,

        sayit.2	2020-07-28 15:07:58.410	debug	(6764) Duration "test 1 2 3": 3
        sayit.2	2020-07-28 15:07:58.404	info	(6764) saying: test 1 2 3
        sayit.2	2020-07-28 15:07:31.935	debug	(6764) Duration "test 1 2 3": 3
        sayit.2	2020-07-28 15:07:31.933	info	(6764) Copied file "C:\iobroker\iobroker-data\sayit/sayit.2.say.mp3" to "C:\iobroker\cache\05b3c89f93969b153a9d5d986b7ec4ab.mp3"
        sayit.2	2020-07-28 15:07:31.933	debug	(6764) Caching File C:\iobroker\cache\05b3c89f93969b153a9d5d986b7ec4ab.mp3 for "de-DE_CLOUD_Female;test 1 2 3" now
        sayit.2	2020-07-28 15:07:31.931	debug	(6764) Status code: 200
        sayit.2	2020-07-28 15:07:31.752	debug	(6764) Cache File C:\iobroker\cache\05b3c89f93969b153a9d5d986b7ec4ab.mp3 for "de-DE_CLOUD_Female;test 1 2 3" not found
        sayit.2	2020-07-28 15:07:31.752	info	(6764) saying: test 1 2 3
        sayit.2	2020-07-28 15:07:11.130	debug	(6764) Duration "test abcdef": 2
        sayit.2	2020-07-28 15:07:11.128	info	(6764) Copied file "C:\iobroker\iobroker-data\sayit/sayit.2.say.mp3" to "C:\iobroker\cache\aa7106ec4140aa0958c7214f7e202a02.mp3"
        sayit.2	2020-07-28 15:07:11.125	debug	(6764) Caching File C:\iobroker\cache\aa7106ec4140aa0958c7214f7e202a02.mp3 for "de-DE_CLOUD_Female;test abcdef" now
        sayit.2	2020-07-28 15:07:11.120	debug	(6764) Status code: 200
        sayit.2	2020-07-28 15:07:10.899	debug	(6764) Cache File C:\iobroker\cache\aa7106ec4140aa0958c7214f7e202a02.mp3 for "de-DE_CLOUD_Female;test abcdef" not found
        sayit.2	2020-07-28 15:07:10.899	info	(6764) saying: test abcdef
        

        Log sieht vergleichbar aus.
        Kann es sein, wenn man den gleichen Befehl nochmal sendet, dass dann der copy Befehl nicht kommt.
        Siehe log ganz oben.

        1 Reply Last reply Reply Quote 0
        • sigi234
          sigi234 Forum Testing Most Active @apollon77 last edited by

          @apollon77

          Geht jetzt bei mir.

          sayit.0	2020-07-28 15:06:58.078	info	(11460) Copied file "C:\Program Files\iobroker\Test\iobroker-data\sayit/sayit.0.say.mp3" to "C:\Program Files\iobroker\Test\cache\d72f7f703b392c5f75121b51ee14540e.mp3"
          
          bahnuhr 1 Reply Last reply Reply Quote 0
          • bahnuhr
            bahnuhr Forum Testing Most Active @sigi234 last edited by

            @sigi234 sagte in BUG: sayit funktioniert unter win nicht zuverlässig.:

            Geht jetzt bei mir.

            Ging doch vorher auch schon bei dir 😉

            sigi234 1 Reply Last reply Reply Quote 0
            • sigi234
              sigi234 Forum Testing Most Active @bahnuhr last edited by sigi234

              @bahnuhr sagte in BUG: sayit funktioniert unter win nicht zuverlässig.:

              @sigi234 sagte in BUG: sayit funktioniert unter win nicht zuverlässig.:

              Geht jetzt bei mir.

              Ging doch vorher auch schon bei dir 😉

              Ansage ja, File wurde aber nicht in den Ordner sayit geschrieben

              1 Reply Last reply Reply Quote 0
              • bahnuhr
                bahnuhr Forum Testing Most Active last edited by

                @sigi234 sagte in BUG: sayit funktioniert unter win nicht zuverlässig.:

                @bahnuhr sagte in BUG: sayit funktioniert unter win nicht zuverlässig.:

                @sigi234 sagte in BUG: sayit funktioniert unter win nicht zuverlässig.:

                Geht jetzt bei mir.

                Ging doch vorher auch schon bei dir 😉

                Ansage ja, File wurde nicht in den Ordner sayit geschrieben

                Supi, ich werde das mal weiter beobachten und heute abend damit ein bisschen rumspielen.
                Mal schauen ob es immer klappt.

                1 Reply Last reply Reply Quote 0
                • bahnuhr
                  bahnuhr Forum Testing Most Active last edited by

                  noch ne Frage:

                  Bei Objekt: sayit.2.tts.mp3
                  ist ein Link genannt; der bei klick die mp3 abspielt.

                  Kann man diesen Link auch per Script irgendwie als Datei (also die mp3) speichern?

                  Wäre ja dann auch eine Möglichkeit an die mp3 zu kommen.

                  apollon77 1 Reply Last reply Reply Quote 0
                  • bahnuhr
                    bahnuhr Forum Testing Most Active last edited by bahnuhr

                    ach, mist auch:

                    jetzt hab ichs wieder:

                    sayit.2	2020-07-28 15:17:01.239	debug	(6764) Duration "testxyz": 0
                    sayit.2	2020-07-28 15:17:01.239	error	(6764) File error: Error: EBUSY: resource busy or locked, open 'C:\iobroker\iobroker-data\sayit/sayit.2.say.mp3'
                    sayit.2	2020-07-28 15:16:59.902	debug	(6764) Status code: 200
                    sayit.2	2020-07-28 15:16:59.697	debug	(6764) Cache File C:\iobroker\cache\107eab35c9bd3e4d332655f0ea83ab40.mp3 for "de-DE_CLOUD_Female;testxyz" not found
                    sayit.2	2020-07-28 15:16:59.697	info	(6764) saying: testxyz
                    

                    Ich hatte mal wmp angeklickt.
                    Vielleicht hat wmp die Datei geblockt.

                    1 Reply Last reply Reply Quote 0
                    • apollon77
                      apollon77 @bahnuhr last edited by

                      @bahnuhr Hm ... vllt kopiert er nicht wenn er ein gecachtes File nutzt ... ich schaue mal

                      1 Reply Last reply Reply Quote 0
                      • apollon77
                        apollon77 last edited by

                        Ääähm ja genau ... Das Copy file" macht er nur um das Ergebnisfile in den Cache zu kopieren das man nicht jedes mal beim gleichen Text das File neu generieren muss.

                        AM End eist die Grundfrage ob da nicht ein gewisses Missverständnis herrscht: Ich glaube das C:\iobroker\iobroker-data\sayit/sayit.2.say.mp3 file ist nie wirklich dazu gedacht genutzt zu werden oder?! Da sist nur ein "Intermediate" FIle und wird ausgegeben. Sonst wird das gecachte File ausgegeben ...

                        bahnuhr 1 Reply Last reply Reply Quote 0
                        • bahnuhr
                          bahnuhr Forum Testing Most Active @apollon77 last edited by

                          @apollon77 sagte in BUG: sayit funktioniert unter win nicht zuverlässig.:

                          Ääähm ja genau ... Das Copy file" macht er nur um das Ergebnisfile in den Cache zu kopieren das man nicht jedes mal beim gleichen Text das File neu generieren muss.

                          Kann man das ändern; und zwar so, dass das mp3 immer erzeugt wird.

                          Habe festgestellt, dass das mp3 auch nicht erzeugt wird, wenn der gleiche Text etwas zurück liegt; und nicht wie gedacht nur das letzte mal.

                          apollon77 1 Reply Last reply Reply Quote 0
                          • apollon77
                            apollon77 @bahnuhr last edited by

                            @bahnuhr Ok, dann nochmal: Was willst Du mit exakt diesem File tun? Warum sollte es da sein? Ich glaube wirklich das es um ein fundamentales Missverständnis geht wie der Adapter funktionieren soll.

                            Der Adapter ist quasi zweigeteilt:
                            1.) Text to Speech File ... also ein MP3 (nicht unbediengt das sondern ggf auch ein gecachtes auswählen
                            2.) Ausgabe der Datei. Hier landet es in einem Binary State und wird ggf im browser, per mpd oder Sonos oder whatever ausgegeben.

                            An sich musst Du nicht an das File ran - und wenn ist denke der saubere Weg es sich aus dem State zu holen.

                            bahnuhr 1 Reply Last reply Reply Quote 0
                            • bahnuhr
                              bahnuhr Forum Testing Most Active @apollon77 last edited by

                              @apollon77 sagte in BUG: sayit funktioniert unter win nicht zuverlässig.:

                              Was willst Du mit exakt diesem File tun?

                              Hatte ich oben schon geschrieben.
                              Ich möchte eine mp3 kopieren um Sie dann Yamaha musiccast zur Verfügung zu stellen.
                              Also: Ansage eines Textes über Yamaha Lautsprecher.

                              Dies funktioniert auch soweit. Nur brauche ich halt zuverlässig die mp3.

                              @apollon77 sagte in BUG: sayit funktioniert unter win nicht zuverlässig.:

                              denke der saubere Weg es sich aus dem State zu holen.

                              Ok, das wäre doch ein Weg. (Du meinst doch dieses Objekt, oder ?: sayit.2.tts.mp3)
                              Kannst du mir sagen, wie man dies macht. Wenn ich auf den State klicke wird die Datei ja wiedergegeben.
                              Als konkrete Frage:
                              Wie speichere ich den Statte als mp3?

                              mfg
                              Dieter

                              sigi234 1 Reply Last reply Reply Quote 0
                              • sigi234
                                sigi234 Forum Testing Most Active @bahnuhr last edited by

                                @bahnuhr sagte in BUG: sayit funktioniert unter win nicht zuverlässig.:

                                Also: Ansage eines Textes über Yamaha Lautsprecher.

                                Geht das nicht direkt via XML Command?
                                Welchen Yamaha Lautsprecher hast du?

                                bahnuhr 1 Reply Last reply Reply Quote 0
                                • bahnuhr
                                  bahnuhr Forum Testing Most Active @sigi234 last edited by

                                  @sigi234 sagte in BUG: sayit funktioniert unter win nicht zuverlässig.:

                                  @bahnuhr sagte in BUG: sayit funktioniert unter win nicht zuverlässig.:

                                  Also: Ansage eines Textes über Yamaha Lautsprecher.

                                  Geht das nicht direkt via XML Command?
                                  Welchen Yamaha Lautsprecher hast du?

                                  Text vielleicht.
                                  Sound nein.

                                  Lautsprecher: 10, 20, 30

                                  F 1 Reply Last reply Reply Quote 0
                                  • F
                                    fastfoot @bahnuhr last edited by

                                    @bahnuhr sagte in BUG: sayit funktioniert unter win nicht zuverlässig.:

                                    Wie speichere ich den Statte als mp3?

                                    evtl. musst du noch den timeout anpassen, je nach Länge deines Textes

                                    const fs = require('fs');
                                    const url = 'http://ip:8082/state/sayit.0.tts.mp3';
                                    const outfile = './Test.mp3';
                                    setState('sayit.0.tts.text','Hallo, dies ist ein ziemlich unnützer Text');
                                    setTimeout(function(){
                                        request(url, {encoding:'binary'}, function(error, response, body) {
                                            fs.writeFile(outfile, body, 'binary', function (err) {
                                                if(err) log('Fehler!');
                                            });                
                                        });
                                    }, 2000);
                                    
                                    bahnuhr F 2 Replies Last reply Reply Quote 1
                                    • bahnuhr
                                      bahnuhr Forum Testing Most Active @fastfoot last edited by

                                      @fastfoot sagte in BUG: sayit funktioniert unter win nicht zuverlässig.:

                                      @bahnuhr sagte in BUG: sayit funktioniert unter win nicht zuverlässig.:

                                      Wie speichere ich den Statte als mp3?

                                      evtl. musst du noch den timeout anpassen, je nach Länge deines Textes

                                      const fs = require('fs');
                                      const url = 'http://ip:8082/state/sayit.0.tts.mp3';
                                      const outfile = './Test.mp3';
                                      setState('sayit.0.tts.text','Hallo, dies ist ein ziemlich unnützer Text');
                                      setTimeout(function(){
                                          request(url, {encoding:'binary'}, function(error, response, body) {
                                              fs.writeFile(outfile, body, 'binary', function (err) {
                                                  if(err) log('Fehler!');
                                              });                
                                          });
                                      }, 2000);
                                      

                                      Super,cool.
                                      Das probier ich heute abend gleich aus.
                                      Danke.

                                      F 1 Reply Last reply Reply Quote 0
                                      • F
                                        fastfoot @fastfoot last edited by

                                        @fastfoot sagte in BUG: sayit funktioniert unter win nicht zuverlässig.:

                                        evtl. musst du noch den timeout anpassen, je nach Länge deines Textes

                                        hier noch eine Version für die Blockly Fraktion
                                        Sayit.PNG

                                        <xml xmlns="https://developers.google.com/blockly/xml">
                                         <variables>
                                           <variable id="W~_^HE%Iga5n.*fPdW;B">outfile</variable>
                                           <variable id="z_pVL7.qbcGrbBrmTenF">url</variable>
                                           <variable id="]^eO7?rtWHTfOD)d{,je">cmd</variable>
                                           <variable type="timeout" id="timeout">timeout</variable>
                                         </variables>
                                         <block type="variables_set" id="K!1=]xXNLcV%_;O8_moY" x="45" y="78">
                                           <field name="VAR" id="W~_^HE%Iga5n.*fPdW;B">outfile</field>
                                           <value name="VALUE">
                                             <block type="text" id="D~q[!co?DcpN8GJ^Gm]E">
                                               <field name="TEXT">./tst.mp3</field>
                                             </block>
                                           </value>
                                           <next>
                                             <block type="variables_set" id="UbHJQ7(P?2U*Y39|s_wx">
                                               <field name="VAR" id="z_pVL7.qbcGrbBrmTenF">url</field>
                                               <value name="VALUE">
                                                 <block type="text" id="Y9N`m/ks7.Lh^~NFl{`)">
                                                   <field name="TEXT">localhost:8082/state/sayit.0.tts.mp3</field>
                                                 </block>
                                               </value>
                                               <next>
                                                 <block type="variables_set" id="!Rv8i+YxzgFe|-!vV43%">
                                                   <field name="VAR" id="]^eO7?rtWHTfOD)d{,je">cmd</field>
                                                   <value name="VALUE">
                                                     <block type="text_join" id="mPNwYvTJ@8l:/Db*G*R2" inline="true">
                                                       <mutation items="4"></mutation>
                                                       <value name="ADD0">
                                                         <block type="text" id="L[7r6VHfZH5DFuXa:ssB">
                                                           <field name="TEXT">curl -sL </field>
                                                         </block>
                                                       </value>
                                                       <value name="ADD1">
                                                         <block type="variables_get" id="`$*khLv1k;:oTW]_f8Qv">
                                                           <field name="VAR" id="z_pVL7.qbcGrbBrmTenF">url</field>
                                                         </block>
                                                       </value>
                                                       <value name="ADD2">
                                                         <block type="text" id="4DPjK%Ap5|n:LQ^2C0t=">
                                                           <field name="TEXT"> &gt; </field>
                                                         </block>
                                                       </value>
                                                       <value name="ADD3">
                                                         <block type="variables_get" id="{x:z]6MCBt`v`$mRN?rh">
                                                           <field name="VAR" id="W~_^HE%Iga5n.*fPdW;B">outfile</field>
                                                         </block>
                                                       </value>
                                                     </block>
                                                   </value>
                                                   <next>
                                                     <block type="control" id="T9GI)E(k5$yyI;?/r;%?">
                                                       <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                       <field name="OID">sayit.0.tts.text</field>
                                                       <field name="WITH_DELAY">FALSE</field>
                                                       <value name="VALUE">
                                                         <block type="text" id="!}aB{aNW!yhWO|KPonc=">
                                                           <field name="TEXT">Hallo, dies ist ein echt unnützer Text</field>
                                                         </block>
                                                       </value>
                                                       <next>
                                                         <block type="timeouts_settimeout" id="se9)rFor]=weJDW=dYd%">
                                                           <field name="NAME">timeout</field>
                                                           <field name="DELAY">2000</field>
                                                           <field name="UNIT">ms</field>
                                                           <statement name="STATEMENT">
                                                             <block type="exec" id=";f7mWOxP)C:ATEQq=CCc">
                                                               <mutation xmlns="http://www.w3.org/1999/xhtml" with_statement="false"></mutation>
                                                               <field name="WITH_STATEMENT">FALSE</field>
                                                               <field name="LOG"></field>
                                                               <value name="COMMAND">
                                                                 <shadow type="text" id="u-?64-sg%3,3/7HCl.-r">
                                                                   <field name="TEXT"></field>
                                                                 </shadow>
                                                                 <block type="variables_get" id="[bCY$YRq2es63B$Q`NPQ">
                                                                   <field name="VAR" id="]^eO7?rtWHTfOD)d{,je">cmd</field>
                                                                 </block>
                                                               </value>
                                                             </block>
                                                           </statement>
                                                         </block>
                                                       </next>
                                                     </block>
                                                   </next>
                                                 </block>
                                               </next>
                                             </block>
                                           </next>
                                         </block>
                                        </xml>
                                        

                                        1 Reply Last reply Reply Quote 0
                                        • apollon77
                                          apollon77 last edited by

                                          ein getBinaryState ist denke einfacher als der http Request (ok macht am Ende das gleiche)

                                          bahnuhr 1 Reply Last reply Reply Quote 1
                                          • bahnuhr
                                            bahnuhr Forum Testing Most Active @apollon77 last edited by

                                            @apollon77 sagte in BUG: sayit funktioniert unter win nicht zuverlässig.:

                                            getBinaryState

                                            Gib uns mal ein Beispiel.

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            768
                                            Online

                                            31.9k
                                            Users

                                            80.1k
                                            Topics

                                            1.3m
                                            Posts

                                            bug sayit
                                            6
                                            95
                                            4608
                                            Loading More Posts
                                            • Oldest to Newest
                                            • Newest to Oldest
                                            • Most Votes
                                            Reply
                                            • Reply as topic
                                            Log in to reply
                                            Community
                                            Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                                            The ioBroker Community 2014-2023
                                            logo