Snipplrhttp://snipplr.com/language/c-sharp
Recent snippets posted on Snipplr.comen-usWed, 04 Mar 2015 10:00:25 GMT(C#) How to implement text-to-speech during a SIP voice call in C#? - warnerBro19http://snipplr.com/view/91657/how-to-implement-texttospeech-during-a-sip-voice-call-in-c/
I have heard about this solution on the Facebook, and I thought it is worth to share my source code to help other developers interested in converting text to speech using C#. Text-to-speech refers to the ability of computers to read txt aloud. This functionality can be greatly used during SIP communication in autodialer or IVR systems. The source code below is ready for use, so you only need to copy&paste it to your Visual Studio, then modify the necessary fields. (Do not forget to add the necessary DLL file providing the VoIP background to your references: http://www.voip-sip-sdk.com)
This solution assumes that you have a PBX with some SIP extensions installed previously. After creating the necessary using media handler objects, you need to define your PBX and provide the appropriate SIP account details in order to be able to register your application to the phone system. When you have created all the required methods for SIP calling, you can implement the text-to-speech feature by using the SetupTextToSpeech() method.
Have a good time! ]]>Fri, 27 Feb 2015 01:14:21 GMThttp://snipplr.com/view/91657/how-to-implement-texttospeech-during-a-sip-voice-call-in-c/(C#) AssemblyVersion.tt - padaparahttp://snipplr.com/view/90399/assemblyversiontt/
T4 template for put the date in build number (without year) ]]>Sun, 15 Feb 2015 11:16:41 GMThttp://snipplr.com/view/90399/assemblyversiontt/(C#) (C# tutorial) How to create edge detection function - DaniBarroshttp://snipplr.com/view/89547/c-tutorial-how-to-create-edge-detection-function/
I am really interested in Computer Vision technology, so I started to dig deeper in this topic. This is how I found the code below for edge detection, a method belonging to object detection.
If you are interested in implementing edge detection in C#, too, here you can find the code I tried. The code is from a prewritten C# camera library you can all access.
To develop the edge detection function you only need to have a Visual C# WPF Application created in Visual Studio and the VOIPSDK.dll and NVA.dll files (from www.camera-sdk.com ) added to the references.
Creating the user interface is the first step. It will help you to use edge detection by providing an easy-to-use interface. You will have two fields to display the original image and the processed image of the camera, you can set values for Canny Threshold and Canny Threshold Linking and you can set whether you want the edges of the detected elements to be white or colorized. You can find the code of the GUI under Form1.Designer.cs.
Under Form1.cs there is the code for the edge detection function. You can see how to code is built up and what you should to create this function. There will be the different methods you have to call and all the configurations are described.
Trust me, guys, this source code will help you a lot, it made my life easier. Good luck! ]]>Sat, 07 Feb 2015 01:13:41 GMThttp://snipplr.com/view/89547/c-tutorial-how-to-create-edge-detection-function/(C#) How to implement corner detection (C#) - MahendraGadhavihttp://snipplr.com/view/89544/how-to-implement-corner-detection-c/
You can find the full source code for corner detection here. I found this solution on www.camera-sdk.com and it worked for me fine. I created a Visual C# WPF application in Visual Studio, and added two .dll files (VOIPSDK.dll and NVA.dll) to the references. The .dll files can be found on the webpage.
First, you can see the full source code for the interface of the program at Form1.Desginer.cs. On this GUI you can adjust many configurations in connection with the image of the camera, and you can have a detailed list about the detected corners.
Under Form1.cs you can find the source code for the program itself and you will see which mediahandlers, methods and configurations you should use to achieve this function.
I hope you can all use this snippet! I wish you success to build your corner detecting solutions! ]]>Fri, 06 Feb 2015 23:12:41 GMThttp://snipplr.com/view/89544/how-to-implement-corner-detection-c/(C#) How to develop circle detection in C# - leondunn11http://snipplr.com/view/89542/how-to-develop-circle-detection-in-c/
After searching a lot in this topic, I finally found the perfect solution for circle detection. I used a prewritten C# code that I found on www.camera-sdk.com. To use this code here, you’ll need to have a Visual C# WPF Application that can be created in Visual Studio and you should add VOIPSDK.dll and NVA.dll (both can be found on the webpage) to the references.
Now, the first snippet under Form1.Designer.cs is the code for the GUI of the program. The GUI you can implement with this code will help you to be able to manage your program without any troubles.
The second snippet is the code for developing the circle detection function itself. The code contains all the details you need for your program.
I hope these codes will be useful for you all! Have fun! :) ]]>Fri, 06 Feb 2015 21:49:40 GMThttp://snipplr.com/view/89542/how-to-develop-circle-detection-in-c/(C#) How to capture frames from a camera in C# - AdrianVasilyevhttp://snipplr.com/view/89539/how-to-capture-frames-from-a-camera-in-c/
If you wish to make your home, office or warehouse more secure, taking frame captures can be a very useful solution for you. And I can tell you this because I’ve already implemented this function at my office. Now I am sharing the prewritten source code with you for such a solution.
What will you need for this function?
• A Visual C# WPF Application created in Visual Studio
• The VoIPSDK.dll added to the references. (It can be found on the website where I found the code: www.camera-sdk.com/)
The first part of the code under MainForm.cs is the code for the frame capturing program itself. It contains all the details you need to implement this function. Later, under MainForm.Designer.cs you’ll find the source code for the GUI of this program. The code will help you to develop a user interface that will make it easy to use the program.
Good luck with implementing the code! ]]>Fri, 06 Feb 2015 18:29:01 GMThttp://snipplr.com/view/89539/how-to-capture-frames-from-a-camera-in-c/(C#) How to record voice calls (C#, SIP) - Jay-Bhttp://snipplr.com/view/89249/how-to-record-voice-calls-c-sip/
Do you need a couple of lines of codes to implement voice call recording? Just copy and use this code! It really helped me! To share my success, this content is intended to be a short tutorial on how to record SIP voice calls using C#.NET. This guide is recommended for intermediate-level C# developers primarily, since only one complete code is presented instead of explaining its snippets step-by-step. First of all, carry out the following configuration steps to make sure that your system is ready for coding:
• Create a new project (Visual C# Console Application) in Visual Studio
• Add the VoIPSDK.dll file to your references - it is available on this website: www.voip-sip-sdk.com
• Install a VoIP PBX (allowing you to initiate and accept voice calls) and create a new SIP account for the call recorder
The brief description of the code: After the necessary using lines there is a need a softphone and a phone line object, and some further media handler objects to be able to record audio streams into .wav audio files. Thereafter, you need to specify a SIP account for the call recorder (including the data of your PBX). To ensure that the two audio streams will be mixed you need to connect the microphone and the mediaReceiver objects to the mixer. After this you need to connect the mixer to the recorder that will record the mixed audio stream into the file specified by the filename parameter. The rest of the code presents how to save and store a call as .wav file. ]]>Tue, 03 Feb 2015 00:58:47 GMThttp://snipplr.com/view/89249/how-to-record-voice-calls-c-sip/(C#) IP Address (ipv6) Lookup in Bulk Using C# and MySQL Database - Hexahowhttp://snipplr.com/view/88816/ip-address-ipv6-lookup-in-bulk-using-c-and-mysql-database/
Use the code below to lookup IP address in bulk using C-Sharp programming languages and IP2Location MySQL database. In this tutorial, we use the IP2Location LITE database to lookup country of origin from the visitor's IP address. Free databases are available for download at IP2Location LITE database. ]]>Fri, 30 Jan 2015 18:56:32 GMThttp://snipplr.com/view/88816/ip-address-ipv6-lookup-in-bulk-using-c-and-mysql-database/(C#) Canvas to image - KantheshaMurthyhttp://snipplr.com/view/88686/canvas-to-image/
]]>Fri, 30 Jan 2015 01:08:17 GMThttp://snipplr.com/view/88686/canvas-to-image/(C#) How to make SIP video calls in C# - sacha-manjihttp://snipplr.com/view/88431/how-to-make-sip-video-calls-in-c/
While searching on the Internet on how to make SIP video calls using C#, I recognised that there aren’t any brief and straightforward tutorial in this topic. I found multi-page articles (sorry, but some of them are full of bullsh*t) and neverending forum threads, but none of them provided me complete solution. Therefore, I undertook to create a short and concise guide on how to make video calls in C# using the VoIP technology.
Look at the prerequisites:
- PBX: To be able to make and receive video calls you, a phone system (e.g. Asterisk) is essentially needed. You need to add a new SIP account in your PBX for this application.
- Visual Studio: This solution is based on a console softphone, so a new Visual C# Console Application is just enough.
- VoIPSDK.dll: I used prewritten VoIP components to implement the SIP video calling feature. The necessary .dll file can be found on this website: http://www.voip-sip-sdk.com/. It should be added to your references.
- Test phone: To test your application you can use any VoIP phone stat supports video calling (e.g. Bria softphone).
Now take a look at the code. As you can see below, just a few lines of C# code are enough to connect the application to a PBX and to initiate a video call. Firstly, you need to perform the SIP registration tasks. You need to create a softphone and a phone line object, then you need to specify the SIP account to be used for the phone line. These configurations are needed to be able to register to your PBX. After calling the RegisterPhoneLine method the regsitration procedure starts, and the application will indicates its status due to the mySoftphone_PhoneLineStateChanged method. The PhoneCallVideoSender and PhoneCallVideoReceiver objects are responsible for video handling. To handle the USB webcamera, the WebCamera object can be used. The CallType class is used to identify whether the call is a video or an audio call.
To make a test call, provide valid SIP account details for this console application to be able to register to your PBX, then specify a telephone number to be dialled (it can be an other SIP account that has been previously registered to the PBX). After running the application, it dials the provided phone number automatically meanwhile sending the image of the webcamera. ]]>Mon, 26 Jan 2015 21:50:53 GMThttp://snipplr.com/view/88431/how-to-make-sip-video-calls-in-c/(C#) choose criterion 2011 - mizunoandreyhttp://snipplr.com/view/88314/choose-criterion-2011/
older version of and id3/c45 classifier ]]>Sun, 25 Jan 2015 05:18:54 GMThttp://snipplr.com/view/88314/choose-criterion-2011/(C#) Bookmark editing (filter links) - xXxPizzaBreakfastxXxhttp://snipplr.com/view/86494/bookmark-editing-filter-links/
This is a simple example to quickly and easily produce a set of links for a given site in your bookmarks from Firefox.. ]]>Thu, 08 Jan 2015 19:21:39 GMThttp://snipplr.com/view/86494/bookmark-editing-filter-links/(C#) Convert IPv6 Address to IP numbers (C#) - Hexahowhttp://snipplr.com/view/84723/convert-ipv6-address-to-ip-numbers-c/
Use the code below to convert the IP address of your web visitors and lookup for their geographical location, e.g. country, state, city, latitude/longitude, ZIPs, timezone and so on. Free database can be downloaded at http://lite.ip2location.com. ]]>Mon, 22 Dec 2014 22:09:01 GMThttp://snipplr.com/view/84723/convert-ipv6-address-to-ip-numbers-c/(C#) C#/C++ Shared enum - xXxPizzaBreakfastxXxhttp://snipplr.com/view/84044/cc-shared-enum/
If you are using c++/cli or UnmanagedExports, this is a useful way to share enum int values between c++ and c# code/DLLs without worrying about duplicated code going out of date. ]]>Tue, 16 Dec 2014 10:37:10 GMThttp://snipplr.com/view/84044/cc-shared-enum/(C#) Creating Task Manager in ASP.NET MVC5 - Dmixhttp://snipplr.com/view/82298/creating-task-manager-in-aspnet-mvc5/
A step-by-step tutorial that explains how to build a task manager with two user types (Manager and Employee) in ASP.NET MVC5. The task manager is built with the use of ASP.NET Identity, Entity Framework and DHTMLX Scheduler .NET web control. Ready to download sample is attached. ]]>Tue, 25 Nov 2014 22:32:13 GMThttp://snipplr.com/view/82298/creating-task-manager-in-aspnet-mvc5/(C#) (C# code snippet) How to create USB web camera viewer and stream to remote locations - tomimohttp://snipplr.com/view/81765/c-code-snippet-how-to-create-usb-web-camera-viewer-and-stream-to-remote-locations/
In this brief tutorial you will learn how to develop a camera viewer application in C# that allows you to display the image of your USB webcam and to stream the camera image to remote PCs and smartphones. Instead of presenting a long article, I would rather show how to implement such application with a few lines of C# code by using the prewritten components of a C# camera library.
Prerequisites
- A Visual C# WPF Application created in Visual Studio
- The VoIPSDK.dll added to the references. (It can be found on the official website of this C# camera library: www.camera-sdk.com)
- A media player supporting RTSP streaming (e.g. VLC) installed on a remote PC
First of all let’s build the GUI. If you follow the content of the MainWindow.xaml file line-by-line, you will see how to create user all the necessary GUI elements that allows the user to be able to connect to a USB camera and display its image, and to set the listen address (including 2 textboxes for the IP address and the port number) that makes RTSP streaming possible. In the MainWindow.xaml.cs file you will see how to implement the camera viewer functionality and how to turn your application as a video server.
To test your application run the program, click the Connect button, then when the camera image is displayed, enter the IPv4 address of your PC as listening address, and specify ’554’ as a port number. Thereafter open the VLC media player on an other PC or smartphone, and open the network media stream by entering the following network URL: rtsp://192.168.115.1:554 (that is: rtsp://yourIPv4address/portnumber).
I hope my code snippet was useful! Happy programming! ]]>Wed, 19 Nov 2014 17:17:36 GMThttp://snipplr.com/view/81765/c-code-snippet-how-to-create-usb-web-camera-viewer-and-stream-to-remote-locations/(C#) BugFix globalization - DennisvanderStelthttp://snipplr.com/view/81025/bugfix-globalization/
Line 126 should be replaced by following code ]]>Fri, 07 Nov 2014 07:41:18 GMThttp://snipplr.com/view/81025/bugfix-globalization/(C#) Moq: Verify that a method is not called - heathbohttp://snipplr.com/view/80695/moq-verify-that-a-method-is-not-called/
Verify that the Execute("ping") method is never called. ]]>Sat, 01 Nov 2014 03:10:37 GMThttp://snipplr.com/view/80695/moq-verify-that-a-method-is-not-called/(C#) DocumentDB Controller - giventocodehttp://snipplr.com/view/79884/documentdb-controller/
API Controller for Azure Mobile Services with DocumentDB as the backend. ]]>Fri, 17 Oct 2014 01:41:23 GMThttp://snipplr.com/view/79884/documentdb-controller/(C#) Document Entity Domain Manager - giventocodehttp://snipplr.com/view/79883/document-entity-domain-manager/
Document Entity Domain Manager for Azure Mobile Services ]]>Fri, 17 Oct 2014 01:36:44 GMThttp://snipplr.com/view/79883/document-entity-domain-manager/