• Trill
  • I want to play a wav file to the end without interruption.

max
Thank you for your prompt reply. I followed your instructions and was able to play the wav file all the way through. Thank you very much. However, my goal is to not get the value of the touch in trill craft until the wav file is done playing and not to play the same wav file sound. With the improved patch, if I touch the sensor again while the wav file is playing, the sound of the wav file will sound over the wav file. Is there any remedy for this?

You demonstrated how to calculate the length of the soundfile. now you can suppress any further start signal in this time frame with the help of the [spigot] object. If the Soundfile is 2 seconds it would be somewhat like this:

Beware of fanning outlets like this, this is a recipe for error.

If two connections are made from the same object, they will be executed in the order they were created. Since you don't see this any more they become ambiguous. Please always use the [trigger] object to make the execution order explicit. In your patch this issue is there 3 times. After the numberbox 0, after the [i] (better use an [f] actually) , and lastly after the [/ 44] (did you mean to write [/ 44.1] there?).

    max
    Thank you for your response.
    It is difficult for me and I have not been able to solve the problem yet, but I will give it some more thought.

    23 days later

    max

    I am now looking like the attached photo based on what you have told me. If I disconnect [route 1 0] and the second connection [playAudioFile~] the wav file plays to the end but loops forever, if I disconnect the second connection no other sounds are played for 7 seconds but the wav file only plays for as long as the threshold is exceeded.

    You might want to simplify the soundfile playback abstraction until you understand how it works. Simplest object to play back a soundfile is [readsf~]. If that works you can rebuild it, so that the samples are preloaded to memory (in an array) and then play it back with [tabplay~].

      6 days later

      if i understand correctly, you're now blocking any incoming triggers for as long as the file is playing.
      but you need to stop the file from playing once it's done, correct?

      so from the delay output, i think you don't only want to re-open the spigot for future triggers (correct time elapsed),
      you also want to stop the Audio file playback to prevent the looping first.

      so from delay, add trigger object which first bangs the middle playAudioFile input to stop playback, and then bangs the 1 on the spigot like before.

        Remork
        Thank you for your advice. Thanks to you, we are gradually approaching our goal.

          10 days later

          giuliomoro
          This is because, after considering versatile hardware, microcontrollers that run on c++ are also candidates for use.