Re: playing wave files
From: Phil Taylor (phil_at_private-citizen.com)
Date: 12/15/04
- Next message: maceda: "Re: force dx8 loading"
- Previous message: Michael: "playing wave files"
- In reply to: Michael: "playing wave files"
- Next in thread: Michael: "Re: playing wave files"
- Reply: Michael: "Re: playing wave files"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 15 Dec 2004 14:45:51 -0800
its the buffer creation thats failing right?
iirc you cant have both "locate in software" and "defer location" set at the
same time. either you decide, or let the API decide. but not both.
the debug runtime output should confirm this. which should be checked as a
standard debugging practice when programs fail.
"Michael" <Michael@discussions.microsoft.com> wrote in message
news:F04D6428-78B6-4A59-8B07-360F9F7E30CB@microsoft.com...
>I created a simple program that should play a file chosen in the
> OpenFileDialog:
> For some reason the program fails to play any wav file I choose
>
> It says :An unhandled
> exception of type 'System.ArgumentException' occurred in
> microsoft.directx.directsound.dll
>
> Additional information: Value does not fall within the expected range.
>
> here is the code:
> private Device dsDevice = null;
> private SecondaryBuffer buffer=null;
> private BufferDescription info=null;
> private OpenFileDialog o;
> public Form1()
> {
> InitializeComponent();
> o=new OpenFileDialog();
> dsDevice = new Device();
> dsDevice.SetCooperativeLevel(this,CooperativeLevel.Normal);
> info=new BufferDescription();
> info.ControlFrequency=true;
> info.ControlVolume=true;
> info.StaticBuffer=true;
> info.LocateInSoftware=true;
> info.DeferLocation=true;
> o.Filter= "Wave Files(*.wav)|*wav";
> o.ShowDialog();
> buffer=new SecondaryBuffer(Path.(o.FileName),info,dsDevice);
> if(dsDevice!=null)
> buffer.Play(0,BufferPlayFlags.Looping);
> }
> I don't know what can be the problem.
> Thanks for your help
>
>
- Next message: maceda: "Re: force dx8 loading"
- Previous message: Michael: "playing wave files"
- In reply to: Michael: "playing wave files"
- Next in thread: Michael: "Re: playing wave files"
- Reply: Michael: "Re: playing wave files"
- Messages sorted by: [ date ] [ thread ]