John Cutter's Recent Forum Activity

  • Looks like this bug is closed, but I found THIS online:

    -----------------------------------------------------------------------------

    My question was: why does window.speechSynthesis.getVoices() return empty array, after page is loaded and onready function is triggered? As you can see if you click on the link, same function returns an array of available voices of Chrome by onclick triger?

    It seems Chrome loads window.speechSynthesis after the page load!

    The problem is not in ready event. If I remove the line var voice=... from ready function, for first click it shows empty list in console. But the second click works fine.

    It seems window.speechSynthesis needs more time to load after first call. You need to call it twice! But also, you need to wait and let it load before second call on window.speechSynthesis. For example, following code shows two empty arrays in console if you run it for first time:

    // First speechSynthesis call

    var voices = window.speechSynthesis.getVoices();

    console.log(voices);

    // Second speechSynthesis call

    voices = window.speechSynthesis.getVoices();

    console.log(voices);

  • Ashley: Usually, the first time I run the Speech Synthesis app on my iPhone or iPad the voices show up in the list box. But when I refresh the page the list doesn't populate. If I refresh it enough times (usually 5 to 8 or so) the list will appear again.

    Not sure if this helps but the French voice I need shows up like this: "fr-FR: Thomas (com.apple.ttsbundle.Thomas-compact)"

    My workaround is to look up the "platform" using the Browser object and then use the French voice that I manually set at design time. That seems to be working so far, but I need to get the platform name (and voice name) for Android and Mac.

  • I'm clearly struggling to understand C2's arrays. Here's how MY array looks in the debugger:

    0        [119,Pour,For,354]
    1        [125,Bonjour,Hello,128]
    2        [133,Comment,How,45]
    ..
    439      [450,Vingt,Twenty,235]
    [/code:1v028imz]
    
    Seems really straightforward.  There are 440 "rows" and each one I'm treating like a record.  The first column is a score, the second is a French word, the third is the English equivalent, and the last is my index.  Every 5 cards or so I sort everything by the score column.  That's all working great.
    
    But the C2 debugger reports an array WIDTH of 439 and a HEIGHT of 4.  So I guess I just have my vertices mixed up, right?
    
    In any event, I was able to get this working.  Thanks again for the help!
  • Thanks a lot dsminor. I really appreciate you taking the time to do that for me!

  • I have a 2 dimensional array with a width of 4 and a height of 438. (If I'm using those terms correctly, and I believe I am.) Imagine it looks something like this:

    [100,text,text,0]

    [124,text,text,1]

    [198,text,text,2]

    [113,text,text,3]

    [256,text,text,4]

    ...

    I have two variables called "over_100" and "under_100". How do I iterate through my array, row by row, and increment those two variables based on the data in the first column? (100, 124, 198, etc.)

    Another quick question: I've written a lot of stuff in Excel VBA over the years. Do C2's arrays work the same way? To iterate through a spreadsheet I use: "cells(row,col)" but I think that makes the height "x" and the width "y" which is backwards compared to C2, right?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Problem Description

    I'm working on a web app that uses speech synthesis. Unfortunately, the UserMedia function to add voices to a listbox does not work reliably on my iPad Plus or my iPhone 6+. (It only populates the list about 20% of the time.)

    Please not that this feature seems to work every time on my PC. I'm only having issues with my iOS devices.

    Attach a Capx

    To make sure it wasn't MY code causing the problem, I was using the "Speech Synthesis.capx" file in the Examples folder that comes with C2.

    Description of Capx

    The capx grabs a list of voices available on the device/browser and adds them to a listbox.

    Steps to Reproduce Bug

    • Go to my website using an iPhone 6+ or an iPad Plus (http://www.jmcdesign.orgfree.com).
    • Look at the voices in the listbox
    • Refresh the page over and over again (the listbox will frequently be empty)

    Observed Result

    The listbox is frequently empty when I reload the page. (About 75-80 percent of the time.)

    Expected Result

    The listbox should ALWAYS contain voices, so my users can choose an appropriate voice for their device.

    Affected Browsers

    I have seen similar results on both Safari and Chrome

    Operating System and Service Pack

    9.2.1

    Construct 2 Version ID

    r221 (64-bit)

  • My browser app includes speech synthesis which requires me to pick different "voices" depending on whether the user has a PC, an iPhone, an iPad, etc. The Browser object allows me to test for the platform ("Win32", "iPhone", or "iPad"), but I don't know what to use for Android. Does anyone know?

    NOTE: In a perfect world I would fill a list box with the voices available on the user's device, but this feature only seems to work reliably on PC. I'll enter a bug on that when I get some extra time.

  • I've been trying to wrap my head around the Local Storage object, but many of the tutorials only show how to save and retrieve a single value. But the asynchronous nature of this feature is the main thing throwing me for a loop -- at first I thought I had to request and retrieve values in sequence. Fortunately, last night I think it finally "clicked".

    This works, right? (I also need to check if the items exist and create them if they are missing, but I know how to do that.)

    [START GROUP]

    On start of layout:

      get item "player" get item "score" get item "sound"

    Set group "START GROUP" Deactivated

    [OPTIONS GROUP]

    On item "player" get

      System -> Set item global_player to localstorage.itemvalue

    On item "score" get

      System -> Set item global_score to localstorage.itemvalue

    On item "sound" get

      System -> Set item global_sound to localstorage.itemvalue

    I think I can even deactivate OPTIONS GROUP using "On All Gets Complete" right?

  • Nice game! Love the screen transition between levels. Very professional!

  • I apparently changed something and lost the event! Thanks for catching that ramones! It doesn't seem to be in perpetual "loading..." mode now! Will have to look at it some more tomorrow.

  • Well, Local Storage is working fine in Edge and Firefox, but still broken in Chrome. Unfortunately, those other two browsers don't support speech recognition OR speech synthesis... and I need those for my app so I have to get Chrome working again.

    Will try uninstalling Chrome and reinstalling it. Hopefully, that will work.

    UPDATE: Reinstalling Chrome was a failure. And to make matters worse Chrome is now ignoring the voice I picked for speech synthesis. It's trying to use an American voice for all my French words and phrases. (That feature has been working perfectly since day one -- not sure what changed.)

    I've been working on this app night and day for two solid weeks and I was just wrapping up the last few details today. Instead of taking a few small steps across the finish line I've taken two HUGE steps backward. Kind of frustrated at the moment...

    I'm pretty sure this is only a problem on MY computer, but here's my .capx file:

    http://jmcdesign.orgfree.com/BuggedStorage.capx

  • Thanks, Paradox. Tried renaming the app but that didn't work. In fact, I tried loading a version from a week ago and that isn't working now either.

    Went into Preferences and changed the Preview Browser to "Edge" but it's still using Google. (Finally got "Edge" working from the Project Properties. That's kind of confusing...)

    My Local Storage is fixed in "Edge"! Unfortunately, that browser doesn't support Speech Synthesis or Recognition... which I need. Downloading Firefox. Man, I hope I'm not locked out of Google for my previews. Seems like it's not going to work for *any* app or game I try to create... (Would uninstalling Chrome and re-installing it help? Guess there's one way to find out...)

John Cutter's avatar

John Cutter

Member since 11 Dec, 2015

None one is following John Cutter yet!

Connect with John Cutter