Created
February 15, 2015 14:42
-
-
Save siniypin/47326a9fd78af95a3ff7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PlayFileCommand : ICommand | |
{ | |
private readonly ISipUserAgent _userAgent; | |
private readonly IContainer _container; | |
public PlayFileCommand(ISipUserAgent userAgent, IContainer container) | |
{ | |
_userAgent = userAgent; | |
_container = container; | |
} | |
public void Execute() | |
{ | |
var player = _container.Get<IWavPlayer>(); | |
player.Completed += (sender, args) => | |
{ | |
System.Console.WriteLine("Player {0} has reached the end of file {1}", player.Id, player.File); | |
player.Dispose(); | |
}; | |
player.Start("NeroSoundTrax_test8_PCM_Mono_VBR_16SS_48000Hz.wav", false) ; | |
_userAgent.MediaManager.ConferenceBridge.ConnectToSoundDevice(player.ConferenceSlot.SlotId); | |
_userAgent.MediaManager.ConferenceBridge.Connect(player.ConferenceSlot.SlotId, _userAgent.CallManager.Calls.First.ConferenceSlotId); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment