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.

The Streaming Audio Player widget.

To test Streaming Audio Player, open a demo scene with streaming audio from the Audio2Face menu:

Numbered instructions for accessing a streaming audio demo from the Audio2Face menu.

Or, use the Audio2Face tool to create a player manually:

Numbered instructions for manually creating a streaming audio player.

After you create a streaming audio player, connect its time attribute to the Audio2Face Core instance’s time attribute:

Numbered instructions for connecting the player and Core nodes in OmniGraph.

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.

Numbered instructions for setting the prim path.
  • 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.

  • AUDIO2FACE_ROOT_PATH/exts/omni.audio2face.player/omni/audio2face/player/scripts/streaming_server/

  • 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 script:

    • python <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

    • grpcio==1.51.3

    • numpy==1.22.4

    • scipy==1.8.1

    • sounddevice==0.4.2

    • protobuf==3.17.3

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.

Numbered instructions for setting the prim path.