Archive for the ‘RecAll-PRO’ Category.

File Extensions in MRU

The MRU (Most Recently Used) section of a Files menu shows files that were recently opened by an application. The default Windows way of displaying file names is to omit file extensions. This can become confusing when the application can handle several different file extensions. As an example, how do you distinguish between MP3 and WAV files in RecAll-PRO?

Even as the program creator, I wasn’t sure how to change this behavior without digging deep into the source code. Like most coders, I use a framework, a wrapper around the Windows API (Applications Programming Interface) to ease programming tasks. Delving in the framework source code, we discover the MRU menu item uses the Windows API GetFileTitle function.

GetFileTitle returns the string that the system would use to display the filename to the user. The display name includes an extension only if that is the user’s preference for displaying file names. This means that the returned string may not accurately identify the file if it is used in calls to file system functions.

Getting closer. How do we turn on display of file extensions? The answer is not exactly obvious. In Windows Explorer, click on menu Tools -> Folder Options -> View, and look under Advanced settings for “Hide extensions for known file types“. Un-select this item. MRUs for our application will now show extensions. (check for xp)

Here is how our MRU menu looks with file extensions displayed:

I notice that some other applications always display MRU file extensions, no matter the user preference setting. Should we change this behavior for our programs?

Pro Birthday

RecAll-PRO version 1.0 was released ten years ago today.

A spin-off from standard RecAll with many advanced features, PRO became our best-selling public software product within a few months, and has remained so to this day.

RecAll-PRO v1.0

RecAll-PRO Now

Related Posts: Happy Birthday First Product

Recording the Recorders

News item from last month:

A teen suspect’s snap decision to secretly record his interrogation with an MP3 player has resulted in a perjury case against a veteran detective and a plea deal for the teen. …

[via Schneier] The discussion on Schneier’s blog for this item (and most others) is worth reading.

Y2.038K Alert

On January 19, 2038, RecAll-PRO (and RecAll and to a lesser extent VCRadio) will display a bug. (Of course, we will issue a software update well before then to correct the problem.) A number of other programs from other companies will also develop problems. It won’t make big news like Y2K, but it is a detail needing correction in multiple software packages. Why 2038? How did we come to this? Why didn’t we fix this when fixing Y2K?

The discussion gets a bit technical, so if you aren’t familiar with binary arithmetic, feel free to skip ahead.

The Problem

The C run-time library, widely used by C and C++ programmers, provides a function for reading the current time:

time_t time(time_t *timer);

which returns the time as elapsed seconds since midnight January 1, 1970, the year that Unix first ran on a PDP-11/20 machine. In the parlance of programmers, time_t is a type definition, with data size not defined by the Posix standard but typically implemented as a 32 bit signed integer. The maximum date that coud be specified with this representation is Tuesday, January 19, 2038. Increment past that date and the variable will “overflow” to a negative number, representing the year 1901.

Using a time/date system representing seconds from a known obscure date might seem eccentric to non-programmers, but coders do this sort of thing all the time. The Windows operating system defines a FILETIME variable as a signed 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601. (Why 1601?) Java Date uses a signed 64-bit integer counting milliseconds from January 1, 1970. .NET DateTime uses an unsigned 62 bit (yes, 62) integer counting 100 nanosecond ticks from January 1, year 0001.

RecAll-PRO (and RecAll and VCRadio) use Unix time to store timecodes for audio files, to represent the date and time when sound was recorded. A number of other programs will also affected by the problem, variously known as Y2038 or Y2.038K.

Testing

Setting the computer clock forward to February 2038, we verify that RecAll-PRO has problems displaying the proper time. The date display fails, so RecAll-PRO “gracefully” degrades to displaying relative time position.

We wanted to know if our current C compiler could use time_t variables larger than 32 bits, or could work with a 32 bit unsigned number, so we could extend beyond year 2038, so we wrote a quick test program. The answer is NO.

Out of curiosity, we wrote a quick program to display the maximum FILETIME possible. Unfortunately, the FileTimeToSystemTime function only works for half the maximum range of FILETIME, so we use that instead:

#include <stdio.h>
#include <windows.h> int main(int argc, char* argv[])
{
FILETIME ft;
// MSDN: “The FileTimeToSystemTime function only works with FILETIME values
// that are less than 0×8000000000000000.”
ft.dwHighDateTime = 0x7ffffffful;
ft.dwLowDateTime = 0xfffffffful;

SYSTEMTIME st;
if (FileTimeToSystemTime(&ft,&st))
printf(“Maximum filetime date: month=%d day=%d, year=%d\n”, st.wMonth,st.wDay, st.wYear);

return 0;
}

