I have picked up this piece of code but as I understand it is unsafe code to use and may not be possible in WP7. Does anyone have an idea about how I can make this code safe to use, maybe with try/catch?
GCHandle gch = GCHandle.Alloc(waveInBytes,GCHandleType.Pinned);
int pPtr;
unsafe
{
pPtr = (int)gch.AddrOfPinnedObject().ToPointer();
pPtr += 4;
}