ASL3 voice telemetry cadence

is there a way to tighten up the voice telemetry cadence?
it sounds almost as bad as the Yaesu Fusion machine IDs

the spoken words are fine, but the number reading is painful

de k9wkj

Not any easy way that I know about. It might possible to record new sound files. But wouldn’t promise they wouldn’t get over written by an update. The sound files are in /var/lib/asterisk/sounds.

I speed mine up with this script. You will want to massage the in and out directory variables. I copy the sounds to a working folder, run the script, and copy them back.

You will need to install ffmpeg

#!/bin/bash

# Define the input directory, output directory, intermediate directory, and speed factor
INPUT_DIR="sounds/en"
OUTPUT_DIR="spedup/sounds/en"
INTERMEDIATE_DIR="working"
SPEED_FACTOR="1.2"

# Create the output and intermediate directories if they don't exist
mkdir -p "$OUTPUT_DIR"
mkdir -p "$INTERMEDIATE_DIR"

# Find all .ulaw files recursively in the input directory
find "$INPUT_DIR" -type f -name '*.ulaw' | while read -r INPUT_FILE; do
    # Determine the relative path of the input file relative to INPUT_DIR
    RELATIVE_PATH="${INPUT_FILE#$INPUT_DIR/}"

    # Get the base name of the file (without directory and extension)
    BASE_NAME=$(basename "$INPUT_FILE" .ulaw)

    # Construct the output directory structure under OUTPUT_DIR
    OUTPUT_SUBDIR=$(dirname "$RELATIVE_PATH")
    OUTPUT_SUBDIR_PATH="$OUTPUT_DIR/$OUTPUT_SUBDIR"
    mkdir -p "$OUTPUT_SUBDIR_PATH"

    # Define the intermediate WAV file name
    INTERMEDIATE_FILE="$INTERMEDIATE_DIR/${BASE_NAME}_temp.wav"

    # Define the final output file name preserving directory structure
    OUTPUT_FILE="$OUTPUT_SUBDIR_PATH/${BASE_NAME}.ulaw"

    # Convert the u-law file to WAV, change the tempo, and convert back to u-law
    if ffmpeg -y -f mulaw -ar 8000 -i "$INPUT_FILE" "$INTERMEDIATE_FILE" && \
       ffmpeg -y -i "$INTERMEDIATE_FILE" -filter:a "atempo=$SPEED_FACTOR" -ar 8000 -f mulaw "$OUTPUT_FILE"; then
        echo "Processed $INPUT_FILE successfully."
    else
        echo "Error processing $INPUT_FILE."
    fi

    # Remove the intermediate file
    rm "$INTERMEDIATE_FILE"
done

echo "Processing complete. Output files are in $OUTPUT_DIR."

1 Like

Similar to the script @n5zr shared, this is what I use. It uses sox instead of ffmpeg and directly handles the ULAW and GSM files without intermediary conversions. It speeds up the speech a little bit and shortens the gaps between files.

Before:

After:

fasterAsteriskSounds.sh

#!/bin/bash

# Define directories
SOUNDS_DIR="/usr/share/asterisk/sounds"
BACKUP_DIR="/usr/share/asterisk/sounds_backup"

# Define the tempo adjustment (e.g., 1.1 for 10% faster, 0.9 for 10% slower)
TEMPO_ADJUSTMENT=1.1

# Define the amount of silence to leave at the beginning and end of each file (in milliseconds)
SILENCE_THRESHOLD_MS=200  # 200 milliseconds = 0.2 seconds

# Silence threshold percentage (lower values are less aggressive, higher values are more aggressive)
SILENCE_PERCENTAGE=1%

# Enable or disable silence removal (true or false)
REMOVE_SILENCE=true

# Create a backup of the sounds directory
echo "Creating backup of the sounds directory..."
cp "$SOUNDS_DIR" "$BACKUP_DIR"

if [ $? -eq 0 ]; then
    echo "Backup created successfully at $BACKUP_DIR."
else
    echo "Backup failed. Exiting."
    exit 1
fi

# Process .ulaw and .gsm files
echo "Processing .ulaw and .gsm files..."

find "$SOUNDS_DIR" -type f \( -name "*.ulaw" -o -name "*.gsm" \) | while read -r file; do
    echo "Processing $file..."

    # Generate a temporary filename for the output
    temp_file="${file}.tmp"

    # Determine the format based on the file extension
    if [[ "$file" == *.ulaw ]]; then
        input_format="ul"
    elif [[ "$file" == *.gsm ]]; then
        input_format="gsm"
    else
        echo "Unsupported file format: $file"
        continue
    fi

    # Convert milliseconds to seconds for sox command
    SILENCE_THRESHOLD_SEC=$(echo "$SILENCE_THRESHOLD_MS / 1000" | bc -l)

    # Build the sox command based on the REMOVE_SILENCE flag
    if [ "$REMOVE_SILENCE" = true ]; then
        # Include silence removal with adjusted threshold
        sox -t "$input_format" -r 8000 -c 1 "$file" -t "$input_format" "$temp_file" \
            silence 1 "$SILENCE_THRESHOLD_SEC" "$SILENCE_PERCENTAGE" reverse \
            silence 1 "$SILENCE_THRESHOLD_SEC" "$SILENCE_PERCENTAGE" reverse \
            tempo "$TEMPO_ADJUSTMENT"
    else
        # Skip silence removal
        sox -t "$input_format" -r 8000 -c 1 "$file" -t "$input_format" "$temp_file" \
            tempo "$TEMPO_ADJUSTMENT"
    fi

    if [ -f "$temp_file" ]; then
        # Replace original file with the processed file
        mv "$temp_file" "$file"
        echo "Finished processing $file."
    else
        echo "Failed to process $file."
    fi
done

echo "All files processed."
3 Likes

Mason, where in your node did you place this script? Are there any other steps to make it work besides me creating the file, copying the script you have here, and making it executable?

Place it anywhere you like and run it, that’s all :grin:

Thanks!

It worked great on one of my nodes but missed the letter 6 as asterisk said it has zero size. I copied over the original by sudo mv /usr/share/asterisk/sounds_backup/en/digits/6.ulaw /usr/share/asterisk/sounds/en/digits/6.ulaw

Just want to add that I had to include -r after cp to the line cp "$SOUNDS_DIR" "$BACKUP_DIR" as it was giving an error.