I developed a simple IP camera viewer application in C# that is able to get the audio stream as well.
But I also want to send audio to the camera (for example to warn in real time those who are in unauthorized places). But I can not figure out how to do that.
My WPF C# code is the following:
using Ozeki.Media.IPCamera;
using Ozeki.Media.MediaHandlers;
using Ozeki.Media.MediaHandlers.Video;
namespace VideoCameraViewer04Wpf
{
///
/// Interaction logic for MainWindow.xaml
///
public partial class MainWindow : Window
{
private IIPCamera _camera;
private BitmapSourceProvider _bitmapSourceProvider;
private MediaConnector _connector;
private Speaker _speaker;
public MainWindow()
{
InitializeComponent();
_bitmapSourceProvider = new BitmapSourceProvider();
_connector = new MediaConnector();
videoViewer.SetImageProvider(_bitmapSourceProvider);
_speaker = Speaker.GetDefaultDevice();
}
private void Connect_Click(object sender, RoutedEventArgs e)
{
_camera = IPCameraFactory.GetCamera("192.168.115.175:8080", "admin", "admin");
_connector.Connect(_camera.VideoChannel, _bitmapSourceProvider);
_connector.Connect(_camera.AudioChannel, _speaker);
_camera.Start();
videoViewer.Start();
_speaker.Start();
}
}
}
Note: I used Ozeki Camera SDK as a C# camera library that determines all the used namespaces, etc.
Any idea? Thank you in advance!