[How to record Line-in with Goldwave]
1. File > New > Select Quality for recording here
2. Hit F11, set Device and configure volume in this dialog.
3. the control pane should be visible by default, if not, go to: Tools > Control to view the control pane.
4. Hit record in the control pane to record your line-in feed.
More info here: https://www.goldwave.com/faq.php#recsrc
----
Problems? Here is a good test to see if you are getting audio via the line-in jack...
[How to listen to Line-In via Speakers]
1. Type mmsys.cpl in the Start Menu search box and press Enter.
2. Select Recording tab. Double click on Line In.
3. Choose Listen tab, check Listen to this device. Choose playback through Default playback device and click Apply button.
4. Choose Levels tab, turn on the speaker, select volume label etc.
It is better if you install the manufacturer's sound software and drivers. I have Realtek HD and controlling sound settings is much easier through this.
TutorialGenius.com
Technical blog discussing various programming languages, frameworks and paradigms. Code snippets and projects are also provided.
Saturday 27 January 2018
Wednesday 13 April 2016
Get and Set Private Properties using Reflection in C#
It's frustrating when you're using an API and some properties you requuire are set as private. This certainly was the case when attempting to resume a video using the YouTube V3 API the other day.
Here is a code snippet on how to set private properties using Reflection.
Here is a code snippet on how to set private properties using Reflection.
Code Snippet
- private static void SetPrivateProperty<T>(Object obj, string propertyName, object value)
- {
- var propertyInfo = typeof(T).GetProperty(propertyName, System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
- if (propertyInfo == null) return;
- propertyInfo.SetValue(obj, value, null);
- }
- private static object GetPrivateProperty<T>(Object obj, string propertyName)
- {
- if (obj == null) return null;
- var propertyInfo = typeof(T).GetProperty(propertyName, System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
- return propertyInfo == null ? null : propertyInfo.GetValue(obj, null);
- }
End of Code Snippet
Labels:
C#
Tuesday 12 April 2016
MsgBox - A Better Winforms MessageBox in C#
Introduction
MsgBox is an enhanced solution to the in-built MessageBox class. It's designed so that the styles, features and behaviour mimic the in-built control with added features.MsgBox allows a better Messagebox experience by allowing the following features:
- Do not display this message again
- Custom font styles and font colors
- Scrollbars for text which is too long
Using the code
MsgBox is used like a standard MessageBox object. There is a different return object which encapsulates the original DialogResult. This handles extra information which as whether the user clicked 'Do no display this message again'.Simple Example
Code Snippet
- MsgBox.Show(this, "Hello", "Caption Text", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
End of Code Snippet
Custom Fonts
Code Snippet
- MsgBox.Show(this, "Hello", "Caption Text", MessageBoxButtons.OK, MessageBoxIcon.Information, true, new Font("Verdana", 12f, FontStyle.Bold), Color.Red);
End of Code Snippet
Long Text
Code Snippet
- MsgBox.Show(this, "Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello Hello", "Caption Text", MessageBoxButtons.OK, MessageBoxIcon.Information, true, new Font("Verdana", 40f, FontStyle.Bold), Color.Blue);
End of Code Snippet
Handling the do not display message again checkbox
Code Snippet
- DialogResultNew res = MsgBox.Show(this, "Hello", "Caption Text", MessageBoxButtons.OK);
- if (res.DoNotDisplayMessageAgain) // Do something here
End of Code Snippet
Download
Download MsgBox Here
History
v1.0 - Initial write-upSunday 21 June 2015
YouTube Comments and Commenting with YouTube API V3 (Google.Apis.YouTube.v3)
Google deprecated V2 of the YouTube API over a year ago, but as of last month, the URLs have been taken offline; forcing users to upgrade to V3 of the API. One of the last features requiring implementating on the V3 platform was the ability to comment on channels and videos. The following example shows how to leave a top level comment on a channel or video using V3 of the API with C#
Example
Code Snippet
- YouTubeService youtube; // Init your service here - Make sure you include the new required scope: YouTubeService.Scope.YoutubeForceSsl
- //commentThreadSnippet.ChannelId; Comment on a channel - leave video id blank if so
- commentThreadSnippet.VideoId = v.ID; // Comment on a Video by VideoID
- // A top level comment is a new comment (Not a reply to an existing comment)
- // Make an insert request and get result snippet
- CommentThreadsResource.InsertRequest commentReq = youtube.CommentThreads.Insert(new CommentThread() { Snippet = commentThreadSnippet}, "snippet");
- CommentThread commentRes = commentReq.Execute();
End of Code Snippet
Wednesday 25 March 2015
Silently Delete a File within a Windows Batch File (BAT File)
I have recently been preparing some custom install scripts lately and I found a few things that may prove to be of some use! This script deletes a file silently and will not report the result in the console window.
Code Snippet
- @echo off
- del /s randomtextfile.txt >nul 2>&1 REM Delete file silently
End of Code Snippet
How to get operating system 32bit or 64bit from a Windows Batch File (BAT File)
I have recently been preparing some custom install scripts lately and I found a few things that may prove to be of some use! This script uses a registry key to determine weather the host system is a 32bit or a 64bit system
Code Snippet
- @echo off REM Hide output from commands
- @echo Attempting to get operating system type (32bit or 64bit)...
- REM -------------- Get 32bit or 64bit --------------
- Set RegQry=HKLM\Hardware\Description\System\CentralProcessor\0
- REG.exe Query %RegQry% > checkOS.txt
- Find /i "x86" < CheckOS.txt > StringCheck.txt
- If %ERRORLEVEL% == 0 (
- @echo This is 32 Bit Operating system!
- SET ostype = "32bit"
- ) ELSE (
- @echo This is 64 Bit Operating System!
- SET ostype = "64bit"
- )
- del /s checkOS.txt >nul 2>&1 REM Clean up silently
- del /s StringCheck.txt >nul 2>&1 REM Clean up silently
End of Code Snippet
Monday 16 March 2015
YouTube Bulk Uploader for the Lazy - An Offline Auto-Tagger, Bulk Uploader and VMS for YouTube!
Being a hardcore videographer with very limited time in the world to share my vast collection of videos, I begun the search for an all encompassing video management system with the ability to auto-tag and upload my videos in bulk to YouTube. As I tend to travel lot and have a lot of time where I could be preparing my videos to upload, I found that I needed an internet connection to even tag them and place them into categories and apply the appropriate finishing details. I found a couple of programs which lightly touched on my requirements, but nothing stood up even close to my needs. Therefore I develped my own solution: "YouTube Bulk Uploader: For the Lazy!".
YouTube Bulk Uploader for the Lazy is your simple and fast solution for offline tagging and uploading videos to YouTube in Bulk. Save hours of time and effort today!
YouTube Bulk Uploader for the Lazy allows you to easily BULK UPLOAD and TAG 1000's of videos OFFLINE! The software provides bulk editing of videos (Tags, Categories, Descriptions, Titles etc) and provides a simple to use interface for uploading and managing videos. The software 'tags' each physical video on your drive so you can freely move and rename them and the software will be able to detect where they are at all times! This can all be done offline, so no need for an internet connection until you're ready to upload!
- See more at: http://ginkosolutions.com/youtube-bulk-uploader
YouTube Bulk Uploader for the Lazy is your simple and fast solution for offline tagging and uploading videos to YouTube in Bulk. Save hours of time and effort today!
YouTube Bulk Uploader for the Lazy allows you to easily BULK UPLOAD and TAG 1000's of videos OFFLINE! The software provides bulk editing of videos (Tags, Categories, Descriptions, Titles etc) and provides a simple to use interface for uploading and managing videos. The software 'tags' each physical video on your drive so you can freely move and rename them and the software will be able to detect where they are at all times! This can all be done offline, so no need for an internet connection until you're ready to upload!
- Supports ALL YouTube supported video file types. MP4, MOV, MKV, MPEG, 3GP, AVI and more
- Allows bulk editing of video titles, descriptions, tags, categories, privacy and more
- Supports multiple YouTube accounts
- Ability to copy video information between multiple accounts
- The Tag Manager allows you to pre-define a set of video tags to tag videos faster!
- The Upload Queue allows to you prioritize your video uploads
- The Video Database allows you to edit and manage video information
- File Path Sync allows you to scan your hard drive for video files which have been moved or renamed
- All features can be performed offline (WITHOUT AN INTERNET CONNECTION!!) (Apart from the uploading part!)
- YouTube video titles, descriptions and video tags are automatically created using the videos file name!
- 1 Full Year of Free Product Updates
- Excellent Customer Support Service
- All This for Only $19.95!
- See more at: http://ginkosolutions.com/youtube-bulk-uploader
Yellow Pages & Yelp Data Extraction - Crawler Spider Business Email List Capture Grabber Scraper
Developed by an old university friend. Very useful software to build your own business email lists and databases!
Web Contact Scraper is a fully automated software application for gathering targeted business contact information!
You can search and gather thousands of business details matching a chosen profession within any location worldwide! Build your own targeted Email Marketing Lists yourself! You can instantly retrieve 1000 Plumbers in New York or 10,000 Dance Instructors in Australia, the possibilities are endless! Export emails, phone numbers, websites, addresses to CSV and start your targeted business campaign today!
- See more at: http://ginkosolutions.com/webcontactscraper
Web Contact Scraper is a fully automated software application for gathering targeted business contact information!
You can search and gather thousands of business details matching a chosen profession within any location worldwide! Build your own targeted Email Marketing Lists yourself! You can instantly retrieve 1000 Plumbers in New York or 10,000 Dance Instructors in Australia, the possibilities are endless! Export emails, phone numbers, websites, addresses to CSV and start your targeted business campaign today!
- Search for multiple business key words (I.e. Construction, Dentist, Lawyer)
- Search within multiple cities, states and countries!
- See the search results appear in real-time!
- In-built tool to remove duplicate contact information
- Supports Yellow Pages and Yelp!
- Export results to CSV
- Proxy IP Support to scrape anonymously!
- Lifetime Licence Key for up to 2 Computers
- 1 Full Year of Free Product Updates
- Excellent Customer Support Service
- All This for Only $19.95!
- See more at: http://ginkosolutions.com/webcontactscraper
Saturday 14 March 2015
Getting and Setting File Tag Meta Information in C# and ASP.NET - With TagLib and DsoFile Examples
The Problem
I recently developed a video content management system, and rather than store hidden files to track versioning and movement of physical files, I wanted to modify the internal file meta information of the videos themselves. I planned to stuff a database ID into the comment tag within each video file, but this proved to be very challenging given the very disoraganised way in which various operating system handled different file types.
Possible Solutions
MediaInfo - http://sourceforge.net/projects/mediainfo/. Cool API, updated a lot, but there is no support for setting file meta information. The entire API is READ ONLY!
TagLib - https://taglib.github.io/. Again, good API with scope to set file tag meta information. So I decided to try this API out and see how far I could get with it. I started hitting it's limits when I couldn't set file meta information for a LOT of video file types: MKV, MOV, 3GP, ASF and more.
DsoFile - http://support.microsoft.com/en-gb/kb/224351. Microsoft's answer to tagging Microsoft Office file tag information. It's able to set Office file tags but also totally new custom properties within each file. You cannot see these values in Windows Explorer without a handy Powershell script plugin, but it works for ALL file types, not just office documents. It's written in C++ and includes the source code also. The downside is that it's a COM component, 32bit and no longer supported. However, somebody compiled a 64bit version here
The Ideal Solution
DsoFile seems like a great solution to the problem. TagLib works hard to achieve an ideal solution, but there are too many file types out there ever changing and the library finds it hard to keep up. I decided to use DsoFile for my project for the time being. I have provided some sample code below so you can see how TagLib and DsoFile libraries modify file meta tag information.
TagLib Sample Code - How to Get and Set the Comment File Meta Tag Field
DsoFile Sample Code - How to Store a Value into a Custom Property and Get it back!
I recently developed a video content management system, and rather than store hidden files to track versioning and movement of physical files, I wanted to modify the internal file meta information of the videos themselves. I planned to stuff a database ID into the comment tag within each video file, but this proved to be very challenging given the very disoraganised way in which various operating system handled different file types.
Possible Solutions
MediaInfo - http://sourceforge.net/projects/mediainfo/. Cool API, updated a lot, but there is no support for setting file meta information. The entire API is READ ONLY!
TagLib - https://taglib.github.io/. Again, good API with scope to set file tag meta information. So I decided to try this API out and see how far I could get with it. I started hitting it's limits when I couldn't set file meta information for a LOT of video file types: MKV, MOV, 3GP, ASF and more.
DsoFile - http://support.microsoft.com/en-gb/kb/224351. Microsoft's answer to tagging Microsoft Office file tag information. It's able to set Office file tags but also totally new custom properties within each file. You cannot see these values in Windows Explorer without a handy Powershell script plugin, but it works for ALL file types, not just office documents. It's written in C++ and includes the source code also. The downside is that it's a COM component, 32bit and no longer supported. However, somebody compiled a 64bit version here
The Ideal Solution
DsoFile seems like a great solution to the problem. TagLib works hard to achieve an ideal solution, but there are too many file types out there ever changing and the library finds it hard to keep up. I decided to use DsoFile for my project for the time being. I have provided some sample code below so you can see how TagLib and DsoFile libraries modify file meta tag information.
TagLib Sample Code - How to Get and Set the Comment File Meta Tag Field
Code Snippet
- using System;
- using TagLib;
- /// <summary>
- /// (c) GinkoSolutions.com
- /// This sample class enables you to set meta file information within physical files.
- /// This is similar to EXIF information for picture files.
- /// TagLib doesn't seem to work for a lot of file types: MKV, MOV etc
- /// It seems to work ok for MP4 files though.
- /// </summary>
- public static class TagLibExample
- {
- /// <summary>
- /// Gets the comment tag from a files meta information
- /// </summary>
- /// <param name="filename">Path to the file</param>
- /// <returns>Our custom value stored in the files comment tag</returns>
- public static string GetCommentField(string filename)
- {
- string comment = string.Empty;
- TagLib.File file = null;
- try
- {
- file = TagLib.File.Create(filename);
- comment = file.Tag.Comment;
- }
- catch (Exception ex)
- {
- // This library works with limited file types, so unsupported file types are
- // thrown here when trying to use "TagLib.File.Create()"
- }
- finally
- {
- if (file != null) file.Dispose(); // Clean up
- }
- return comment;
- }
- /// <summary>
- /// Sets the comment tag within a files meta information
- /// </summary>
- /// <param name="filename">Path to the file</param>
- /// <param name="value">Value to store in the comment tag</param>
- public static void SetCommentField(string filename, string value)
- {
- TagLib.File file = null;
- try
- {
- file = TagLib.File.Create(filename);
- // Set comment tag
- // NOTE: file.Tag.Comment cannot be an empty string, it defaults to null if empty
- file.Tag.Comment = GetCommentField;
- file.Save();
- // Check comment was added successfully.
- // For some reason, TagLib won't throw an error if the property doesnt save
- // for certain file types, yet they appear to be supported.
- // So we have to check it actually worked...
- file = TagLib.File.Create(filename);
- if (file.Tag.Comment != value)
- }
- catch (Exception ex)
- {
- // Handle errors here
- }
- finally // Always called, even when throwing in Exception block
- {
- if (file != null) file.Dispose(); // Clean up
- }
- }
- }
End of Code Snippet
DsoFile Sample Code - How to Store a Value into a Custom Property and Get it back!
Code Snippet
- using System;
- using DSOFile;
- /// <summary>
- /// (c) GinkoSolutions.com
- /// This sample class enables you to set meta file information within physical files.
- /// This is similar to EXIF information for picture files.
- /// DSOFile works for every file type, not just office files.
- ///
- /// NOTE
- /// DsoFile is an unmnaged 32bit dll. We need to compile in x86 mode or we get 'class not registered exception'
- /// There is a third party 64bit version available online, or recompile the C++ source manually.
- /// </summary>
- public static class DSOFileExample
- {
- /// <summary>
- /// A property name that this sample code uses to store tag information.
- /// </summary>
- private static string FILE_PROPERTY = "CustomFileTag";
- /// <summary>
- /// Gets value stored in a custom tag
- /// </summary>
- /// <param name="filename">Path to the file</param>
- /// <returns>Our custom value stored in the custom file tag</returns>
- public static string GetCustomPropertyValue(string filename)
- {
- string comment = string.Empty;
- try
- {
- // Open file
- file.Open(filename, false, DSOFile.dsoFileOpenOptions.dsoOptionDefault);
- comment = GetTagField(file);
- }
- catch (Exception ex)
- {
- // Handle errors here
- }
- finally
- {
- if (file != null) file.Close(); // Clean up
- }
- return comment;
- }
- /// <summary>
- /// Sets value stored in a files custom tag
- /// </summary>
- /// <param name="filename">Path to the file</param>
- /// <param name="value">Value to store in the custom file tag</param>
- public static void SetCustomPropertyValue(string filename, string value)
- {
- try
- {
- file.Open(filename, false, DSOFile.dsoFileOpenOptions.dsoOptionDefault);
- SetTagField(file, value);
- }
- catch (Exception ex)
- {
- // Handle errors here
- }
- finally // Always called, even when throwing in Exception block
- {
- if (file != null) file.Close(); // Clean up
- }
- }
- /// <summary>
- /// Gets the value of the file tag property
- /// </summary>
- /// <param name="file">Ole Document File</param>
- /// <returns>Contents of the file tag property. Can be null or empty.</returns>
- private static string GetTagField(DSOFile.OleDocumentProperties file)
- {
- string result = string.Empty;
- foreach (DSOFile.CustomProperty property in file.CustomProperties)
- {
- if (property.Name == FILE_PROPERTY) // Check property exists
- {
- result = property.get_Value();
- break;
- }
- }
- return result;
- }
- /// <summary>
- /// Sets the value of the file tag property
- /// </summary>
- /// <param name="file">Ole Document File</param>
- /// <param name="value">Value to set as the property value</param>
- /// <param name="saveDocument">Saves document if set to true</param>
- /// <param name="closeDocument">Closes the document if set to true</param>
- private static void SetTagField(DSOFile.OleDocumentProperties file, string value, bool saveDocument = true, bool closeDocument = true)
- {
- bool found = false;
- foreach (DSOFile.CustomProperty property in file.CustomProperties)
- {
- if (property.Name == FILE_PROPERTY) // Check property exists
- {
- property.set_Value(value);
- found = true;
- break;
- }
- }
- if (!found)
- file.CustomProperties.Add(FILE_PROPERTY, value);
- if (saveDocument)
- file.Save();
- if (closeDocument)
- file.Close();
- }
- }
End of Code Snippet
Wednesday 11 March 2015
How To Link To And Embed YouTube Videos In HD Or A Specific Quality Level
Here is a great post on how to change the default quality of an embedded YouTube video on a webpage.
http://www.h3xed.com/web-and-internet/link-directly-to-and-embed-hd-youtube-videos
http://www.h3xed.com/web-and-internet/link-directly-to-and-embed-hd-youtube-videos
Subscribe to:
Posts (Atom)