Skip to content

Commit 1f7b75c

Browse files
authored
Update media-streaming.md
Update formatting of audio and message schemas based on customer feedback
1 parent 5b47570 commit 1f7b75c

File tree

1 file changed

+17
-28
lines changed

1 file changed

+17
-28
lines changed

articles/communication-services/quickstarts/voice-video-calling/media-streaming.md

Lines changed: 17 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -33,42 +33,31 @@ Get started with using audio streams through Azure Communication Services Media
3333
When ACS has received the URL for your WebSocket server, it will create a connection to it. Once ACS has successfully connected to your WebSocket server, it will send through the first data packet which contains metadata regarding the incoming media packets.
3434

3535
``` code
36-
/**
37-
* The first message upon WebSocket connection will be the metadata packet
38-
* which contains the subscriptionId and audio format
39-
*/
40-
public class AudioMetadataSample {
41-
public string kind; // What kind of data this is, e.g. AudioMetadata, AudioData.
42-
public AudioMetadata audioMetadata;
43-
}
44-
45-
public class AudioMetadata {
46-
public string subscriptionId // unique identifier for a subscription request
47-
public string encoding; // PCM only supported
48-
public int sampleRate; // 16000 default
49-
public int channels; // 1 default
50-
public int length; // 640 default
36+
{
37+
"kind": <string> // What kind of data this is, e.g. AudioMetadata, AudioData.
38+
"audioMetadata": {
39+
"subscriptionId": <string>, // unique identifier for a subscription request
40+
"encoding":<string>, // PCM only supported
41+
"sampleRate": <int>, // 16000 default
42+
"channels": <int>, // 1 default
43+
"length": <int> // 640 default
44+
}
5145
}
5246
```
5347

5448
## Audio streaming schema
5549
After sending through the metadata packet, ACS will start streaming audio media to your WebSocket server. Below is an example of what the media object your server will receive looks like.
5650

5751
``` code
58-
/**
59-
* The audio buffer object which is then serialized to JSON format
60-
*/
61-
public class AudioDataSample {
62-
public string kind; // What kind of data this is, e.g. AudioMetadata, AudioData.
63-
public AudioData audioData;
52+
{
53+
"kind": <string>, // What kind of data this is, e.g. AudioMetadata, AudioData.
54+
"audioData":{
55+
"data": <string>, // Base64 Encoded audio buffer data
56+
"timestamp": <string>, // In ISO 8601 format (yyyy-mm-ddThh:mm:ssZ)
57+
"participantRawID": <string>,
58+
"silent": <boolean> // Indicates if the received audio buffer contains only silence.
59+
}
6460
}
65-
66-
public class AudioData {
67-
public string data; // Base64 Encoded audio buffer data
68-
public string timestamp; // In ISO 8601 format (yyyy-mm-ddThh:mm:ssZ)
69-
public string participantRawID;
70-
public boolean silent; // Indicates if the received audio buffer contains only silence.
71-
}
7261
```
7362

7463
Example of audio data being streamed

0 commit comments

Comments
 (0)