How to write a leading apostrophe in Word

Disclaimer: I don’t work on the Office team. Word has a smart quotes feature where it will automagically transform straight “double quotes,” ‘single quotes,’ and greengrocer’s apostrophes into curly “double quotes,” ‘single quotes,’ and greengrocer’s apostrophes as you type.  You send a Unicode Character ‘APOSTROPHE’ (U+0027) to Word, and Word turns it into a Unicode Character ‘LEFT SINGLE…

4

Phase and stereo-to-mono downmix

Warning: trigonometry ahead. Last time we looked at how to downmix a stereo signal to mono (M = L/2 + R/2).  The resulting M signal can only be as powerful as the L and R signals if they are perfectly correlated (L = R); if the L and R signals are uncorrelated (no relationship between…

3

Perl script to parse MPEG audio header

I’ve written a perl script (attached) which will parse MPEG audio headers and display them in a human-readable format. For example, if you run it on ding.mpeg (also attached) you get this output: >perl mpegaudioheader.pl ding.mpeg Frame header: 11111111 111 (should be all ones) MPEG Audio version ID: 11 (MPEG version 1 (ISO/IEC 11172-3)) Layer…

1

optimal tic-tac-toe (XKCD)

Today’s XKCD strip purports to show a complete map of tic-tac-toe including optimal moves. I’m guessing the optimality of the move takes into account both the game-theoretic value of the move, assuming a perfect opponent: Good moves Preserves the win Preserves the draw “Preserves the loss” (every move in a lost position is of this type)…

1

Downmixing stereo to mono

Suppose you have a stereo stream that you want to downmix to mono.  Why would you do this?  Maybe you’re playing stereo music to a Bluetooth headset that is in a call, and thus in “headset / handsfree” mode.  Maybe you’re capturing from a stereo mic and you want to show a visualization based on a…

1

UI text flow of various languages

This point came up today in a spec review. The text had language like “put the choices 1-N in rows of three, starting with 1 in the top left corner of the screen, and in rows of three to four going down the screen.” Western Europeans and ‘mericans (like me) are accustomed to text layout…

1

Troubleshooting: how to install the Microsoft HD Audio class driver

Most on-the-motherboard audio devices support the Intel High Definition Audio standard.  Windows Vista (and later) includes a “class driver”, hdaudio.sys, which should work with any such audio device. Usually systems come with a vendor-supplied driver installed.  This driver is designed specifically for the hardware it runs on (as opposed to being designed to the standard) and so it comes…

155

How to enumerate WASAPI Audio Processing Objects (APOs) on your system

Source and binaries (amd64 and x86) attached. Pseudocode: main() {    UINT32 nCount;    EnumerateAPOs(myCallback, &nCount);    print nCount;} … // called once for each APOmyCallback(PAPO_REG_PROPERTIES props, PVOID pnCount) {    print props;    (*pnCount)++;} Gotcha: the APO_REG_PROPERTIES structure is variable-size.  If you want to store the structure for later use, you need to make the copy before the callback…

1

How to enumerate Audio Compression Manager (ACM) drivers on your system (spot the bug!)

Source and binaries (amd64 and x86) attached. Pseudocode: list acm_drivers;acmDriverEnum( myCallbackFunction, &acm_drivers, …);    // myCallbackFunction(driver, pacm_drivers) { pacm_drivers->add(driver); }for each driver in (acm_drivers) {    details = acmDriverDetails(driver);    print details;} Output on my system – spot the bug! >acmenum.exeACM Drivers found: 6— ACM Driver Details: Microsoft IMA ADPCM —    cbStruct: 1804    fccType: 0x63647561 (audc)    fccComp: 0x00000000…

0

How to enumerate DirectSound DirectX Media Objects (DMOs) on your system

Source and binaries (amd64 and x86) attached. Pseudocode: GUID dmo_categories[] = { … }for (each guid in dmo_categories) {    IEnumDMO = DMOEnum(guid, DMO_ENUMF_INCLUDE_KEYED, …);    while (0 != items fetched by IEnumDMO::Next(&iid, &szName…)) {       print iid, szName    }} Output on my system: >dmoenum.exe— Audio decoders ({57F2DB8B-E6BB-4513-9D43-DCD2A6593125}) —WMAudio Decoder DMO ({2EEB4ADF-4578-4D10-BCA7-BB955F56320A})WMAPro over S/PDIF DMO ({5210F8E4-B0BB-47C3-A8D9-7B2282CC79ED})WMSpeech Decoder DMO…

0