citron2010's Forum Posts

  • I was just trying that to see what happened because:

    Also results in "EncodingError: Unable to decode audio data"

  • That’s what I’ve tried – both:

    • AJAX Set Response to BinaryData
    • BinaryData Set buffer to UTF-8 text AJAX.LastData

    (Which I believe are equivalent)

    If I then download it, I can see some relevant headers when opened in a text editor, but can’t play it in e.g. VLC. And Audio –> Add remote URL = BinaryData.GetURL -> Play returns “EncodingError: Unable to decode audio data”

    I’ve been working with ChatGPT on this and it gave me some JavaScript which sends the request, successfully plays the response and sets a var to the URL of the response. When that URL is then used in Audio – Add remote URL, it DOES work.

    My ultimate aim is to use the Audio Analyser effect to animate a sprite (to sync lip animation), so this approach works, but agree that it _should_ work using native C3 events.

    This is ChatGPT's JavaScript:

    fetch("https://api.elevenlabs.io/v1/text-to-speech/fexRy0lZ3HSLmYNrlI0v?output_format=mp3_44100_128", {
     method: "POST",
     headers: {
     "xi-api-key": "<my_secret_key",
     "Content-Type": "application/json"
     },
     body: JSON.stringify({
     text: "Construct 3 Rocks.",
     model_id: "eleven_multilingual_v2"
     })
    })
    .then(response => response.blob())
    .then(blob => {
     const audioURL = URL.createObjectURL(blob);
    
     // OPTION A: Play using JS
     const audio = new Audio(audioURL);
     audio.play().then(() => console.log("Audio is playing")).catch(console.error);
    
     // OPTION B: Pass to Construct's Audio plugin
     runtime.globalVars.AudioDataURL = audioURL; // You must create this global text variable
    })
    .catch(err => {
     console.error("Failed to fetch ElevenLabs audio:", err);
    });
  • Unfortunately they don't provide a URL - just audio to download in one of a myriad of formats! It's this API:

    elevenlabs.io/docs/api-reference/text-to-speech/convert

    I'll keep experimenting, because it IS returning something!

  • Hi,

    I’m trying to use Eleven Labs text-to-speech API to generate and then play MP3s.

    I request in their default format – “output_format=mp3_44100_128” using an AJAX request.

    But I’m not sure how to play it.

    I’m assuming I need to pass it to a Binary Data object first and have tried:

    • BinaryData – set from base64 (this produces no data)
    • AJAX – Set response binary -> Destination = BinaryData (also produces no data)
    • BinaryData – set from text (this does produce data)

    (If I download this via Browser – Invoke Download for string = BinaryData.GetAllText, MIME type = “audio/mpeg), it downloads something, but it won’t play)

    I’ve then tried:

    • Audio – Add remote URL = BinaryData (type = audio/mpeg) and added a tag
    • Audio – play tag

    But this returns:

    Failed to load audio 'blob:https://preview.construct.net/<some UID>': EncodingError: Unable to decode audio data

    Any ideas? I don’t really want to use JavaScript but importantly, I need to be able to use C3’s effects – specifically the audio analyser so I can animate a sprite based on the audio’s level.

  • I'm doing something very similar and agree with dop2000 that having slightly higher gravity would look better.

    But the other thing I did was move the image point that I'm applying the force too so that it's off centre, so when the force is applied, the parts rotate more.

  • It's hard to diagnose from just those screenshots, but one way to troubleshoot would be to write the animation's name, frame & position to an on-screen text box every tick. Then record the issue and play it back in slow motion to see exactly what's happening. Or you could use the debugger to step through the animation and view those parameters in the inspector.

  • Do you have details of this bug? Sounds rather worrying!

  • On a similar note, is there any way to change the column widths (i.e. the event or actions columns)?

  • Don't see why the physics behaviour couldn't be used for this - but you would need to experiment with the gravity and falling objects' elasticity and possibly their density, friction, & linear/angular damping.

  • You can't do this using "On key pressed" but you can using "Is key down".

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • See the "Using BBCode" section in the manual:

    construct.net/en/make-games/manuals/construct-3/plugin-reference/text

    There's also a linked example project.

  • pick all fam_paws appears to be redundant. I guess you've tried without that?

  • This has been discussed before - hope it helps:

    construct.net/en/forum/construct-3/how-do-i-8/force-mobileiap-landscape-mode-182185

  • When your project starts, hiscore is zero and you overwrite what's in local storage with that before you've tried loading the value that was previously stored.

    Notice in the YouTube video that the condition for event 2 is "Score > BestScore" whereas yours is "On start of layout"

  • Your project has some important differences from that YouTube one. I've explained above your problem as best I can but without understanding what you're trying to achieve having two layouts using the same event sheet, I can't really help any more.