Maximum filetime date: month=9 day=14, year=30828
Press any key to continue

Year 30828 should be large enough for our purposes. :-) If you need larger dates, please let us know.

The Fix

We use a Microsoft C++ compiler for development work, but not their most recent product. Microsoft documentation notes that Visual C++ 2005 is the first Microsoft compiler to use signed 64 bit integers for the time() function, which should fix the problem.

If we decide not to update compilers, we could write our own version of time() that accepts 64 bit integers, perhaps using FILETIME internally.

When Time Stamps Go Bad 2

News.com reports Ohio electronic voting machines have privacy issues involving time stamps.

“Two Ohio activists have discovered that e-voting machines made by Election Systems and Software and used across the country produce time-stamped paper trails that permit the reconstruction of an election’s results–including allowing voter names to be matched to their actual votes.” — Declan McCullagh, News.com

Our recording products have timecodes embedded in the audio files. Of course, our software is not involved in elections, but Sagebrush customers have imaginative applications, from security monitoring to documenting barking dogs to demonstrating a sleeping-partner snores. Given the news item shown here, can anyone think of a way that audio timecodes could cause an unplanned privacy problem?

Related post: When Time Stamps Go Bad

Recording in the News 2

IEEE Spectrum has a first-class technical summary of the Vodafone Greece cellphone wiretapping scandal. This story has it all: apparent suicide, wiretapping of conversations with key high level politicians and officials, rogue software, destroyed logs, subversion of wiretapping capability originally implemented for law enforcement requirements.

(huzzah! Schneier)

Previously: Recording in the News

Double Audio Inputs

How could one record left and right audio channels to separate files?

RecAll-PRO version 1.5 or later has an undocumented (until now) command-line option to record only from left or right channel of an audio signal.

<path>/RecallPro.exe -C Left

<path>/RecAllPro.exe -C Right

The program should be configured to record Mono audio for this option. (Command-line parameters are not case sensitive here.)

Windows XP and Vista allow more than one program to record from the same audio input device. If we start two instances of RecAll-PRO, one recording from the left channel and the second recording from left channel, we should be able to record from two mono audio sources into two separate audio files, using one sound input device. This could be useful for applications that monitor several inputs, such as recording multiple telephone lines or multiple radio stations.

In practice, we need an input audio device with little or no crosstalk between left and right channels. We tested a sound card some years ago with significant channel-to-channel crosstalk, but recent tests with modern sound cards show no audible crosstalk. To test, we need to build a simple two-mono to one-stereo adapter:

Male 3.5mm (1/8″) audio plugs are RadioShack 274-284, and the female jack is RS 274-274. Label one male plug “L”, and the other “R”. Connect grounds of all three connectors together, and left of female to left (or right) of “L”, and right channel of female to right (or left) of “R”. (We assume balanced audio sources for the present.)

(Read rest of article.)

Recording in the News

Recording traffic stop results in felony charge. Link [via]

Passenger tapes interview with pilot and questions flight delay. Link [via]

Bike theft recording transformed into music video. Link [via]

Privatized downtown may prohibit photos/recording. Link [via]

Parents’ voice-activated recorder not admissible as evidence against bus driver. Link

R3c0rd phr0m H3ad53t C0nn3ct0r

Just for kicks, we wanted to see what one of our previous posts would look like if translated in “simple hax0r”, using a translator found on DeGraeve.com.

Th3 0th3r day 50m30n3 call3d w1th an 1nt3r35t1ng pr0bl3m. H3 want3d t0 r3c0rd ht3 phar 51d3 uv a t3l3ph0n3 c0nv3r5at10n u51ng h1z lapt0p 50und d3v1c3, and h3 d1d n0t hav3 acc35z t0 a r3gular t3l3ph0n3 l1n3 t0 u53 0n3 uv ht3 t3l3ph0n3 r3c0rd1ng 1nt3rphac3z d35cr1b3d h3r3. H3 waz u51ng a V01P ph0n3 d3v1c3 that plugz 1nt0 a U5B p0rt, 50 n0 r3gular P0T5 l1n3 1z 1nv0lv3d. ht3 d3v1c3 pr0v1d3z a c0nn3ct0r ph0r a 5tandard t3l3ph0n3 h3ad53t, wh1ch c0mb1n3z m1cr0ph0n3 and 3arph0n35. 1n add1t10n, h3 want3d t0 5t1ll b3 abl3 t0 u53 h1z t3l3ph0n3 h3ad53t wh1l3 r3c0rd1ng, and k33p 3v3ryth1ng l0w-c05t, av01d1ng 50ld3r1ng 1ph p0551bl3.

