Coder Social home page Coder Social logo

Comments (16)

cdhunt avatar cdhunt commented on September 27, 2024

Let me do some testing on Windows 10.

from audiodevicecmdlets.

cdhunt avatar cdhunt commented on September 27, 2024

@crazybbs What does the output of Get-DefaultAudioDevice look like on your system?

from audiodevicecmdlets.

crazybbs avatar crazybbs commented on September 27, 2024

Index DeviceFriendlyname Device


2         Haut-parleurs (Realtek High Definition Audio) CoreAudioApi.MMDevice

[logo]
Mathieu Généreux
Propriétaire
[email protected]:[email protected]
Tél : (450) 551-0585
Fax : (450) 742-9531

De : Chris Hunt [mailto:[email protected]]
Envoyé : 4 août 2015 10:06
À : cdhunt/WindowsAudioDevice-Powershell-Cmdlet [email protected]
Cc : crazybbs [email protected]
Objet : Re: [WindowsAudioDevice-Powershell-Cmdlet] Set-DefaultAudioDevice -Index 1 (#5)

@crazybbshttps://github.com/crazybbs What does the output of Get-DefaultAudioDevice look like on your system?


Reply to this email directly or view it on GitHubhttps://github.com//issues/5#issuecomment-127623866.

from audiodevicecmdlets.

cdhunt avatar cdhunt commented on September 27, 2024

It looks like you only have a single audio device so trying to change the default audio device won't accomplish much. I have tested Get/Set-DefaultAudioDeviceVolume in Windows 10 and it works. I do see the same behavior with Set-DefaultAudioDevice which could likely be related to changes in Windows 10 so I've flagged this issue as a bug.

from audiodevicecmdlets.

crazybbs avatar crazybbs commented on September 27, 2024

Sorry,

I’ve several audio device with the command get-audiodevicelist.
you asked me the command Get-defaultaudiodevice so it’s only the default one

I’ll check the future update thank you☺

[logo]
Mathieu Généreux
Propriétaire
[email protected]:[email protected]
Tél : (450) 551-0585
Fax : (450) 742-9531

De : Chris Hunt [mailto:[email protected]]
Envoyé : 4 août 2015 10:59
À : cdhunt/WindowsAudioDevice-Powershell-Cmdlet [email protected]
Cc : crazybbs [email protected]
Objet : Re: [WindowsAudioDevice-Powershell-Cmdlet] Set-DefaultAudioDevice -Index 1 (#5)

It looks like you only have a single audio device so trying to change the default audio device won't accomplish much. I have tested Get/Set-DefaultAudioDeviceVolume in Windows 10 and it works. I do see the same behavior with Set-DefaultAudioDevice which could likely be related to changes in Windows 10 so I've flagged this issue as a bug.


Reply to this email directly or view it on GitHubhttps://github.com//issues/5#issuecomment-127641644.

from audiodevicecmdlets.

naighz avatar naighz commented on September 27, 2024

i can't wait to get a fix for that :(
thanks for your effort!

from audiodevicecmdlets.

cdhunt avatar cdhunt commented on September 27, 2024

Good news is I found the source of the Null Reference exception. Unfortunately, it seems to be in accessing the win32 API. It's going to take a bit of work to figure out a solution.

from audiodevicecmdlets.

crazybbs avatar crazybbs commented on September 27, 2024

Nice that you’ve found the problem and I’ll check for update time to time

Thank you,

[logo]
Mathieu Généreux
Propriétaire
[email protected]:[email protected]
Tél : (450) 551-0585
Fax : (450) 742-9531

De : Chris Hunt [mailto:[email protected]]
Envoyé : 9 août 2015 16:24
À : cdhunt/WindowsAudioDevice-Powershell-Cmdlet [email protected]
Cc : crazybbs [email protected]
Objet : Re: [WindowsAudioDevice-Powershell-Cmdlet] Set-DefaultAudioDevice -Index 1 (#5)

Good news is I found the source of the Null Reference exception. Unfortunately, it seems to be in accessing the win32 API. It's going to take a bit of work to figure out a solution.


Reply to this email directly or view it on GitHubhttps://github.com//issues/5#issuecomment-129234806.

from audiodevicecmdlets.

cgrace70 avatar cgrace70 commented on September 27, 2024

I originally opened another "issue", but I figured I would post this here as it may be related. :)

I get the following error when I try to use the Set-DefaultAudioDevice cmdlet:

"Set-DefaultAudioDevice : Object reference not set to an instance of an object."

I can import the module without any issues. I don't seem to have any issues with any of the other cmdlets. I'm running 64-bit Windows 10 Pro (PowerShell v5). I don't have an issue on a second computer using 64-bit Windows 7 Pro (PowerShell v4). Both systems have multiple audio devices.

Please let me know if there is any other information I can provide to you.

from audiodevicecmdlets.

thefirstben avatar thefirstben commented on September 27, 2024

Hello,
First, i wanted to say great job on this, i was finally able to switch from my multiple sound devices using my phone and your powershell script which was really time saving ;)

Everything was working great on Windows 7, 8 and 8.1 but since i migrated to Windows 10 a month ago i'm having the same problem.

The Get-AudioDeviceList, Get-DefaultAudioDevice, Get-DefaultAudioDeviceVolume and Set-DefaultAudioDeviceMute all work as expected, only the Set-DefaultAudioDevice is not behaving.

I was trying to find another way around and i was wondering what you are using to change the default device (WMI Class, registry, API) ?

From what i see the API that was mostly used was from an undocumented Microsoft API (http://www.daveamenta.com/2011-05/programmatically-or-command-line-change-the-default-sound-playback-device-in-windows-7/) and that they may have removed in Windows 10.

I saw that before windows 10 we could you some registry keys. But from what i saw on windows 10 they are read-only and could only be changed by changing the owner of the keys which i don't like.

So i checked in powershell, and i managed to list the devices :
Get-WmiObject -class "Win32_SoundDevice" -namespace "root\CIMV2"

But we can see that all properties of this class are read-only :
get-ciminstance Win32_SoundDevice | Get-Member

Anyway i checked most properties and i do not see anything regarding default device : Get-WmiObject -class "Win32_SoundDevice" -namespace "root\CIMV2" | select *

And I don't see another WMI class managing the sound :
Get-WmiObject -List | where-Object { $_.Name -like "sound" }

Do you have an idea of the name of the WMI Class managing the Default device ?

Thanks !

from audiodevicecmdlets.

thefirstben avatar thefirstben commented on September 27, 2024

Seems like they had a somewhat similar problem on another project and corrected it :
davkean/audio-switcher#32

Maybe this can help you find a solution for us ;)

from audiodevicecmdlets.

cgrace70 avatar cgrace70 commented on September 27, 2024

Any update on the issue? Thanks.

from audiodevicecmdlets.

MrTheoW avatar MrTheoW commented on September 27, 2024

Would also love to know if there is any sight on a fix, or alternative.. would really like to use powershell to control my audio...

from audiodevicecmdlets.

cdhunt avatar cdhunt commented on September 27, 2024

Thank you all for the interest in the project. I'm swamped with work projects at the moment. I hope to further investigate this soon.

from audiodevicecmdlets.

MrTheoW avatar MrTheoW commented on September 27, 2024

Awsome to hear... This function would mean, i won't have to reinsert my USB-Audiodevice when my wife has been using my computer. (She doesn't know how to use the audio setting) looking forward to the update 👍

from audiodevicecmdlets.

arccth avatar arccth commented on September 27, 2024

Worked fine for me on Windows 10. Thanks!

from audiodevicecmdlets.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.