Browse by Tags

Tagged Content List
  • Blog Post: Troubleshooting default audio device heuristics

    In Windows 7 we published a white paper which shows how Windows chooses which audio device should be the default . This remains true for Windows 8 and Windows 8.1. The six factors that are considered for each device are: Jack detection capability Whether KSJACK_DESCRIPTION2.JackCapabilities...
  • Blog Post: A mental model for the Windows Phone AudioRoutingManager API

    The Windows Phone SDK includes a Windows.Phone.Media.Devices.AudioRoutingManager API which I had occasion to use. The API allows apps that have communication audio streams (e.g., Voice over IP calls) to control whether the audio goes out over the earpiece, over the speakerphone, or over the Bluetooth...
  • Blog Post: shellproperty.exe v2: read all properties on a file; set properties of certain non-VT_LPWSTR types

    I updated my toy app to set/read shell properties from the command line . New features: Read all the properties from a given file in one go. Recognize properties by their canonical name (if they have one.) Set a property to VT_EMPTY (removing it), or "VT_VECTOR | VT_LPWSTR", or VT_UI4, in...
  • Blog Post: Sample app for RECT functions

    Riffing on Raymond Chen's post today about SubtractRect I threw together a toy app which demonstrates three rectangle functions: UnionRect, IntersectRect, and SubtractRect. Usage: >rects.exe rects.exe union (left1 top1 right1 bottom1) (left2 top2 right2 bottom2) | intersect (left1 top1 right1...
  • Blog Post: shellproperty.exe - set/read string properties on a file from the command line

    Yesterday Raymond Chen blogged a "Little Program" which could edit audio metadata . As it happens, I have a similar tool I threw together which accepts a property key and a string property value to update a property, or can read a string or string-vector property. Usage: >shellproperty shellproperty...
  • Blog Post: Getting the package full name of a Windows Store app, given the process ID

    Last time I talked about enumerating audio sessions and showed an example which listed several Desktop apps and one Windows Store app. Session instance identifier: {0.0.0.00000000}.{125eeed2-3cd2-48cf-aac9-8ae0157564ad}|\Device\HarddiskVolume1\Windows\System32\WWAHost.exe%b{00000000-0000-0000-0000...
  • Blog Post: More on IAudioSessionControl and IAudioSessionControl2, plus: how to log a GUID

    A while back I blogged about using IAudioSessionControl and IAudioSessionControl2 to get a list of active sessions, and then using IAudioMeterInformation to see what the amplitude level of the audio being played from each session was . I decided to go back and push this a little further and see what...
  • Blog Post: Buffer size alignment and the audio period

    I got an email from someone today, paraphrased below: Q: When I set the sampling frequency to 48 kHz, and ask Windows what the audio period is, I get exactly 10 milliseconds. When I set it to 44.1 kHz, I get very slightly over 10 milliseconds: 10.1587 milliseconds, to be precise. Why? A: Alignment...
  • Blog Post: Grabbing the output of the Microsoft Speech API text-to-speech engine as audio data

    A while ago I wrote a post on Implementing a "say" command using ISpVoice from the Microsoft Speech API which showed how to use Speech API to do text-to-speech, but was limited to playing the generated audio out of the default audio device. Recently on the Windows Pro Audio forums, user falven asked...
  • Blog Post: How to dump Speech API object properties

    Stamatis Pap asked in a forum thread how to use a Speech API ISpVoice with a non-default audio device . This MSDN article shows how to use SpEnumTokens to list all the currently active audio outputs, but the number and order of audio outputs is subject to change as things come and go, or as the default...
  • Blog Post: Programmatically adding a folder to a shell library (e.g., the Music library)

    I wrote a selfhost tool which allows me to add a folder (for example, C:\music) to a shell library (for example, the Music library.) This was before I found out about the shlib shell library sample which Raymond Chen blogged about . If you're looking for a sample on how to manipulate shell libraries...
  • Blog Post: Changing the desktop wallpaper using IDesktopWallpaper

    About a year ago I wrote about how to change the desktop wallpaper using SystemParametersInfo(SPI_SETDESKWALLPAPER) . Windows 8 desktop apps (not Store apps) can use the new IDesktopWallpaper API to get a more fine level of control. So I wrote an app which uses the new API, though I just set the background...
  • Blog Post: Grabbing large amounts of text from STDIN in O(n) time

    Last time I blogged about an O( n log n ) solution to finding the longest duplicated substring in a given piece of text ; I have since found an O( n ) algorithm, which I linked to in the comments. But my blog post used an O( n 2 ) algorithm to read the text from STDIN! It looked something like this...
  • Blog Post: Enumerating mixer devices, mixer lines, and mixer controls

    The WinMM multimedia APIs include an API for enumerating and controlling all the paths through the audio device; things like bass boost, treble control, pass-through audio from your CD player to your headphones, etc. This is called the "mixer" API and is the forerunner of the IDeviceTopology API. ...
  • Blog Post: Enumerating MIDI devices

    In addition to audio playback and recording, Windows Multimedia (WinMM) provides a Musical Instrument Digital Interface (MIDI) API . Here's how to make a list of all the MIDI devices on the system, their capabilities, and the hardware device interface associated with each of them. Source and binaries...
  • Blog Post: Implementing a "listen" command using ISpRecoContext from the Microsoft Speech API

    Earlier today I posted a quick "say.exe" sample app which you give text and it speaks the text aloud using the text-to-speech part of the Windows Speech API. It was very straightforward - only 67 lines of C++ code. It took me a little longer to figure out how to do this "listen.exe" sample app; you...
  • Blog Post: Implementing a "say" command using ISpVoice from the Microsoft Speech API

    I've known for a while that Microsoft Windows comes with text-to-speech and speech-to-text APIs, which power the Narrator and Speech Recognition features respectively. This forum post prompted me to mess around with them a little. I came up with this implementation of a say.exe command which takes...
  • Blog Post: Getting audio peak meter values for all active audio sessions

    The Windows Vista volume mixer shows a peak meter for the device. In Windows 7 we added a peak meter for each application. The audio interface for both is IAudioMeterInformation ; I've used this before in my post about the linearity of Windows volume APIs . This post showed how an application can...
  • Blog Post: Programmatically rearranging displays

    Most of my test machines and my laptop have a single display; but I have two dev machines which are each connected to two displays. When I clean install Windows, I sometimes need to rearrange the displays: Since I clean install Windows frequently, I wrote myself a little C++ app which does this...
  • Blog Post: unattend.xml: turning on Remote Desktop automatically

    Here are the portions of my unattend.xml file which are needed to turn on Remote Desktop automatically. This piece flips the "no remote desktop" kill switch to "allow." <settings pass="specialize"> ... <component name="Microsoft-Windows-TerminalServices-LocalSessionManager" ...> <fDenyTSConnections>false<...
  • Blog Post: Sample: how to enumerate waveIn and waveOut devices on your system

    This shows how to call waveInGetNumDevs, waveInGetDevCaps, waveOutGetNumDevs, and waveOutGetDevCaps. // main.cpp #include <windows.h> #include <mmsystem.h> #include <stdio.h> #define LOG(format, ...) wprintf(format L"\n", __VA_ARGS__) int _cdecl wmain() { UINT devs...
  • Blog Post: My unattend.xml file

    As a tester on Windows 8 I install Windows on my dev machine very frequently. I use F12 to boot from the network into WinPE, then I run a .bat file which looks something like this: @echo off setlocal enabledelayedexpansion set PASSWORD_ADMIN=(redacted) set PASSWORD_MATEER=(redacted) set LICENSE_KEY...
  • Blog Post: Programmatically setting a local user account to never expire its password

    As a Windows tester, I install Windows on my own machines a lot (this is known internally as "selfhosting", or "dogfooding", or "ice cream-ing".) One of my little idiosyncracies is I like to run as a non-administrative user. That is, I don't add my domain account to the local Administrators group...
  • Blog Post: Programmatically grabbing a screenshot of the primary display

    It's sometimes difficult to explain to people what my job actually is. "I test Windows sound." "Cool. How does that work?" A product like Windows has a lot of components that interact with each other. If everything works, the user doesn't know that most of these components even exist; everything is...
  • Blog Post: Command-line app to set the desktop wallpaper

    Working on Windows, I find myself installing Windows a lot. I find that I like to change a lot of the settings that Windows offers to non-default values . (That is, I'm picky.) I have a script which automates some of these things, which I add to now and again. Some of the bits of the script are...
Page 1 of 3 (57 items) 123