Comments (16)
Let me do some testing on Windows 10.
from audiodevicecmdlets.
@crazybbs What does the output of Get-DefaultAudioDevice look like on your system?
from audiodevicecmdlets.
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.
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.
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.
i can't wait to get a fix for that :(
thanks for your effort!
from audiodevicecmdlets.
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.
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.
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.
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.
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.
Any update on the issue? Thanks.
from audiodevicecmdlets.
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.
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.
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.
Worked fine for me on Windows 10. Thanks!
from audiodevicecmdlets.
Related Issues (20)
- How to check Mute-State of non-default-device HOT 1
- Change status of non-default audio device HOT 1
- [Feature-Request] Include disabled/disconnected devices in Get-AudioDevice -List
- Feature Request - Disable Audio Device like it is possible in mmsys.cpl
- [Feature Request] Control over Communication's "Reduce The Volume" feature.
- [Feature Request] Set Endpoint Friendly Name.
- [Feature Request] Get and Set sampling rate and bit depth
- Write-AudioDevice should be able to adjust -[Timespan]SampleInterval and return floats HOT 3
- Write-AudioDevice should support -Multichannel
- Write-AudioDevice internal cleanup
- Write-AudioDevice should not use parameter sets
- "Get-AudioDevice -List" throws 0x80070490 Exception HOT 2
- Get-AudioDevice -PlaybackVolume returns a string not a float
- Feature Request: - Set Audio Device Format HOT 1
- Feature Request: get/set balance
- Windows 11 22631.3085 stopped working HOT 5
- [Feature Request] Listen to this device, reset
- [Feature Request] Set-AudioDevice should take in a name
- [Feature request] Show sound volume bar when calling Set-AudioDevice -PlaybackVolume
- Retrieve audio adapter and endpoint device names separately HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from audiodevicecmdlets.