Friday, February 24, 2023

How-To make Trunking Recorder Play Audio Faster

If you're running trunking recorder on a system that has lots of calls, you may have an issue where the calls are coming in faster than playback and a backlog of calls piles up and you have to either have to pick and choose what calls you want to hear or get far behind realtime.

I don't like either choice, so I spent a fair bit of time researching how the software works, reading through the javascript files and such and found that if you add a single line to trunkingrecorder.js you can change the default playback speed!

I'm not good enough at coding to modify it so that there's a dropdown menu to change the speed at will, but for my case, I changed the playback speed to 1.5x and find that's the perfect speed to keep up with the system I'm monitoring, Bell Fleetnet Zone 2 in Ottawa.

So how do you do this:

Open TrunkingRecorder.js in a text editor, it's located by default at:

C:\Program Files\Trunking Recorder\Website\js\TrunkingRecorder.js

Go to line 1375, where it says:

1372            audio.addEventListener('timeupdate', AudioTimeUpdated);

1372            audio.addEventListener('ended', PlayerEnded);

1373            audio.addEventListener('pause', PlayerPaused);

1374            audio.addEventListener('play', PlayerPlay);

1375            audio.addEventListener('error', PlayerError);

And add a new line:

1376            audio.defaultPlaybackRate = 1.5;

Where 1.5 is the playback rate you want to use, this could be 1.25, 1.75, 3.20 or whatever playback speed you want.


Save the file and refresh the page and VOILA!! It should now be playing faster!

Hope this helps, leave a comment if it did!

While you're at it, check out my scanner feed at https://www.youtube.com/nathanaelnewton

Wednesday, January 11, 2023

The Incredible Tomato Suspension Bridge Project




This was shot during the summer of 2020 when I was staying at my friend's house on their small farm, we had over 85 tomato plants and due to the drip irrigation that I set up, they had grown so large that they were about to fall over with their cages, likely destroying the plants.


So, I decided to build a suspension bridge.


I had never built a suspension bridge before, I knew the basic physics behind how they worked and I figured I had enough raw materials so over the course of a few days I cut, doug, screwed, unscrewed, tore down what I had built, rebuilt it better, and eventually had what I'm calling the 'Incredible tomato suspension bridge'


I'm very proud of how it turned out, I didn't have a post hole digger so I ended up using a Shop-Vac and a small garden shovel, which was surprisingly super effective and produced an exceptional result!


Anyway, let me know what you think.. the video is a bit long I know I'm sorry, I cut out a lot and sped up most of the video 10x


Some spots I wanted to go faster than 10x but DaVinci Resolve kept glitching out so I trimmed out a few sections.


#YouTuber #SmallBusiness #Gardening #TimeLapse #Farming #tomatoes #engineering #redneckengineering  #DIY #Canada #Ontario #SuspensionBridge

Saturday, January 7, 2023

(Guide with code) The colorama names are too long so I made shorter ones

So you're apparently supposed to use colorama like this:

import colorama

# Initialize the library
colorama.init()

# Foreground colors
print(colorama.Fore.BLACK + "Black text")
print(colorama.Fore.RED + "Red text")
print(colorama.Fore.GREEN + "Green text")
print(colorama.Fore.YELLOW + "Yellow text")
print(colorama.Fore.BLUE + "Blue text")
print(colorama.Fore.MAGENTA + "Magenta text")
print(colorama.Fore.CYAN + "Cyan text")
print(colorama.Fore.WHITE + "White text")

# Reset the foreground color
print(colorama.Fore.RESET + "Text with the foreground color reset to the default")

# Background colors
print(colorama.Back.BLACK + "Black background")
print(colorama.Back.RED + "Red background")
print(colorama.Back.GREEN + "Green background")
print(colorama.Back.YELLOW + "Yellow background")
print(colorama.Back.BLUE + "Blue background")
print(colorama.Back.MAGENTA + "Magenta background")
print(colorama.Back.CYAN + "Cyan background")
print(colorama.Back.WHITE + "White background")

# Reset the background color
print(colorama.Back.RESET + "Text with the background color reset to the default")

# Style options
print(colorama.Style.DIM + "Dim text")
print(colorama.Style.NORMAL + "Normal text")
print(colorama.Style.BRIGHT + "Bright text")
print(colorama.Style.RESET_ALL + "Text with all styles reset to the default")

print("\n**************************************************************")
print("Now, the same thing but using f-strings to print the statments")
print("**************************************************************")

# Foreground colors
print(f"{colorama.Fore.BLACK}Black text")
print(f"{colorama.Fore.RED}Red text")
print(f"{colorama.Fore.GREEN}Green text")
print(f"{colorama.Fore.YELLOW}Yellow text")
print(f"{colorama.Fore.BLUE}Blue text")
print(f"{colorama.Fore.MAGENTA}Magenta text")
print(f"{colorama.Fore.CYAN}Cyan text")
print(f"{colorama.Fore.WHITE}White text")

# Reset the foreground color
print(f"{colorama.Fore.RESET}Text with the foreground color reset to the default")

# Background colors
print(f"{colorama.Back.BLACK}Black background")
print(f"{colorama.Back.RED}Red background")
print(f"{colorama.Back.GREEN}Green background")
print(f"{colorama.Back.YELLOW}Yellow background")
print(f"{colorama.Back.BLUE}Blue background")
print(f"{colorama.Back.MAGENTA}Magenta background")
print(f"{colorama.Back.CYAN}Cyan background")
print(f"{colorama.Back.WHITE}White background")

