ASL3 callsigns instead of node numbers

Jory,

I had some errors in the output.Here is an example.

Error: No audio mapping for \ (node 641491)
environment: line 15: AUDIO_MAP_ : invalid variable name
Error: No audio mapping for \ (node 45221)
environment: line 15: AUDIO_MAP_ : invalid variable name
Error: No audio mapping for \ (node 400110)
environment: line 15: AUDIO_MAP_ : invalid variable name
Error: No audio mapping for \ (node 540020)

There was also a bunch of errors with . (Dot) but I resolved that one but making a change to the audio_lookup function.

But no luck resolving the backslash. It doesn't like my attempt at an escape sequence. I used '\\'. Not sure where the \ is coming from either. It isn't from the astdb.txt file.

Tom.

audio_lookup() {
case "$1" in
/) printf '%s' "${AUDIO_MAP_SLASH-}" ;;
\\) printf '%s' "${AUDIO_MAP_SLASH-}" ;;
-) printf '%s' "${AUDIO_MAP_DASH-}" ;;
.) printf '%s' "${AUDIO_MAP_DOT-}" ;;
*) local var="AUDIO_MAP_$1"; printf '%s' "${!var-}" ;;
esac
}

I have updated it to handle everything seemlessly.

curl -sSL https://raw.githubusercontent.com/hardenedpenguin/asl-misc-scripts/refs/heads/main/write_node_callsigns.sh | sudo bash -s -- -a -f

Processed 37862 nodes.
Total script execution time: 8.7min
sudo ./write_node_callsigns.sh -a -f 1.07s user 3.12s system 0% cpu 8:41.54 total

Not sure I can make it any better then that for you.

Jory,

It worked perfectly for me. I did a full build into a new directory of 37847 records in 2.2mins. (Raspberry Pi 5)..

For my specific 'use case' I make a couple of minor modifications. All my sound files are .ul (not the full .ulaw) so I read them in that format and write them out as .ul also.

Then at the end of the script I copy a bunch of custom sound files for particular nodes from a protected directory into the main repository overwriting the newly created files.

Thanks for all your efforts here.

Tom.

Thank you- this sounds interesting. I'm not great w code and cannot tell if this backs up the files or just creates a new sound folder and uses it. If *70 is used do you hear node numbers or callsigns?

I get callsigns...

Post must be 20 characters. Grrrrrrr....

There are a number of options that can be used with the script. The -i option (i for India) produces a sound file with the node name and node number.

As far as I can tell, any existing sound files are not backed up as a separate action within the script. So you may want to do this manually before running it for the first time.

The script can take parameters to set the destination directory.

Tom.