I have the following code. The StartRecord method trows an error on the Microsoft Surface Unit. But when I'm testing it on the emulator, it all works great. Any hints how
1) to find the exception that is thrown on the Microsoft Surface Unit?
2) to find the error in the code? any assumptions?
private void StartRecord(object sender, ContactEventArgs e)
{
isRecording = true;
StartButton.IsEnabled = false;
recordTimer = new Timer(10);
recordTimer.Elapsed += new ElapsedEventHandler(recordTimer_Elapsed);
PlaybackRoot.Visibility = System.Windows.Visibility.Collapsed;
EllapsedRecord.Visibility = System.Windows.Visibility.Visible;
InputLevel.Visibility = System.Windows.Visibility.Visible;
long time = DateTime.Now.Ticks;
String fileName = Convert.ToString(time) + ".wav";
Console.WriteLine(fileName);
startTime = DateTime.UtcNow;
recordTimer.Start();
record = new AudioRecording(fileName);
record.getSampleAggregator().MaximumCalculated += new EventHandler<MaxSampleEventArgs>(AudioControl_MaximumCalculated);
record.start();
}
I am not familiar with Surface but if you don't have any debugging tools i would start by wrapping everything in a
try
block, so the exception message and callstack can be retrieved:This should allow you to further narrow the problem down to a specific operation.