Skip to content

[BUG] OutStreamingData.getStreamingDataForOutbound is producing invalid JSON #44058

Open
@AlexisFilipozzi

Description

@AlexisFilipozzi

Describe the bug
When using com.azure.communication.callautomation.models.OutStreamingData.getStreamingDataForOutbound(byte[] audioData) to stream audio using media streaming API on azure communication service. Produced JSON is invalid, causing sent message (and audio) to be ignored.

Exception or Stack Trace
No exception or stack trace.

To Reproduce
Steps to reproduce the behavior:

  1. Create an automation call that use media streaming API
  2. Convert binary audio data to text using OutStreamingData.getStreamingDataForOutbound
  3. Send audio over websocket
  4. No audio is being played

Code Snippet

Expected behavior
Audio should be played.

Setup (please complete the following information):

  • OS: MacOS
  • IDE: IntelliJ
  • Library/Libraries: azure-communication-callautomation-1.4.0-beta.2.jar
  • Java version: 21
  • App Server/Environment: Tomcat
  • Frameworks: Spring Boot

Additional context
When printing output String from OutStreamingData.getStreamingDataForOutbound, returned string is an invalid JSON due to missing quotes around audioData.data value :

{
  "kind": "audioData",
  "audioData": {
    "data": AQAAAP3/+//8//v//P/9//3//v/9//7//v/+/////v/9//7//v////7//v/+//7//v////7////////////+/////v////7//f/9//7//f/+//7//P/9//3//P/8//z/+//7//z/+//8//v/+//8//3//P/8//3//f/9/////v/+////AAD//wAA///+/////v/+/////v////////8AAAAAAAAAAAAAAAABAAAAAAABAAEAAAAAAP///v////////8AAAAAAAABAAAAAAAAAAAAAAAAAAAA/v///wAA//8AAP//AAAAAAAA/v/+//7////9//3/+v/5//v/+f/5//n/+P/7//v//P/8//z//v/9//z/+//7//v/+//5//n/+v/6//v/+//8//3//v8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAIAAQACAAMAAgACAAQABAAFAAYABgAHAAcABAAFAAQAAwADAAEAAAAAAP7//v/9//z/+f/4//f/9v/0//L/8P/v/+7/7v/t/+z/6//s/+3/7v/s/+v/7f/v/+//8P/x//P/9v/4//v//f8AAAIABAAGAAkACgALAA0ADwAQAA8ADgAOAA8AEQARABAAEAASABMAEQAPAA4ADAALAAoACAAHAAcABQAEAAQAAwADAAQABAAGAAcACQAMAA4AEQAUABYAGQAbAB4AHwAhACMAJAAmACYAJQAmACQAIgAgAB0AGAAUABAACgADAP//+P/x/+r/4v/b/9P/y//C/7n/sP+n/5//l/+N/4b/f/95/3L/af9f/1n/U/9Q/0//Tv9Q/1P/V/9e/2b/b/95/4b/lf+l/7f/y//g/w==,
    "timestamp":null,
    "participant":null,
    "isSilent":false},
  "stopAudio":null
}

When adding missing quotes, audio is played.

Metadata

Metadata

Labels

ClientThis issue points to a problem in the data-plane of the library.Communication - Call AutomationquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions