TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Thomas
NA
7
0
directSound problems (beginners question)
Nov 20 2009 11:48 AM
Hi
I'm trying to make use of directsound in a .Net project. I haven't much experience with c# so bare over with me.
I have borrowed some code found on the net that I'm trying to merge into my own little project to get a soft start. I'm already failing to initialize the directsound device. Here is what I have:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using Microsoft.DirectX.DirectSound;
using DS = Microsoft.DirectX.DirectSound;
namespace AudioProcessor
{
public class SoundSetup
{
private DS.Device sounddevice;
private SecondaryBuffer shotsound;
public void InitDxSound()
{
sounddevice = new DS.Device();
sounddevice.SetCooperativeLevel(this, CooperativeLevel.Priority);
}
}
static class Program
{
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
I get the following errors:
Error 1 The best overloaded method match for 'Microsoft.DirectX.DirectSound.Device.SetCooperativeLevel(System.IntPtr, Microsoft.DirectX.DirectSound.CooperativeLevel)' has some invalid arguments
Error 2 Argument '1': cannot convert from 'AudioProcessor.SoundSetup' to 'System.IntPtr'
Can someone please tell me how to resolve this (I suspect that this has to do with the use of "this")?
Best Regards
Thomas
Reply
Answers (
4
)
Customize how to populate MSWord template
help needed - to build a small wpf app