# Reset the background color
print(f"{colorama.Back.RESET}Text with the background color reset to the default")

# Style options
print(f"{colorama.Style.DIM}Dim text")
print(f"{colorama.Style.NORMAL}Normal text")
print(f"{colorama.Style.BRIGHT}Bright text")
print(f"{colorama.Style.RESET_ALL}Text with all styles reset to the default")

I don't know what you think, but I think those names are too long and annoying, so I created shorter versions:

import colorama

# Initialize the library
colorama.init()

# Create a lookup table of shorter variable names for the Fore options
F = {
    "BLK": colorama.Fore.BLACK,
    "RED": colorama.Fore.RED,
    "GRN": colorama.Fore.GREEN,
    "YEL": colorama.Fore.YELLOW,
    "BLU": colorama.Fore.BLUE,
    "MAG": colorama.Fore.MAGENTA,
    "CYN": colorama.Fore.CYAN,
    "WHT": colorama.Fore.WHITE,
    "RST": colorama.Fore.RESET,
}

# Create a lookup table of shorter variable names for the Back options
B = {
    "BLK": colorama.Back.BLACK,
    "RED": colorama.Back.RED,
    "GRN": colorama.Back.GREEN,
    "YEL": colorama.Back.YELLOW,
    "BLU": colorama.Back.BLUE,
    "MAG": colorama.Back.MAGENTA,
    "CYN": colorama.Back.CYAN,
    "WHT": colorama.Back.WHITE,
    "RST": colorama.Back.RESET,
}

# Create a lookup table of shorter variable names for the Style options
S = {
    "DIM": colorama.Style.DIM,
    "NRM": colorama.Style.NORMAL,
    "BRT": colorama.Style.BRIGHT,
    "RST": colorama.Style.RESET_ALL,
}


# Print text with different colors and styles
print(f"{F['BLK']}{S['DIM']}Black text with dim style")
print(f"{F['RED']}{S['NRM']}Red text with normal style")
print(f"{F['GRN']}{S['BRT']}Green text with bright style")
print(f"{F['YEL']}{S['RST']}Yellow text with all styles reset")

# Print text with different backgrounds and styles
print(f"{B['BLK']}{S['DIM']}Text with black background and dim style")
print(f"{B['RED']}{S['NRM']}Text with red background and normal style")
print(f"{B['GRN']}{S['BRT']}Text with green background and bright style")
print(f"{B['YEL']}{S['RST']}Text with yellow background and all styles reset")

# Print text with different colors, backgrounds, and styles
print(f"{F['BLU']}{B['CYN']}{S['DIM']}Blue text on cyan background with dim style")
print(f"{F['MAG']}{B['WHT']}{S['NRM']}Magenta text on white background with normal style")
print(f"{F['CYN']}{B['BLK']}{S['BRT']}Cyan text on black background with bright style")
print(f"{F['WHT']}{B['RED']}{S['RST']}White text on red background with all styles reset")

# Print text with multiple styles on the same line
print(f"{S['DIM']}{F['BLK']}Dim {S['BRT']}Bright {S['RST']}Normal {F['RST']}text")
print(f"{S['DIM']}{F['RED']}Dim {S['BRT']}Bright {S['RST']}Normal {F['RST']}text")
print(f"{S['DIM']}{F['GRN']}Dim {S['BRT']}Bright {S['RST']}Normal {F['RST']}text")
print(f"{S['DIM']}{F['YEL']}Dim {S['BRT']}Bright {S['RST']}Normal {F['RST']}text")

# Print text with different colors, backgrounds, and styles
print(f"{F['BLU']}{B['CYN']}{S['DIM']}Blue text on cyan background with dim style")
print(f"{F['MAG']}{B['WHT']}{S['NRM']}Magenta text on white background with normal style")
print(f"{F['CYN']}{B['BLK']}{S['BRT']}Cyan text on black background with bright style")
print(f"{F['WHT']}{B['RED']}{S['RST']}White text on red background with all styles reset")

# Print text with different colors, backgrounds, and styles using multiple styles on the same line
print(f"{F['BLU']}{B['CYN']}{S['DIM']}Dim {S['BRT']}Bright {S['RST']}Normal {F['RST']}Blue text on cyan background")
print(f"{F['MAG']}{B['WHT']}{S['DIM']}Dim {S['BRT']}Bright {S['RST']}Normal {F['RST']}Magenta text on white background")
print(f"{F['CYN']}{B['BLK']}{S['DIM']}Dim {S['BRT']}Bright {S['RST']}Normal {F['RST']}Cyan text on black background")
print(f"{F['WHT']}{B['RED']}{S['DIM']}Dim {S['BRT']}Bright {S['RST']}Normal {F['RST']}White text on red background")

# Print all of the possible combinations of colors, backgrounds, and styles using multiple styles on the same line
for fg in F:
    for bg in B:
        print(f"{F[fg]}{B[bg]}{S['DIM']}Dim {S['BRT']}Bright {S['RST']}Normal {F['RST']}Text with {fg} foreground on {bg} background")

That's better right? Let me know what you think in the comments!