1n th1z art1cl3 w3 d35cr1b3 a ph3w 51mpl3 d0-1t-y0ur53lph r3c0rd1ng 50lut10nz ph0r h3ad53t5. Th1z 1z al50 appl1cabl3 ph0r r3c0rd1ng phr0m a c3ll ph0n3 0r c0rdl35z ph0n3 w1th h3ad53t c0nn3ct0r, az w3ll az ht3 V01P ph0n3 d35cr1b3d ab0v3. Th353 50lut10nz m1ght N0T w0rk w1th land-l1n3 ph0n3z hav1ng h3ad53t c0nn3ct0r5, b3cau53 uv p0551bl3 gr0und l00p pr0bl3m5. W3 w1ll c0v3r th053 ph0n3z 1n a lat3r tut0r1al. Wh3n p0551bl3, w3 g1v3 Rad10 5hack part numb3r5– wh3r3 0mn1pr353nc3 c0untz m0r3 than qual1ty.

T3chn1cal Backgr0und

T3l3ph0n3 h3ad53tz m05t 0pht3n u53 2.5mm (3/32?) mal3 c0nn3ct0r5, 5mall3r than ht3 3.5mm (1/8?) aud10 c0nn3ct0rz ph0und 0n y0ur c0mput3r. H3r3 1z ht3 p1n-0ut uv ht3 h3ad53t plug:

C0mpar3 th1z t0 ht3 p1n-0ut uv y0ur l1n3-1nput c0nn3ct0r:

and m1cr0ph0n3 c0nn3ct0r:

V0ltag3 l3v3lz ph0r L1n3-1n R 0n ht3 0rd3r uv 1V0lt, and ht3 v0ltag3 l3v3l uv a m1cr0ph0n3 1z 0n ht3 0rd3r uv 10-100mV.

3xp3r1m3nt1ng w1th tw0 d1phph3r3nt c3ll ph0n3z and tw0 m0d3lz uv c0rdl35z ph0n3, w3 ph1nd ht3 5p3ak3r-ph0n3 1z d15abl3d wh3n ht3 h3ad53t plug 1z 1n53rt3d, pr3v3nt1ng uz phr0m m0n1t0r1ng ht3 ph0n3 call wh1l3 ht3 h3ad53t c0nn3ct0r 1z plugg3d, u51ng ht3 5am3 ph0n3.

51d3t0n3 r3ph3rz t0 ht3 phact that aud10 that w3 5p3ak 1n ht3 t3l3ph0n3 m1cr0ph0n3 1z add3d t0 what w3 h3ar at ht3 t3l3ph0n3 3arp13c3. Th1z 1z u53d az ph33dback 50 w3 d0n’t talk t0 l0ud and d15t0rt aud10, but m0r3 1mp0rtantly ph0r th1z appl1cat10n, th1z all0wz uz t0 r3c0rd ht3 aud10 at ht3 3arp13c3 and g3t b0th 51d3z 0ph ht3 c0nv3r5at10n.

(R3ad r35t uv art1cl3.)

Record from Headset Connector

The other day someone called with an interesting problem. He wanted to record the far side of a telephone conversation using his laptop sound device, and he did not have access to a regular telephone line to use one of the telephone recording interfaces described here. He was using a VOIP phone device that plugs into a USB port, so no regular POTS line is involved. The device provides a connector for a standard telephone headset, which combines microphone and earphones. In addition, he wanted to still be able to use his telephone headset while recording, and keep everything low-cost, avoiding soldering if possible.

In this article we describe a few simple do-it-yourself recording solutions for headsets. This is also applicable for recording from a cell phone or cordless phone with headset connector, as well as the VOIP phone described above. These solutions might NOT work with land-line phones having headset connectors, because of possible ground loop problems. We will cover those phones in a later tutorial. When possible, we give Radio Shack part numbers– where omnipresence counts more than quality.

Technical Background

Telephone headsets most often use 2.5mm (3/32″) male connectors, smaller than the 3.5mm (1/8″) audio connectors found on your computer. Here is the pin-out of the headset plug:

Compare this to the pin-out of your line-input connector:

and microphone connector:

Voltage levels for Line-In are on the order of 1Volt, and the voltage level of a microphone is on the order of 10-100mV.

Experimenting with two different cell phones and two models of cordless phone, we find the speaker-phone is disabled when the headset plug is inserted, preventing us from monitoring the phone call while the headset connector is plugged, using the same phone.

Sidetone refers to the fact that audio that we speak in the telephone microphone is added to what we hear at the telephone earpiece. This is used as feedback so we don’t talk to loud and distort audio, but more importantly for this application, this allows us to record the audio at the earpiece and get both sides of the conversation.

(Read rest of article.)