[asterisk-users] Voice mail does not contain a time?

Steve Edwards asterisk.org at sedwards.com
Tue Apr 21 13:15:23 CDT 2009


On Tue, 21 Apr 2009, Tzafrir Cohen wrote:

> WAV is a pretty simple container format. The length is written in a very
> expected place in the header:
>
>  http://en.wikipedia.org/wiki/.wav
>  http://ccrma.stanford.edu/courses/422/projects/WaveFormat/
>
> E.g. the following:
>
> wav_size() {
> 	LANG=C cut -b 41-44 "$1" | head -n 1 | hexdump -e "\"$1:"'$1: %u\n"' | head -n 1
> }

Or:

 	wav_size()
 	        {
 	        dd bs=1 count=4 if="$1" skip=40 2>/dev/null\
 	                | hexdump -e "\"$1:"'$1: %u\n"'
 	        }

Or, if hexdump's "-s" did what the man page says it did:

 	wav_size()
 	        {
 	        dd count=1 if="$1" 2>/dev/null\
 	                | hexdump -s 40 -n 4 -e "\"$1:"'$1: %u\n"'
 	        }

but "-s" does a "seek" not a "skip" as documented thus seeking on stdin 
fails.

I always learn something new from Tzafrir's postings :)

I still haven't figured out the format string...

Thanks in advance,
------------------------------------------------------------------------
Steve Edwards      sedwards at sedwards.com      Voice: +1-760-468-3867 PST
Newline                                             Fax: +1-760-731-3000



More information about the asterisk-users mailing list