In WIN 8 DP- How to set output audio device to speaker instead of USB using powershell - powershell

I have gone through many of the forums "To set output audio device to speaker instead of USB" in Windows 8 DP. but i could not find any solution how to do this using powershell. can some one help me in this ?

Sounds like you want to script changing your audio output device. You can do this via the registry. See this blog post for a script that does this:
http://www.ademiller.com/blogs/tech/2008/12/switching-audio-input-and-output-with-powershell/
This may not invoke a change immediately like the applet does. For that you might have to invoke the API and it doesn't look like it's easy.
Someone made a little command line program implemented in C++ you can download the source and binary here:
http://www.daveamenta.com/2011-05/programmatically-or-command-line-change-the-default-sound-playback-device-in-windows-7/
It didn't run on my Windows 7 system but that may be because I don't have the correct Visual C++ redistribute installed. You might try this version if you get an error running it.
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=29

Related

Interfacing with command line applications

I have a command line application, which I want to remotely control with another program I've yet to make. What is the best way to go about this?
In more detail:
I want to be able to read the text output of the application I want to control, and send commands to it from my other app via simple text input. Preferred language: python, c or c++
I tried to use winautogui, but couldn't find a way to implement it for CMD.
I found a python version of expect for windows called wexpect, which does the job.

Matlab openGL Warning

I'm tasked with upgrading a lot of legacy models and scripts made in an older version of Matlab/Simulink and have it running smoothly in R2018b. Among other requirements I'm not allowed to have any warnings issued upon execution of .m scripts or Simulink models. This is generally tedious but straightforward to comply.
However, there is a specific warning that Matlab does not give me hints on possible sources:
Warning: MATLAB has disabled some advanced graphics rendering features by switching to software OpenGL. For more information click here.
The link opens the Matlab Help page titled Resolving Low-Level Graphics Issues, which describes issues I'm not finding (or at least not noticing)
I do note that many scripts I run create and close figures, but this is done procedurally. I haven't been able to associate this warning with some specific function or feature. I'm working on a Windows Server machine.
Does anyone have an idea of how to narrow down which kind of function os Simulink block could cause this warning?
As datenwolf and Ander point out, the first thing to try is to update your drivers. If this doesn't work, and your only problem is that you're getting the warning but your graphics still render fine, then you have two other options to try.
First, you can simply modify your OpenGL rendering preferences using opengl. The following will set your preference to 'software' and save that setting for future sessions:
opengl('save', 'software');
Alternatively, you can just try to suppress that particular warning message. After you get the warning, issue this call to the warning function:
w = warning('query', 'last');
The w.identifier field will give you the ID for the warning message, which I believe will be 'MATLAB:hg:AutoSoftwareOpenGL' in this case. You can then add the following line to your startup.m file so that this warning is suppressed every time MATLAB is opened:
warning('off', 'MATLAB:hg:AutoSoftwareOpenGL');
Install the original vendor drivers for your GPU. The drivers that are installed by Windows by default lack full OpenGL support. Download the driver package directly from the website of Intel, AMD or NVidia, depending on what GPU you have.
If you don't have GPU, for example when running in a Virtual Machine, then you can not avoid that warning, because then Matlab has no other choice than falling back on the software OpenGL implementation that it ships with.
There's nothing you can do about that, other than making sure, that the system you're running Matlab on, does have proper OpenGL support!
It took me a long time to get it, so I'll put you here in case it helps how I managed to activate openGL in Linux:
If you haven't already (it's common for other problems), rename libstdc++ library from MATLAB:
mv _YOUR_MATLAB_ROOT_FOLDER_/sys/os/glnxa64/libstdc++.so.6 _YOUR_MATLAB_ROOT_FOLDER_/sys/os/glnxa64/libstdc++.so.6.bak
Create this link: sudo ln -s /usr/lib/x86_64-linux-gnu/dri/ /usr/lib/
Run export MESA_LOADER_DRIVER_OVERRIDE=YOUR_DRI_DRIVER;matlab -desktop -nosoftwareopeng
Your DRI Driver will be a file from /usr/lib/dri, removing "_dri" (in my case was the "radeons" driver for an AMD Vega graphic card.
Run MATLAB from a terminal using: export MESA_LOADER_DRIVER_OVERRIDE=_YOUR_DRIVER_HERE_;matlab -desktop -nosoftwareopengl. YOUR_DRIVER_HERE should be your driver, radeonsi in my case.
Check openGL with info = rendererinfo
If something went wrong, you will be able to see in the terminal which library was responsible. Executing 4) and 5) I was discovering what I had to correct, you can do the same if you have another problem that has not appeared to me.
So that it always runs correctly I put export MESA_LOADER_DRIVER_OVERRIDE=YOUR_DRI_DRIVER at the beginning of the script that runs matlab (_YOUR_MATLAB_FOLDER/bin/matlab), although I suppose it can also be set as an environment variable.
I hope this has been useful to you.

