You currently have javascript disabled. Several functions may not work. Please re-enable javascript to access full functionality.

Seismograph Script Kludge (MCI and FMOD)

Started by
fredinga
, Jan 05 2010 10:10 PM

Please log in to reply

4 replies to this topic

fredinga

Members

32 posts

Last active: Dec 07 2011 05:08 PM

Joined: 26 Jul 2009

I am working on a project to be put on the <!-- w -->www.instructables.com<!-- w --> site. My instructable will describe how to make a two-axis, mass-driven, moving-coil seismometer. (I more-or-less took a cheap stereo pair of unamplified speakers, glued fishing sinkers to each one, sealed each speaker in a plastic bubble and put them in a gallon container filled with sand.)

The seismometer plugs into the microphone input jack of the computer and that is where I could use some help. I need event detecting and recording software (written in AHK of course).

What I have so far is a combination of the MCI audio recording script written by jballi (Forum #35266) and the FMOD sound analysis program written by SKAN (Forum #28117). This kludge works well enough to get the idea across, but it has many obvious shortcomings. For example, half the time it is analyzing data and so it is not "listening" for input from the seismometer.

(Note: Any microphone or unamplified speaker(s) plugged into the mic jack on your sound card will work with this script for demo purposes.) You will need FMOD.DLL (159 KiB) and MCI.AHK (44 KiB)along with SEISMOMF.AHK (4 KiB). I run the script from a flash drive so there aren't constant hits on the HDD.

What I want to do is either get a microphone input stream within SKAN's FMOD audio-level script (Note 1) or find a way to determine audio levels in jballi's MCI recorder (Note 2) or stream the output of the MCI recorder to the FMOD analyzer (Note 3). Help with any of these approaches would be very welcome.

Note 1: I have tried to use the recording examples in the FMOD docs to stream data to SKAN's script. But (so far) I can't make the transition from the C++ or VBasic examples to Skan's cool AHK script.

Note 2: I have gone to the Microsoft MCI docs referenced by jballi. I don't find any level-measuring functions listed that might help with this project.

Note 3: The recorded stream is held in the "hMedia" string in the MCI recorder, but this doesn't appear to be formatted in a way that the FMOD analyzer can digest directly.

Here is another script that I have been using to monitor the seismometer. It uses the SoX API that runs from a command line. You can download the three SoX DLLs you need from http:\\sox.sourceforge.net.