[File] [PATCH] of Magdir/audio for Garmin Voice Processing Module (WAVE audios variant update *.vpm)

Jörg Jenderek joerg.jen.der.ek at gmx.net
Tue Jan 8 23:47:17 UTC 2019


Hello,

some days ago i run file command version 5.35 on Garmin Voice Processing
Module (*vpm) variant with WAVE audios.

This format start with magic "AUDIMG" and is already handled by
Magdir/audio. This format  for non text-to-speech (TTS) contain hundreds
of WAV audios. For every phrase like "turn left" a wav file is stored.
This is visible by looking for magic RIFF (handled by Magdir/riff) via lines
 >>>(16.s)	ulelong		>0	\b, at offset 0x%x
 >>>>(16.s+4)	ulelong		>0	%d Bytes
 >>>>>(&-8.l)	string		RIFF
 >>>>>>&-4	indirect	x	\b

Unfortunately with these lines i get ugly looking phrase "BytesRIFF"
without a seperating space character between "Bytes" and "RIFF" like in
sample output like:

Deutsch__.vpm:     Garmin Voice Processing Module, version 220,
	20.10.2005 07:58:48, language ID 1,
	at offset 0x97c 220544 BytesRIFF (little-endian) data,
	WAVE audio, Microsoft PCM, 16 bit, mono 22050 Hz
Hrvatski__.vpm:    Garmin Voice Processing Module, version 200,
	20.07.2006 09:22:25, language ID 23,
	at offset 0x8e0 13116 BytesRIFF (little-endian) data,
	WAVE audio, IMA ADPCM, mono 22050 Hz
Polski__.vpm:      Garmin Voice Processing Module, version 200,
	01.05.2006 16:44:34, language ID 11,
	at offset 0x8e8 2250 BytesRIFF (little-endian) data,
	WAVE audio, Microsoft PCM, 16 bit, mono 22050 Hz

So i add an extra space after word "bytes" in message text.
 >>>>(16.s+4)	ulelong		>0	%u bytes
I also made some cosmetic changes. Instead capitalized word "Bytes"
use low case word "bytes". To get output columns low i remove the word
"offset" by replaced magic line
 >>>(16.s)	ulelong		>0	\b, at 0x%x

Some clever programmers like "turboccc" recognize the embedded wav
format and build their own audio tools to manipulate VPM files.
The file format of such VPM files was described on web page of this
programmer. Unfortunately the web site turboccc.wikispaces.com does not
exist any more. I search on the net and also look at wayback archive,
but the forum entry about that VPM variants is vanished.
At least i found a forum entry at poi-factory.com with parts of the
original information. So i replace the old reference URL by
http://www.poi-factory.com/node/19580 .
On that site there was something written about bytes at offset 19.
But i can not verify that information. So i add magic lines concerning
bytes at offset 19 only as comments.

After applying the above mentioned modifications by patch
file-5.35-audio-garmin-wav.diff then all inspected examples are now
described with phrase separated by an empty space like:

Deutsch__.vpm:     Garmin Voice Processing Module, version 220,
	20.10.2005 07:58:48, language ID 1,
	at 0x97c 220544 bytes RIFF (little-endian) data,
	WAVE audio, Microsoft PCM, 16 bit, mono 22050 Hz
Hrvatski__.vpm:    Garmin Voice Processing Module, version 200,
	20.07.2006 09:22:25, language ID 23,
	at 0x8e0 13116 bytes RIFF (little-endian) data,
	WAVE audio, IMA ADPCM, mono 22050 Hz
Polski__.vpm:      Garmin Voice Processing Module, version 200,
	01.05.2006 16:44:34, language ID 11,
	at 0x8e8 2250 bytes RIFF (little-endian) data,
	WAVE audio, Microsoft PCM, 16 bit, mono 22050 Hz

I hope my diff file can be applied in future version of file utility.

With best wishes
Jörg Jenderek
-- 
Jörg Jenderek





-------------- next part --------------
--- file-5.35/magic/Magdir/audio.old	2018-10-19 00:35:42 +0000
+++ file-5.35/magic/Magdir/audio	2019-01-08 22:17:18 +0000
@@ -745,5 +745,5 @@
 # From:		Joerg Jenderek
 # URL:		http://www.garmin.com/
-# Reference:	http://turboccc.wikispaces.com/share/view/28622555
+# Reference:	http://www.poi-factory.com/node/19580
 # NOTE:		there exist 2 other Garmin VPM formats
 0		string	AUDIMG
@@ -769,13 +769,23 @@
 # you can only select voice modules with corresponding language byte ID like 1
 >>18		ubyte		x	\b, language ID %d
+# structure for phrases/sentences?
+# number of voice sample in the 1st phrase?
+#>>19		uleshort		x	\b, 0x%x samples
+#>>>21		uleshort		>0	\b, at 0x%4.4x
+#>>>(21.s)	ubequad			x	0x%llx
+# 2nd phrase?
+#>>23		uleshort		x	\b, 0x%x samples
+#>>>25		uleshort		>0	\b, at 0x%4.4x
+#>>>(25.s)	ubequad			x	0x%llx
 # pointer to 1st audio WAV sample
 >>16		uleshort	>0
->>>(16.s)	ulelong		>0	\b, at offset 0x%x
+>>>(16.s)	ulelong		>0	\b, at 0x%x
 # WAV length
->>>>(16.s+4)	ulelong		>0	%d Bytes
+# 1 space char after "bytes" to get phrase "bytes RIFF"
+>>>>(16.s+4)	ulelong		>0	%u bytes 
 # look for magic
 >>>>>(&-8.l)	string		RIFF
 # determine type by ./riff
->>>>>>&-4	indirect	x	\b
+>>>>>>&-4	indirect	x
 # 2 - ~ 131 WAV samples following same way
 


More information about the File mailing list