The MP3car.com Store The MP3car.com Store    

Sponsored links

Go Back   MP3Car.com > Mp3Car Technical > Software & Software Development > Coders Corner

Reply
 
LinkBack Thread Tools Display Modes
Old 10-17-2006, 11:48 AM   #1
Variable Bitrate
 
bjm2020's Avatar
 
Join Date: May 2003
Location: Louisiana
Posts: 412
Windows Speaker Setup

I am trying to programatically be able to change the Windows Speaker Setup in the control panel. Ex: Stereo Speakers, 5.1 Surround, etc... Anyone know if this is possible. Is there a windows registry entry for this? Is it sound card specific?
__________________
EPIA 800, DWW-7VGA LCD w/Touchscreen, 256mb ram, dvd rom, ati radeon 7000 video card, 80 gb 3.5" hard drive.
bjm2020 is offline   Reply With Quote
Advertisement
 
Advertisement
Sponsored links

Old 10-17-2006, 05:12 PM   #2
Constant Bitrate
 
Join Date: Sep 2006
Location: Cornwall, England
Posts: 145
I havn't heard of any way that this can be changed, other than through the control panel. What exactly are you wanting to change this for, because I have found that when you change (for example) from 5.1 output to stereo output, you have to do a reboot for the change to take effect. I think that the information is stored in the registry, but where, I don't know. You could have a look on Google.
portreathbeach is offline   Reply With Quote
Old 10-20-2006, 09:40 AM   #3
Variable Bitrate
 
bjm2020's Avatar
 
Join Date: May 2003
Location: Louisiana
Posts: 412
I will have to check on if it requires a reboot.

I found these registry keys on my laptop, but I'm not sure if they are hardware dependent.

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Hardware\P rofiles\Current\System\CurrentControlSet\Enum\PCI\ VEN_1002&DEV_4370&SUBSYS_309113C&REV_02\3&13C0B0C5 &0&A5\DirectSound\Speaker Configuration

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Hardware\P rofiles\Current\System\CurrentControlSet\Enum\PCI\ VEN_1002&DEV_4370&SUBSYS_309113C&REV_02\3&13C0B0C5 &0&A5\DirectSound\Speaker Type

The values do change when the speaker configuration is changed.
__________________
EPIA 800, DWW-7VGA LCD w/Touchscreen, 256mb ram, dvd rom, ati radeon 7000 video card, 80 gb 3.5" hard drive.
bjm2020 is offline   Reply With Quote
Old 12-11-2006, 05:51 AM   #4
Newbie
 
Join Date: Nov 2006
Posts: 5
The way to change it is via DirectX functions.
badman is offline   Reply With Quote
Old 12-14-2006, 08:45 AM   #5
Variable Bitrate
 
bjm2020's Avatar
 
Join Date: May 2003
Location: Louisiana
Posts: 412
Can you point me out to these DirectX functions? I don't have much experience with DirectX.
__________________
EPIA 800, DWW-7VGA LCD w/Touchscreen, 256mb ram, dvd rom, ati radeon 7000 video card, 80 gb 3.5" hard drive.
bjm2020 is offline   Reply With Quote
Old 09-14-2007, 10:39 AM   #6
Newbie
 
Join Date: Sep 2007
Posts: 4
7.1 wide configuration speakers
(Sony Dynamic Digital Sound (SDDS) 1993 - Depriciated!)

Speaker Type: 12
Speaker Configuration: 7

FivePointOne: False
GeometryMax: False
GeometryMin: False
GeometryNarrow: False
GeometryWide: False
Headphone: False
Mono: False
Quad: False
SevenPointOne: True
Stereo: False
Surround: False


7.1 home theater speakers

Speaker Type: 13
Speaker Configuration: 8

FivePointOne: False
GeometryMax: False
GeometryMin: False
GeometryNarrow: False
GeometryWide: False
Headphone: False
Mono: False
Quad: False
SevenPointOne: False
Stereo: False
Surround: False


5.1 surround sound speakers

Speaker Type: 11
Speaker Configuration: 6

FivePointOne: True
GeometryMax: False
GeometryMin: False
GeometryNarrow: False
GeometryWide: False
Headphone: False
Mono: False
Quad: False
SevenPointOne: False
Stereo: False
Surround: False




Surround sound speakers (5.0)

Speaker Type: 10
Speaker Configuration: 5

FivePointOne: False
GeometryMax: False
GeometryMin: False
GeometryNarrow: False
GeometryWide: False
Headphone: False
Mono: False
Quad: False
SevenPointOne: False
Stereo: False
Surround: True



Quadraphonic speakers (4.0)

Speaker Type: 9
Speaker Configuration: 3

FivePointOne: False
GeometryMax: False
GeometryMin: False
GeometryNarrow: False
GeometryWide: False
Headphone: False
Mono: False
Quad: True
SevenPointOne: False
Stereo: False
Surround: False



Stereo headphones

Speaker Type: 1
Speaker Configuration: 1

FivePointOne: False
GeometryMax: False
GeometryMin: False
GeometryNarrow: False
GeometryWide: False
Headphone: True
Mono: False
Quad: False
SevenPointOne: False
Stereo: False
Surround: False



Desktop stereo speakers

Speaker Type: 2
Speaker Configuration: 1310724

