Skip to content

Instantly share code, notes, and snippets.

View gist:3367417
// Here is what I am attempting, opening the file, encoding it (with your EncodeSpeech method)
// and trying to save the .spx back to a file. The encodedBytes returns with data but the newly
// create file "newFile" does not play. Am I missing something or am I just doing this the wrong
// way? Thanks for all your help.
string audioFile = @"C:\Users\DannyC\Desktop\newFileName.wav";
string newFile = @"C:\Users\DannyC\Desktop\Test.spx";
// Read file bytes
byte[] fileBytes = File.ReadAllBytes (audioFile);
@dannycabrera
dannycabrera / gist:5365508
Created Apr 11, 2013
SignalR error with Xamarin.iOS
View gist:5365508
Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Microsoft.AspNet.SignalR.Client.Resources.resources" was correctly embedded or linked into assembly "Microsoft.AspNet.SignalR.Client.iOS" at compile time, or that all the satellite assemblies required are loadable and fully signed.
@dannycabrera
dannycabrera / Xamarin.iOS AudioTrim Method
Created Jun 13, 2013
Xamarin.iOS AudioTrim Method
View Xamarin.iOS AudioTrim Method
using System;
using System.IO;
using MonoTouch.Foundation;
using MonoTouch.AVFoundation;
using MonoTouch.CoreMedia;
namespace TestProject.Common
{
public class AudioTrim
{
@dannycabrera
dannycabrera / Xamarin.iOS Table Cell Selected Background Color
Last active Dec 24, 2015
Xamarin.iOS Table Cell Selected Background Color
View Xamarin.iOS Table Cell Selected Background Color
UIView BGViewColor = new UIView ();
BGViewColor.BackgroundColor = UIColor.Red; //or whatever color you want.
BGViewColor.Layer.MasksToBounds = true;
cell.SelectedBackgroundView = BGViewColor;
@dannycabrera
dannycabrera / Xamarin.iOS Image Resize
Last active Jan 2, 2018
Xamarin.iOS Image Resize
View Xamarin.iOS Image Resize
CGContext context = UIGraphics.GetCurrentContext ();
context.InterpolationQuality = CGInterpolationQuality.None;
context.TranslateCTM (0, newSize.Height);
context.ScaleCTM (1f, -1f);
context.DrawImage (new RectangleF (0, 0, newSize.Width, newSize.Height), source.CGImage);
var scaledImage = UIGraphics.GetImageFromCurrentImageContext();
View Xamarin.iOS Get Carrier Name
static string GetCarrierName () { using (var info = new CTTelephonyNetworkInfo ()) { return info.SubscriberCellularProvider.CarrierName; } }
View Xamarin.iOS Create Contact
var person = new ABPerson()
{
FirstName = "John",
LastName = "Doe"
};
NSError error;
var ab = ABAddressBook.Create (out error);
ab.Add (person);
@dannycabrera
dannycabrera / Xamarin.iOS IdentifierForVendor
Created Sep 27, 2013
Xamarin.iOS IdentifierForVendor
View Xamarin.iOS IdentifierForVendor
NSUuid identifier = UIDevice.CurrentDevice.IdentifierForVendor;
https://developer.apple.com/library/ios/documentation/uikit/reference/UIDevice_Class/Reference/UIDevice.html#//apple_ref/occ/instp/UIDevice/identifierForVendor
@dannycabrera
dannycabrera / gist:6730630
Created Sep 27, 2013
APS-Environment Entitlement
View gist:6730630
aps-environment - Receive push notifications in iOS
The entitlement key is different for iOS than it is for OS X. On either platform, however,
the provisioning portal assigns a value of development or production to the key, depending
only on which activity you are creating the provisioning profile for.
http://developer.apple.com/library/ios/#documentation/Miscellaneous/Reference/EntitlementKeyReference/Chapters/EnablingLocalAndPushNotifications.html#//apple_ref/doc/uid/TP40011195-CH3-SW1
View iOS URL scheme index
http://handleopenurl.com & http://www.wiki.akosma.com/IPhone_URL_Schemes#Phone
tel - telephone (http://handleopenurl.com/scheme/phone)
html ex: <a href="tel:0031204637000">Call us</a>
native ex1: tel:0031204637000
native ex2: telprompt:##########
Apple Settings App (http://handleopenurl.com/scheme/apple-settings-app)
native ex: prefs:root=General&path=Bluetooth
html ex: <a href="prefs:root=AIRPLANE_MODE">Switch to airplane mode</a>