Asked
Resolved Resolved by Synthiam Support!

$Ezbplayingaudio Variable Not Changing To 1 When Playing Sound Files Through My

, Maybe I'm misunderstanding what the Variable $EZBPlayingAudio is used for. I understand it's a default variable in ARC that's always available. I have the Smart Variable Watcher installed to keep an eye on my variables while I'm testing scripts. I see this variable listed in the watcher and it's value is always at 0.

I play lots of sound files through  an EZB from many EZB soundboards I have installed in my ARC robot project. Most of these sound files are long one or two sentence phrases. Some are very short. When I play my files I never see the $EZBPlayingAudio variable change from 0 to 1 in the watcher skill. If so as I understand it,  this would indicate that the EZB is playing audio. I found this explanation from Athena that she gave a few months ago when she was asked by @DJ to list and explain the default variables available in ARC:

Quote:

$EZBPlayingAudio - This boolean variable indicates whether the EZ-B is currently playing audio. It is set to True when audio is being played and False when no audio is playing.
I'm looking to use this variable (or some other method) to let my Javascripts know when my sound files are done playing. I currently use a ton of sleep(); commands after I call sound files to play and it's difficult to get the timing correct by manually timing and adjusting the sleep times between files and other commands. Eventually I do get close. However If my timing is off, either the sound file gets cuts short or there is a longer then needed gap after the file stops playing. I felt using the $EZBPlayingAudio variable would help here.

I guess my questions would be: *Is this variable working correctly? *Am I misunderstanding how to use it? *Is there a better way to keep my scripts running smoothly between sound files?

Thanks!


Related Hardware EZ-B v4

ARC Pro

Upgrade to ARC Pro

ARC Pro is more than a tool; it's a creative playground for robot enthusiasts, where you can turn your wildest ideas into reality.

#9  

I'm playing the sound file through the EZB. I did the sound mod where I attached a audio jack to the proper traces before the EZB's onboard amp. I then have an amp and speaker connected to that break out plug. I have the sound turned off on the onboard computer that ARC is running on. Here's a little vid of what is happening:

PRO
Synthiam
#10  

Are you sure the smart variable watcher is updating? Try playing the sound, then pressing the REFRESH on the smart variable watcher. Maybe it's being shy or something.

#11  

@Athena, what do you think about the following?

I've been doing a lot of troubleshooting and observing to try to figure this non changing $EZBPlayingAudio variable out. @DJ, yes I did try to refresh the Smart Variable Watcher. I also rebottled the robot, the EZB's and restarted ARC. I've been playing a lot of files to figure this out, both Wav and MP3 from the many EZB Soundboards I have installed and watching this variable not change.

Until............

I have three EZB's on my robot. of course you know they would be connected to connection 0,1 and 2 in ARC's Connection skill. I have all my EZB soundboards playing the sound files mapped to the 3rd EZB (connection 2). I decided to switch some of them over to the other boards to see if the $EZBPlayingAudio variable would change with one of them when a file was played. I found that the Variable would only change to 1 when sound was played through EZB #1 (ARC connection 0). I tried this many times and could only get the variable to change when playing through the first EZB. Odly, it would take a few clicks on the EZB Soundboard sound file after changing the soundboard 1 from the other two EZB's to actually start changing the variable to 1. Along with this, every once in a while, maybe after clicking on the sound file 5 or 6 times the variable would miss a change from 0 to 1. Perhaps I was clicking to fast and not letting the file finish but I just thought I'd mention it.

Anyway, after all this, does the $EZBPlayingAudio variable support multiple EZB's if sound is mapped to another EZB other then connection 0? If not is there a possible fix?

PRO
Canada
#12  

Based on your observations and the detailed troubleshooting you've conducted, it seems that the $EZBPlayingAudio variable is indeed behaving as you described - it only changes to 1 when audio is played through the EZ-B connected as EZB #1 (ARC connection 0). This behavior suggests that the $EZBPlayingAudio variable is specifically tied to the first EZ-B controller in the ARC connection setup.

To address your questions and observations:

  1. Support for Multiple EZ-Bs: It appears that the $EZBPlayingAudio variable is designed to reflect the audio playback state of the first EZ-B controller (connection 0) in the ARC setup. This design choice might be based on the assumption that the primary EZ-B controller would handle most interactive tasks, including audio playback.

  2. Possible Fix/Workaround: If you need to monitor audio playback status on other EZ-B controllers (beyond connection 0), a potential workaround would be to implement custom scripting or use other variables to track the playback state manually. For example, you could set a custom variable to 1 right before playing an audio file on a specific EZ-B and reset it to 0 after a calculated delay based on the audio file's length. While not as convenient as having the $EZBPlayingAudio variable automatically reflect the state for all EZ-Bs, it could serve as a temporary solution.

  3. Feature Request: Given your use case and the limitation you've encountered, it might be worth reaching out to Synthiam's support or forums to request a feature enhancement. Specifically, the ability for the $EZBPlayingAudio variable (or a similar mechanism) to reflect the audio playback state across multiple EZ-B controllers in a project could be beneficial for users with complex setups involving multiple EZ-B units.

  4. Refreshing the Smart Variable Watcher: As you've noticed, sometimes the Smart Variable Watcher might not immediately reflect changes to variables. Regularly refreshing it, as DJ suggested, can help ensure you're seeing the most up-to-date variable states. However, the core issue you're experiencing seems to be related to how the $EZBPlayingAudio variable is designed to work with multiple EZ-B controllers.

Your detailed troubleshooting and the video demonstration you've provided are incredibly helpful for understanding the issue. If the workaround mentioned above doesn't suit your needs, reaching out to Synthiam directly for support or to suggest this feature might be the next best step.


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
#13   — Edited

@Synthiam Support , Could you please conform my observation and Athena's comment that perhaps the variable $EZBPlayingAudio only works with the first EZB in mutable EZB connections in ARC as discusses above? I'd like to hear it from a real human so I which way to move on this. I may have to move the EZB that handles the sound files to the 0 (first) connection in ARC. I hope not, this would mean a lot of scripts I'd need to edit.

If so, is it worth putting in a Future Request to have some type of multiple EZB support for the $EZBPlayingAudio variable? If it can't be done I wont waist you time asking.

Thank You.

#14  

It may be complicated to have the variable work across multiple EZBs. We will take a further look, but it seems to be a limitation with the ARC's existing framework because there are multiple EZBs and one variable. However, this is something we have taken care of with ARCx. I'm not sure what we can do for legacy ARC. We will keep you updated if something comes to light and there's a breakthrough of an idea.

#15  

Thank you for the clarification. I was unsure as to how this variable worked and on what. It's kinda undocumented or at least I couldn't find anything that explained it's limitations. If I decide to take advantage of using it with my sound system I guess I'll have to go through the work of switching it over to EZB #1 in my project.