Answered by:
'Memory' does not exist in current context.

Question
-
In the Microsoft wave sample for C# ( http://msdn.microsoft.com/en-us/library/aa446573.aspx ) Memory class is used. but in visual studio 2008 there is no reference to 'Memory' class or interface. Error is "The name 'Memory' does not exist in current context.". I can`t find any reference for this class.
if (lpData == IntPtr.Zero) lpData = Memory.LocalAlloc(Memory.LMEM_FIXED, (uint)bufferLength);
Please help me to use this sample.
Answers
-
Is this relevant?
http://social.msdn.microsoft.com/Forums/en-US/3ab12539-0f1f-491a-8b1b-b0d76a73dd0b/wavefile-issues
Paul Linton
- Proposed as answer by Jason Dot Wang Friday, July 19, 2013 7:22 AM
- Marked as answer by Jason Dot Wang Wednesday, July 24, 2013 1:50 AM
-
Hi,
the memory class is part of the source provided with the article,
see .NET Compact Framework Sample: P/Invoke LibraryRegards, Elmar
- Proposed as answer by Jason Dot Wang Friday, July 19, 2013 7:29 AM
- Marked as answer by Jason Dot Wang Wednesday, July 24, 2013 1:50 AM
-
Also note that this is unsafe code. Also this article is out of date by a decade. It applies to .NET 1.0 (not even 1.1, 1.0!)
If all you want to do is paly .wav files, just use the SoundPlayer Class:
http://msdn.microsoft.com/en-us/library/system.media.soundplayer.aspx
If you want to record sound there have likely also been breakthroughs since that code was written:
http://stackoverflow.com/questions/510019/capture-a-microphone-audio-stream-using-net-framework
http://stackoverflow.com/questions/16162976/record-sound-in-good-quality
http://voicerecorder.codeplex.com/
http://channel9.msdn.com/coding4fun/articles/NET-Voice-Recorder
Let's talk about MVVM: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b1a8bf14-4acd-4d77-9df8-bdb95b02dbe2 Please mark post as helpfull and answers respectively.
- Proposed as answer by Jason Dot Wang Friday, July 19, 2013 7:17 AM
- Marked as answer by Jason Dot Wang Wednesday, July 24, 2013 1:50 AM
All replies
-
Is this relevant?
http://social.msdn.microsoft.com/Forums/en-US/3ab12539-0f1f-491a-8b1b-b0d76a73dd0b/wavefile-issues
Paul Linton
- Proposed as answer by Jason Dot Wang Friday, July 19, 2013 7:22 AM
- Marked as answer by Jason Dot Wang Wednesday, July 24, 2013 1:50 AM
-
Hi,
the memory class is part of the source provided with the article,
see .NET Compact Framework Sample: P/Invoke LibraryRegards, Elmar
- Proposed as answer by Jason Dot Wang Friday, July 19, 2013 7:29 AM
- Marked as answer by Jason Dot Wang Wednesday, July 24, 2013 1:50 AM
-
Also note that this is unsafe code. Also this article is out of date by a decade. It applies to .NET 1.0 (not even 1.1, 1.0!)
If all you want to do is paly .wav files, just use the SoundPlayer Class:
http://msdn.microsoft.com/en-us/library/system.media.soundplayer.aspx
If you want to record sound there have likely also been breakthroughs since that code was written:
http://stackoverflow.com/questions/510019/capture-a-microphone-audio-stream-using-net-framework
http://stackoverflow.com/questions/16162976/record-sound-in-good-quality
http://voicerecorder.codeplex.com/
http://channel9.msdn.com/coding4fun/articles/NET-Voice-Recorder
Let's talk about MVVM: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b1a8bf14-4acd-4d77-9df8-bdb95b02dbe2 Please mark post as helpfull and answers respectively.
- Proposed as answer by Jason Dot Wang Friday, July 19, 2013 7:17 AM
- Marked as answer by Jason Dot Wang Wednesday, July 24, 2013 1:50 AM