Skip to content

Commit 5cb5238

Browse files
committed
Fixed bug in play sounds exmaple.
1 parent 9d57c8a commit 5cb5238

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

examples/SIPExamples/PlaySounds/Program.cs

+8-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
using System;
2121
using System.IO;
22+
using System.Linq;
2223
using System.Threading;
2324
using System.Threading.Tasks;
2425
using Microsoft.Extensions.Logging;
@@ -63,7 +64,8 @@ static async Task Main()
6364
//voipMediaSession.AudioLocalTrack.Capabilities.Clear();
6465
//voipMediaSession.AudioLocalTrack.Capabilities.Add(
6566
// new SDPAudioVideoMediaFormat(new AudioFormat(AudioCodecsEnum.L16, 118, 8000)));
66-
67+
voipMediaSession.OnAudioFormatsNegotiated += (formats) => voipMediaSession.AudioExtrasSource.SetAudioSourceFormat(formats.First());
68+
6769
Console.CancelKeyPress += delegate (object sender, ConsoleCancelEventArgs e)
6870
{
6971
e.Cancel = true;
@@ -163,6 +165,11 @@ static async Task Main()
163165
sipTransport.Shutdown();
164166
}
165167

168+
private static void VoipMediaSession_OnAudioFormatsNegotiated(System.Collections.Generic.List<AudioFormat> obj)
169+
{
170+
throw new NotImplementedException();
171+
}
172+
166173
/// <summary>
167174
/// Adds a console logger. Can be omitted if internal SIPSorcery debug and warning messages are not required.
168175
/// </summary>

0 commit comments

Comments
 (0)