Streaming Audio Player
Use the Streaming Audio Player widget to stream audio data from external sources and applications via gRPC protocol. The player supports audio buffering. Playback starts automatically.
To test Streaming Audio Player, open a demo scene with streaming audio from the Audio2Face menu:
Or, use the Audio2Face tool to create a player manually:
After you create a streaming audio player, connect its time attribute to the Audio2Face Core instance’s time attribute:
Use the Prim Path of the created player as one of the parameters for the gRPC request, when passing audio data to the player from an external source.
To send the audio data to the player you need to implement your own logic (client), which pushes gRPC requests to the Streaming Audio Player server.
Example of such client implemented in Python is provided in “test_client_py”, which is located in A2F directory.
The script provides detailed description of the protocol and parameters (see comments) and also serves as a simple demo client, which takes input WAV audio file and emulates an audio stream by splitting it into chunks and passing it to the Audio Player.
To test the script:
Launch Audio2Face App and open the Streaming Audio Scene (or create a player manually)
Run the test_client.py script:
python test_client.py <PATH_TO_WAV> <INSTANCE_NAME>
PATH_TO_WAV: provide a path to any WAV audio file with speech
INSTANCE_NAME: Streaming Player Prim Path (see above)
Required pip packages to be installed for A2F 2023.1
Streaming to Audio2Emotion
The streaming audio player also supports Audio2Emotion. Check the box on the top of the A2E panel to engage motions for the incoming audio stream.
This option is only available when the Streaming audio player is set as the audio player.