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 audio…

0

Generating sample first names

I had a need to write a script that would give me a random first name.  I grabbed the top 200 first names for baby boys in the US from 2000-2009, and the same list for baby girls: http://www.ssa.gov/OACT/babynames/decades/names2000s.html Boys Girls Jacob Emily Michael Madison … … My initial implementation just printed out the name,…

0

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, prefer that…

0

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 on all monitors…

1

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(n2) algorithm to read the text from STDIN! It looked something like this:…

0

Finding the longest substring which occurs twice in a given string

I’m reading Jon Bentley’s Programming Pearls and one of the interesting exercises was to find the longest substring which occurs twice in a given string of length n. There’s a naïve solution where you look at every pair of (distinct) indexes (i, j), and calculate the length of the common prefix of the substrings starting at those locations;…

2

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. I wrote a quick app to enumerate…

0

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 attached. Pseudocode: midiInGetNumDevs or midiOutGetNumDevsfor each device    midiInGetDevCaps or midiOutGetDevCaps   …

2

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;…

2

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 a single argument as text, and then uses the ISpVoice…

0