Wrox Programmer Forums
|
.NET Framework 2.0 For discussion of the Microsoft .NET Framework 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Framework 2.0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 20th, 2011, 01:36 PM
Authorized User
 
Join Date: Apr 2008
Posts: 85
Thanks: 10
Thanked 0 Times in 0 Posts
Default Produce 3D Sound using directx

Hi All,

I am using Directx to produce 3D sound Its working fine, But the only problem is I am not able to produce sound at a time in left or right speaker.

Could someone please tell me what value of vector I should set to produce sound in left or right speaker.

code is here:

Code:
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        Try
            DSDevice = New DirectSound.Device()
            DSDevice.SetCooperativeLevel(Handle, DirectSound.CooperativeLevel.Normal)
            Dim BufferDesc As DirectSound.BufferDescription = New DirectSound.BufferDescription()
            BufferDesc.Control3D = True
            BufferDesc.GlobalFocus = True
            OpenFileDialog1.ShowDialog()
            sFileName = OpenFileDialog1.FileName
            Dim TheSound As DirectSound.SecondaryBuffer = New DirectSound.SecondaryBuffer(sFileName, BufferDesc, DSDevice)
            Dim The3DBuffer As DirectSound.Buffer3D = New DirectSound.Buffer3D(TheSound)
            The3DBuffer.Position = GetVector3(0, 0, 0)
            TheSound.Play(0, BufferPlayFlags.Default)
        Catch ex As Exception
            sErrmsg = ex.Message & ex.ToString()
        End Try
    End Sub
What Value I should pass to the GetVector3(0, 0, 0) so it can produce sound in left or right speaker.

Thanks in Advance
-Joseph





Similar Threads
Thread Thread Starter Forum Replies Last Post
Develop 3D game with C# + DirectX + .NET skywalker1987 C# 1 July 18th, 2013 02:39 AM
about directx Innaorouk C# 2 August 27th, 2007 08:39 PM
Help. How to play media files using DirectX dextergaisie Pro VB 6 0 May 15th, 2007 06:09 AM
managed directx 9drawsubset problem? mmmobasher C# 0 December 1st, 2005 05:29 AM
directx programing bcmaverik VB.NET 5 January 28th, 2004 07:07 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.