FivePointOne: False
GeometryMax: False
GeometryMin: False
GeometryNarrow: False
GeometryWide: True
Headphone: False
Mono: False
Quad: False
SevenPointOne: False
Stereo: True
Surround: False


Speaker Type and Speaker Configuration refer to the registry settings and are decimal.

The rest, is the DirectShow config. To set these values, use a simple C# application (download Microsoft Visual Studio 2005 Express C# first), add in the Managed DirectShow reference (install Managed DirectX SDK first), then do something like this:-

Microsoft.DirectX.DirectSound.Device dev = new Microsoft.DirectX.DirectSound.Device(Guid.Empty);
Microsoft.DirectX.DirectSound.Speakers s = new Microsoft.DirectX.DirectSound.Speakers();
s.FivePointOne = true;
dev.SpeakerConfig = s;
dev.Dispose();


also, don't forget to install http://support.microsoft.com/kb/909441

___
binary64
www.MeediOS.com
binary64 is offline   Reply With Quote
Old 12-20-2007, 09:35 PM   #7
Newbie
 
Join Date: Dec 2007
Posts: 4
binary64,

I was able to get the C# program working -- at least as far as setting the SpeakerConfiguration. However, the "Speaker Type" in the registry does not change. Any ideas how to do that generically?

I mean, I code do it specifically for my computer by writing to the registry to the write place, but on different computers, the PCI information would be different.
teridon is offline   Reply With Quote
Old 12-21-2007, 06:59 AM   #8
Newbie
 
Join Date: Sep 2007
Posts: 4
Maybe there is no need - try it just using the managed DirectX config.

I'm on the bit where I want to preview all the different configs - without rebooting.
binary64 is offline   Reply With Quote
Old 12-21-2007, 11:12 AM   #9
Newbie
 
Join Date: Dec 2007
Posts: 4
Sorry, I don't understand what you mean -- could you be more specific? This is literally my first experience with C#. I'm used to writing stuff in perl!

I added a reference to Microsoft.DirectX.DirectSound (in MS Visual C# 2008 Express), and added the code you have above. For switching to headphones I used "s.Headphone = true" instead of "s.FivePointOne".

If anyone's interested, I have my programs here:
http://home.comcast.net/~teridon73/hacks/
Note that as of right now the programs don't properly set the "Speaker Type", but otherwise seem to work.

The registry setting method is also demonstrated there, and that seems to work perfectly. I'm just trying the C# method out of curiousity.
teridon is offline   Reply With Quote
Old 12-21-2007, 07:42 PM   #10
Newbie
 
Join Date: Sep 2007
Posts: 4
What I'm saying is I noted the different "Speaker Type" values because I noticed they were changing but I have no idea what they are for. If it works with just .net (just SpeakerConfiguration) then leave it at that; it works.

A bit of feedback about whether you HAVE to reboot after changing the settings or not would be appriciated. I have no other DirectX stuff running whilst my project runs..

I read your blog. Good point about DirectSound3D. Regmon.exe should reveal if that other value gets read.
binary64 is offline   Reply With Quote
Old 12-21-2007, 08:16 PM   #11
Newbie
 
Join Date: Dec 2007
Posts: 4
Oh I see. I read speculation somewhere (now of course I can't find it) that the "Speaker Type" might affect how DirectSound3D sound gets processed. I suppose I could run some tests using dxdiag for different speaker types for the same speaker configuration. I would only be using my ears (not very good instruments!)

You do not have to reboot after changing the settings -- whether you write directly to the registry, or use the managed DirectX interface. I tested this by listening to a DVD-audio disc with 5.1 sound using PowerDVD while changing the speaker configuration. When I changed the setting (again, either method), the sound cut out for about 2 seconds, then came back on. The changes were definitely working without a reboot.

I ran a similar test using iTunes, with the same results (i.e. sound cut out for about 2 seconds, and came back with the expected settings).

Last edited by teridon; 12-21-2007 at 08:24 PM. Reason: correct period of time for sound outage
teridon is offline   Reply With Quote
Old 12-21-2007, 08:34 PM   #12
Newbie
 
Join Date: Dec 2007
Posts: 4
I found this program to test DirectSound3D
Rightmark 3D sound
http://audio.rightmark.org/download.shtml
teridon is offline   Reply With Quote
Old 12-22-2007, 05:46 AM   #13
Newbie
 
Join Date: Sep 2007
Posts: 4
Wow, WMP11 and Managed AudioVideoPlayback don't
binary64 is offline   Reply With Quote
Sponsored links
Advertisement
 
Advertisement
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem reinstalling Windows XP gkas WinNT Based 2 05-13-2006 03:02 PM
Installing Windows 2000 Pro on a 1GB Microdrive JeremyM WinNT Based 2 05-07-2005 09:56 PM
Setup Help trance728 Newbie 12 05-07-2005 03:28 PM
Windows Freeze When Crank, Crank again windows unfreeze antimatter Power Supplies 37 07-27-2004 12:40 AM
Windows ME and MediaCar dug1967 MediaCar 15 04-15-2004 01:30 PM


All times are GMT -5. The time now is 01:40 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
Copyright © 1999 - 2008 Mp3Car.com Inc.Ad Management by RedTyger
Message Board Statistics