OpenStreetMap logo OpenStreetMap

First, thanks to all who responded to my previous posts.

I know I can record one really long file and use GPX waypoints for this purpose already. That's what I'm doing now, though it's really suboptimal as it requires me to enter a waypoint on the GPS, which takes (at minimum) 3 keypresses. If I'm mapping by bicycle, this means I need to stop and get off to grab the unit from the pannier to enter the waypoint.

What I would like to do instead is what is already being done with photos, and is described here , so all I have to do is make sure my dictaphone's clock is set within a couple seconds of GPS time. With this method, I could easily leave my dictaphone in a handy location and simply tap the record/stop button without necessarily having to stop a bicycle or futz with the gps while moving (granted, I can do it without looking at it at this point despite the complete lack of tactile buttons, but it's kind of a reach and it's a pain to go through and delete all the waypoints I don't need out of it again).

I think this would be the easiest method for me since it only depends on my voice recorder's clock being accurate. The question is, how in the world do you do this with audio and not pictures? I know I need the GPX file to reference the audio files as it stands now, but that puts me in a bind of needing to read the GPX file, read the mtimes on all the wav files, then add the links to the waypoints in the track made on their respective seconds with the wav files. I'm not sure how to script it (only thing that seems to be GPX aware is python, and I'm more or less clueless there).

So why can't I just have JOSM read in the WAV files, assume the timestamps are accurate, and place them on the map accordingly based on the times in the points along the GPS trace? This would make audio mapping far easier, since then you could throw multiple traces, and a giant pile of sound files at JOSM, have it place all the audio points where they need to be, without fuss of calibration, without wasting megabytes of dead air time on the dictaphone, and without having to have the GPS do more than draw a line.

Email icon Bluesky Icon Facebook Icon LinkedIn Icon Mastodon Icon Telegram Icon X Icon

Discussion

Comment from davidearl on 4 March 2009 at 10:09

The only reason is because it isn't implemented. It's a reasonable request and something I had intended doing at some point.

However it doesn't remove the need for calibration. It depends on how your recorder works. If its clock drives both the sampling rate and the file timestamps (as is likely), then the timestamps are just as inaccurate as the sample rate and you'd associate a later audio snippet with the wrong point on the track. If the sample rate has its own clock, then you're not bothered about that one for short snippets, but the timestamps would need calibrating. It's a simple enough experiment to do and you only need do it once typically. The same is true of timestamps on photos by the way - if your camera clock runs fast or slow, by even a tiny amount, you'll be off by tens or hundreds of metres in only a couple of hours. That's independent of synchronising, where the clocks are unlikely to coincide unless you've taken some care to set them that way, but run at a different rate. BTW, each second of difference in the synchronisation amounts to maybe 5-6m on the ground when mapping by bike.

I fully understand the problem with having to press lots of buttons. My old GPS was like that. Inow use a Nokia N810 with a modified version of its Maemo Mapper program so I can stab the screen anywhere to get a numbered waypoint on the move. But equally, aren't you having to turn the recorder on and off the way you're doing it?

It's time I revisited some of the audio stuff.

David

Comment from Mungewell on 4 March 2009 at 19:36

Whilst you are waiting for JOSM to be improved....

--
$ cat strip_times.awk
{
if (first_time == 0)
{
# aiming at something like 2007-12-09T14:44:25Z
print strftime("%FT%T%Z", $1);
first_time = $1;
}

print strftime("%M:%S", $1 - first_time), $2;
}

$ find . -name '*.wav' -exec stat --format='%Z %n' {} \; | sort -n | awk -F ' ' -f strip_times.awk > events.txt

$ cat events.txt
2009-03-04T11:54:26MST
00:00 ./sample1.wav
00:04 ./sample2.wav
00:08 ./sample4.wav
00:11 ./sample3.wav
--

This should be passed to GPS event sync, which will produce a GPX output something like
--


14.0764
00:00 ./sample1.wav


16.4797
00:04 ./sample2.wav


18.4023
00:08 ./sample4.wav


15.0377
00:11 ./sample3.wav


15.0377
00:11 ./sample3.wav

--

If I remember correctly JOSM will play the audio contained in waypoints if the 'name' marker is replaced with 'link'.

Have fun,
Mungewell.

Comment from Mungewell on 4 March 2009 at 19:45

Whoops that GPX file didn't show all the tags... must have been stripped rather than escaped. :-(

Regarding the accuracy of the timestamps, the recordings might be made on a system (laptop?) with NTP hooked into the GPS receiver's 1PPS output. They could be very accurate.

Munge.

Comment from Mungewell on 5 March 2009 at 00:44

I wrote this up and put on the Audio Mapping discussion page, if you can confirm that it works I'll promote it to the main page.

Cheers,
Mungewell.

Comment from LivingWithDragons on 5 March 2009 at 12:49

I had started writing some Java code to read a folder of audio files and adjust a gpx file to include the link tag to the relevant audio file (with the interntion to then get it incorporated into JOSM).

I had some trouble writing the changes to the gpx file and ended up stopping at this stumble.
The driver I use to pull files from my dictaphone to linux, resets the file datestamps (although it cant read them), so this took away some motivation to persevere with the coding.

Log in to leave a comment