Is a dll to receive windows messages possible?

I'm working on a unity3d application and I need to be able to drag and drop files on it while running. Apparently this is not possible because the built .exe can't receive messages from Windows, such as wm_dropfile (which I need in this particular case).
I know that it is possible to add native code and dll's to unity, but I'm not sure whether receiving windows messages would be.
So far I have tweaked some C code to create a window that accepts files, but still have to create a dll and check if it works with unity at all.
Any knowledge or opinions on this? Have anyone tried this before?

Voice coding in Emacs on Mac OS X

I would like to be able to write code by voice recognition and him currently using Aquamacs 2.4 and Dragon Dictate 2 on Mac OS X 10.6.8. Does anybody know if this is possible and if so how? I've seen shorttalk, emacs listen, and voice code but they only work on windows machines with Dragon Naturally Speaking.
Any leads would be much appreciated.
Also I am writing in R via ESS.
Have a look at this presentation by Tavis Rudd : http://www.youtube.com/watch?v=8SkdfdXWYaI
He runs Dragon Naturally Speaking inside a Windows VM, because the Windows version can be scripted with Python. Then the VM communicates with Emacs on his local machine.
He says in the presentation he will open source his code, but it doesn't seem to be there yet on his Github.
So yes, it's possible, but at this point there is no out of the box solution. If you really want this, prepare to invests weeks or months to get to a properly working setup.
I recently released the coding-by-voice solution I created to solve my own RSI issues. It can be found here: http://www.voicecode.io
I use it mostly for coding in Sublime Text and Xcode, but it works great with emacs or vim as well. The great thing about this solution is that all commands can be chained into "command phrases" so you don't have to pause between every individual command like you do with other voice command solutions.
It has builtin support for all standard variable-name formats (snake case, camel case, etc), has builtin commands for every permutation of keyboard shortcuts (ie command-shift-5, command-option-shift-T, and so on), has cursor movement commands, app switching commands, window switching commands, commands for symbol combos like "=>", "||", ">=", etc, and tons more. Plus it is very easy to add your own custom commands as well.

FMJ, JMF civil, about a bloody headache

I am trying to write a java application that uses the web cam and I am just desperate. It feels just like mission impossible.
I have two webcams. They are recognized by Ubuntu as follows
ls /dev/vi*
/dev/video0 /dev/video1
ls /dev/v4l/by-id
usb-0471_0310_0169000099000000-video-index0
usb-Fujitsu_Siemens_Computers_FSC_WebCam_130-video-index0
they work perfectly well with any software
vlc, cheese webcam... you name it
but with java... (O M G...)
after a week of try and fail...
JMF: does not recognize these two cams, no matter what I tried.
FMJ (which seems to use civil) recognize only video0 after having installed avformat libraries
but
I can't add any device in the registry application clicking on the add device button, nothing happens
in the fmjstudio, selecting video0, I get
unknown or unsupported format: 1448695129
anyway, in all cases, I don't see how I could write something serious and usable by any kind of user who does not know how/want to install libraries and start fighting with additional packages installation
these libraries are just pure crap
a simple cat command will dump the content of the webcam stream
so does anyone knows any serious alternative to those crappy libraries?