We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

About adding ended puzzle function to audio

Home Forums Puzzles About adding ended puzzle function to audio

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #79030
    nsxdjx
    Participant

    When I need to stop the animation event after processing the audio playback, I only see play, pause, stop in the puzzle. Why is there no ended? Can you add corresponding functions?

    #79031
    nsxdjx
    Participant

    When I need to stop the animation event after processing the audio playback, I only see play, pause, stop in the puzzle. Why is there no ended? Can you add corresponding functions?

    #79033
    xeon
    Customer

    You can use the IsPlaying puzzle to check if the audio is still playing back and if not then do some action. You can also attach an isPlaying to a DoWhile loop if needed.

    Xeon
    Route 66 Digital
    Interactive Solutions - https://www.r66d.com
    Tutorials - https://www.xeons3dlab.com

    #79035
    nsxdjx
    Participant

    IsPlaying puzzle can check whether the audio is still playing, but it needs to loop continuously to judge, which will consume a lot of resources

    #79036
    kdv
    Participant

    When I need to stop the animation event after processing the audio playback

    get duration, use a timer. logic is very simple in your case…

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #79041
    nsxdjx
    Participant

    HI KDV:
    Using get duration sound is indeed another solution, but it has a drawback that when the audio is not playing, it is impossible to obtain the audio duration in advance. The console prints NaN, but if the audio is played once, it is indeed effective.Please take a look at the puzzle below:

    Attachments:
    You must be logged in to view attached files.
    #79044
    kdv
    Participant

    Please take a look at the puzzle below

    yes, it won’t work this way. Your sound should be loaded beforehand to read its duration.

    https://youtu.be/trbKz-nPda0

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #79047
    nsxdjx
    Participant

    HI KDV:Your reply is a pure black background image, I didn’t see the content

    #79048
    nsxdjx
    Participant

    HI KDV:I have seen your YouTube reply video. Thank you for your reply. My audio path and audio name are both variable concatenation, and the read audio file is also uncertain because it is not one audio, but many. So we cannot load all the audio as you demonstrated, and we need to determine which audio duration it is. If we add the ended feature in the new version, it will simplify many steps and increase the amount of code. My puzzle is as follows:

    Attachments:
    You must be logged in to view attached files.
    #79052
    kdv
    Participant

    I have seen your YouTube reply video

    but you didn’t see the point (the procedure is repeated until it gets a sound’s duration and only after that the sound will be started. it will take max 0.1 sec). and no, your puzzles won’t work as you wish.

    You now have three options: think and use logic to create a universal procedure to play your sounds (everything you need is in that example); hire somebody to do the job; wait for the grass to grow.

    Improved variant of puzzles. Logic is really simple.

    https://youtu.be/nQyCq4eEzqQ

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #79064
    nsxdjx
    Participant

    HI KDV:Thank you for your patient reply. I have carefully reviewed your puzzle and implemented it in my project, but there is one issue that prevents me from achieving the final goal. If an audio is reloaded and replaced during playback, that is, when the duration changes, the after duration second timer needs to be reset and restarted. However, when the after second timer starts, the variable duration inside will not update or change. This means that the lack of an ended feature has led to a series of new issues and an increase in code volume. My puzzle is as follows

    • This reply was modified 1 day, 23 hours ago by nsxdjx.
    Attachments:
    You must be logged in to view attached files.
    #79074
    kdv
    Participant

    second timer needs to be reset and restarted

    Repalce this puzzle by this puzzle

    https://youtu.be/IjT4VnxrBtQ

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #79075
    nsxdjx
    Participant

    HI KDV:Can you share your puzzle and see where the remove timer has been added。

    #79076
    kdv
    Participant

    the “remove timer” puzzle was not used (it’s not needed). just replace the “after” puzzle with the “set timer” puzzle.

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #79077
    nsxdjx
    Participant

    The problem has been solved, thank you kdv

Viewing 15 posts - 1 through 15 (of 16 total)
  • You must be logged in to reply to this topic.