ARC Pro

Upgrade to ARC Pro

Become a Synthiam ARC Pro subscriber to unleash the power of easy and powerful robot programming

PRO
Canada
#1  

To play an audio stream or WAV file from the internet on your EZ-InMoov Robot Head, you can use the Audio.playAudioFile() function within the Synthiam ARC software. However, the Audio.playAudioFile() function is designed to play local audio files and does not support streaming audio directly from a URL.

To play an audio file from the internet, you would typically need to download the file to your local system first and then play it using the Audio.playAudioFile() function. Here's a general approach you could take:

  1. Download the audio file from the internet to your local system using a script or a manual download process.
  2. Once the file is downloaded, use the Audio.playAudioFile() function to play the file from the local path where it was saved.

Here's an example of how you might use the Audio.playAudioFile() function in an ARC script:

// Specify the local path where the audio file is saved
var localFilePath = "C:\\path\\to\\downloaded\\audio.wav";

// Play the audio file
Audio.playAudioFile(localFilePath);

Please note that the above code is a simplified example and assumes that you have already downloaded the audio file to the specified local path.

If you need to automate the process of downloading and playing the audio file within a script, you would need to implement additional logic to handle the download process. This might involve using custom scripting or integrating with third-party tools or services that can download files from the internet.

Keep in mind that the capabilities and functions available in Synthiam ARC may change over time, so it's always a good idea to check the latest documentation or reach out to the Synthiam community for support with specific use cases.


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.
PRO
Indonesia
#2  

@Athena how to download the file to your local from javascript code?

PRO
Canada
#3  

In the context of Synthiam ARC, downloading a file directly from a URL within a JavaScript script is not a built-in feature. However, you can use the Net.HTTPGet() function to send an HTTP GET request to a URL and receive the contents of the file as a string. If the file is a binary file (like a WAV audio file), this method may not be suitable as it's designed for text content.

For text files, here's an example of how you might use Net.HTTPGet():

var url = "http://example.com/file.txt";
var content = Net.HTTPGet(url);

// Now you can do something with the content, like save it to a file
File.write("C:\\path\\to\\local\\file.txt", content);

For binary files, such as a WAV audio file, you would typically need to use a different approach, as handling binary data in JavaScript within ARC might not be straightforward. One workaround is to use an external script or program to download the file and then call that script from ARC.

Here's a conceptual example using a command-line tool like wget or curl (this assumes you have such a tool installed on your system):

  1. Create a batch file or shell script that downloads the file using wget or curl.
  2. Call that script from ARC using the Exec() function.

Here's how you might set up the batch file (download_audio.bat):

@echo off
wget https://peregrine-results.s3.amazonaws.com/playht20_H7Lp4K4DgvhJUfRSGYenY.wav -O C:\path\to\downloaded\audio.wav

And here's how you might call it from ARC:

Utility.exec("C:\\path\\to\\download_audio.bat");

After the file is downloaded, you can play it using the Audio.playAudioFile() function as mentioned in the previous response.

Please note that this is a conceptual example and may require adjustments based on your actual environment and the tools available on your system. Always ensure that you have the necessary permissions to download and execute files on your system and that you trust the source of the files you are downloading.


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.