Episode: 3496 Title: HPR3496: How I record HPR Episodes Source: https://hub.hackerpublicradio.org/ccdn.php?filename=/eps/hpr3496/hpr3496.mp3 Transcribed: 2025-10-25 00:26:31 --- This is Haka Public Radio Episode 3496 for Monday the 27th of December 2021. Today's show is entitled, How I Record HDR Episodes. It is hosted by Norrist and is about 28 minutes long and carries a clean flag. So some of it is some item to record short segments of audio. I've been listening to HDR since the beginning since before it was HDR and I can't say I've listened to every episode because I skip a few, but I've listened to the majority of HDR episodes. One of my favorite correspondents from HPR way back, Tom's, was Mr. Gadgets. You should look him up, host ID1555 if you haven't heard him or don't remember him. If you go back and listen to some of his old episodes, you'll consider it Tom Willspin. So besides just having interesting topics, which Mr. Gadgets had interesting topics, he was just a good storyteller like he knew how to tell a story, review a topic and it just sort of, his episodes just moved along. They went nice and easy and he knew really well how to get his point across. He would record his episodes, maybe not every single one, but this is how I remember it. He would record his episodes in one shot without any editing. He would just start recording. This is back when HPR had a call in line so you could dial a phone number and just start talking and then do the magic of the HPR janitors. It would just turn into an HPR episode. That's how we would do all those episodes. That's good. He can do that. I cannot do that. I'm not very good at speaking off the cuff. When I do or when I try to, you can probably hear it now. I use a lot of filler words like um and uh like and I have to stop and think about what I'm going to say. So you know I'm not like Mr. Gadgets. I can't just start recording and perfect HPR episode comes out. So I made a handful of episodes to this point and the first few I made, I tried what I thought was really the only is the only way I knew how where I would launch a recording app. I used my phone for the first few. I would just start the recording app and I would just start talking. You know I knew what I wanted to talk about and I had some notes printed out but I kept sort of stumbling over what I wanted to say. I would won't like I'm doing now. I wanted to slow down and stop and think about what I was going to say and there was a lot of those and ums and I would have to repeat myself so I would say a sentence and not like how it sounded. So I would pause for a second and say the same thing again. All in one big giant recording. So I would end up with like an hour of audio that I would have to edit down and usually by the time I edit it down it would only be a 10 or 15 minute episode and I would spend hours sometimes you know two or three hours using audacity to remove all the sentences I said more than once and I would even try to go through and find all the places I used to own a lot and try and remove all those instances where I'm just using a lot of fillers. So after I made a few episodes using the method I just described where I would make just one big giant recording that had to be edited I thought it would be easier if I could make the recordings instead of one giant file make several small files or at least somehow record it in smaller chunks that way the editing would be easier. So I started looking around for ways to record short audio segments and stick them together later. I'm sort of used to audacity like I don't use it a lot but if I had to edit audio files what I would do and that's how I would edit these previous episodes so I thought okay let me record these episodes let me try recording an episode directly into audacity but using a method I had to scrap where instead of just letting the recorder run the whole time figure out a way to pause the recording in between bits of text I wanted to say and I am certain that it is possible to use audacity this way and I had some success doing it but it just wasn't easy for me like I was funneling around with the buttons and sometimes I would lose my place in the track and I even tried recording multiple tracks per segment a long story short I know audacity is a great tool but for me I just I couldn't use it this way to do what I wanted to do so I started thinking about what would my ideal process be for recording HPR episodes if I could conjure up something out of nothing to record HPR episodes what would I want all right so these are sort of the things that I came up with one I wanted to be able to write the script out in a text file in advance and then I wanted to simultaneously present a short segment of text while at the same time being able to record the audio for that segment of text then you know do that over and over again and then eventually once all the segments are recorded have some way to stitch together all these audio segments and then sort of as that extra feature be able to do a little bit of post processing so these are some things I would do in audacity after I would take the giant file and wouldle it down I would do a couple of other steps like trying to remove background noise and doing the truncate silent step so I started looking around thinking surely there's something like this that exists that something that's on to let you record little snippets of audio and then when you're finished just to come all together but I couldn't find anything like it so maybe it exists and maybe I'm just searching for it wrong but I couldn't find it so I thought well this probably isn't too hard to make and sounds like a fun project and my Python is okay so I thought well let me let me take a stab at writing something like this and Python so I wrote a script called solo cast I'll have a copy of the whole thing in the show notes I'm not going to read the code out or anything like that but I'll talk a little bit about how it works and how to use it the dependencies for the script are pretty minimal um it use I use socks the command line tool socks to do all the audio processing and record the audio and playback the audio and apply the processing effects um so you have to have socks installed um the other requirement is the Python click module CLICK click um it click Python click makes it it's like a framework for writing um command line utilities and it makes things like arguments and help and stuff like that a lot easier so to use it to use this a low cast script you'll need to have uh the Python click module available um there are I'm not going to get into how to install Python module dependencies because that's it's a bit of a hornet's nest um so I'll leave that up to you the listener um to figure out that little bit of a dependency but you guys are smart and figured out so like I said one of the things I wanted was I wanted to be able to present a script or some text um so when the solo cast script launches it looks for the script a file called script.txt which is the text that's it's gonna explain back to you um the you know I've said I like the script to be segmented so I can do just a little bit at a time and so the solo cast breaks up the script into segments I'm about looking for uh empty lines so you put all the text together that you won't display it at one time and then separate it with just a blank line empty line so when you're right now the script uh script.txt where all the text is gonna be um you can put it as much or as little as you won't in the script I like to have a lot of words um sometimes I've even I've had as much as you know basically everywhere I'm gonna say is typed out beforehand so you can do it that way or you can treat it like it's a slide deck at a presentation and only have a few bullet points um whatever works for you but you know you need to have enough text there to at least prompt you to know what you're gonna talk about in that particular segment and the whole point really of of me writing this was to keep um just keep the segment short so I can record short pieces of audio uh at you know at a time so for me one or two minutes is the the most I like to do I really like to keep it under a minute uh two minutes max but whatever you're comfortable with the last two hpr episodes I made were about Nagios and how to install Nagios uh and set up and configure the checks and blah blah blah so when I'm I use solo cast to make those episodes and when I did I typed out the script.txt I formatted it as markdown so whenever it came Tom to submit the show just with a few tweaks I made to the script.txt I was able to submit that as show notes as markdown show notes so um I'll talk a little bit about how to use the script and how it works so you um launch the python script um you can ch mod at executable and run dot slash or however you want to do it um but you can run like dot slash solo cast and then followed by one of four commands so uh the commands are um record which is you know that's sort of the whole point of that um silence and I'll talk about what silence means in a second um review so um review lets you kind of review the script ahead of time and then finally um you can run solo cast combined and then we'll take all the recordings and stick them together so when I first started thinking about how to make this um I was recording episodes on uh using a raspberry pa plugged into a uh like a pretty cheap USB microphone and it worked fine it was just really noisy um so I would record the episodes and I'll go back in audacity and for a blank spot and you know select it and say okay this is a quiet part and then you know use the noise removal effect and audacity so socks can do something similar but you've got to generate a it's called a noise profile first so to generate a noise noise profile you record a five second or you record a few seconds of silence and uh I'll have the script record five seconds of silence um and then you take that five seconds of silence and you generate a file called a noise profile uh and then you can use that to um remove noise from the whatever recording you're making and the noise removal and socks worked really well and I'm telling you that smartphone I had was noisy there was a lot of his same and it was completely gone whenever I processed it like this so this is definitely something I would consider a killer feature for socks so back to the silence command so if you run solo cast silence it will say hey I'm about to record five seconds of audio or five seconds of silence um press enter when you're ready press enter um don't say anything because while it's doing it that's the point you want to get silence um and then you know once it gets this five seconds of silence it'll generate the silence profile now if you try to record audio before the silence profile has been generated um the solo cast script will um sort of enforce that you have to have a silence profile first so if you don't run solo cast silence to generate the profile first the first time you try to record a segment it will sort of skip to the part of the code that generates a silence profile um so you can either generate the silence profile explicitly by running solo cast silence or um you can just try to record an episode or try to record a segment and it will um it'll force you into generating the silence profile so the next option I'll talk about real quick is the solo cast review option so when when you're recording audio what I'll do is it'll present a little segment of text and then tell you it's about the record audio well if you if you want to optional step but if you want you can run solo cast review and it just presents the text without the recording step and then you can press enter to go to the next um next segment and enter to go you know just keep pressing enter and you cycle through the segments and this just gives you an opportunity to see how solo cast is parsing the text into segments so you know I always do it always run it with the review step um run through the whole thing and make sure none of the segments are too long or another thing that I'll do sometimes is remember I said it will split on blank lines well if you have two blank lines in there um it's gonna think one of those is a segment so you'll end up with you know trying to record a segment that's where there's no text presented so that's something you can pick up to uh when you run the run the review step so like I said solo cast review is just basically the equivalent of running through a slide deck um like before your presentation like you run through it real quick so finally we're at the meet of the uh script where and we can run solo cast record so the way solo cast parses through the text and tracks the recordings is it takes the first 40 characters of a segment and uses that um to generate a pile name and then um whenever you record the file it'll create a file called you know whatever the first 40 characters are um dot wave or dot whatever I'll talk about the dot whatever in a minute um so whenever you run solo cast record parses through the script um generate the file name based on the segment text and it will look for a file and and and the directory and says okay does does this file exist and if the file exists um it'll skip to the next segment and if the file doesn't exist then it will prompt you and say okay we're about to record some audio uh whenever you're ready press enter to start recording the the socks command whenever you install it it comes with a sort of a sub command called uh REC or REC or shirt for record uh and it just it records audio by default it will just use whatever you have um set as your default input device so if you if you're using a device that has like I'm I'm recording on a laptop right now and it's got an internal mic but I'm using a headset a USB headset to do the recording so before uh can record using solo cast how to go into the gnome settings and set this headset to be the default input um so whenever you run solo cast record it presents you the text and get prompted you mash enter um it launches the REC command uh and starts recording from your default input uh whenever you're done whenever you said everything you have to say there has anything to do with uh text that presented on the screen um you can press control c uh to kill the record command and then it'll present you a menu what to do next so real quick coming back to the file names if you look at the top of the python script there's a variable to set the socks recording format and I have it this set I have it set the wave wave works just fine um but you can change it to anything that socks understand so auger flacker whatever um you can change it you can leave it as wave but you know when the files are generated it'll be like the 40 character name dot um whatever is this variable is set to so once the file is recorded um there's a small menu uh you're given four options about what to do um with the recording um first is uh play you can play it back and listen to it um if you like it you can hit the accept command um and that just that ends your sort of solo cast session um if you don't like it you have a couple of options um one is you can press r to record it again so if you press r it's just like starting over you get the text again um and then it'll get the prompt to start recording and it just records a new file with the same name um the other option is um at this point you can go ahead and do truncate silence so like I said sometimes I'll just stop in the middle of recording something and just pause and sort of gather my thoughts uh and if you do that you know you'll leave a few seconds of blank audio so you can use uh if you after you review the audio and there's a little too much um dead space in there um you can press the t command for truncate silence and it will um you socks to truncate the silence and then you can play it back and listen to it again uh if you like it you can hit accept so you run solo cast record it records one segment um and after it records the segment you're given the the menu to record it again or accept it or truncate it um what's that's done solo cast will exit um it only records a single segment at a time so when you're ready to record the next segment you run solo cast record again um it starts reading through the script and we'll see that you've already recorded the first segment because it sees and file with the name matching the first 40 characters of the first segment so it will look for a file for the next segment and it just starts reading through the script until it finds a file that it doesn't have yet and it will uh prompt you to record that one so when that's all done um if you like solo cast and um it starts reading through the script and all the files are there it just exits so it it might be better to have a message print it but it says hey you recorded everything but i don't have that yet so um now what's all that's done all the segments were recorded you can run the solo cast combined step um solo cast combined is um like i said it sticks all the segments together um it uses the um file names then it gets from the script so it loads the script up it knows what files you've recorded uh it knows what order they're in and the script so it puts them together in that order uh combines them into a single file with the file extension um that we just talked about it's in the top of the script uh and then this is where it applies the noise profile so at the very beginning you know we you know we ran solo cast solids that generated a noise profile and then this is in the combined step is where it does the noise removal so i haven't set it up to this point but um whenever you make all these recordings there's a recording sub directory that solo cast and rate it sticks all the recordings in the recording sub directory so whenever you run solo cast combined it makes a file called combine dot wave or combine dot whatever was set at the top uh and usually when i do this i'll still go ahead and load the combine dot wave up into audacity um just to look at the waveform and what i'm looking for is you know like big spikes of audio like maybe i touch the microphone or shuffle it around on my head or there's some clicking noises or something like that or i want to see if the um overall volume is appropriate so sometimes just by looking at the waveform i can see that the volume needs to be boosted so now that you have the combined dot wave um you guys know what to do with it from from there uh to submit it uh so what's what's next for me what's next for the solo cast script so first um i'm gonna i've got the script in a get lab repository um then i'll have the leak to the repo in the show notes um uh i hope i hope you guys look at it and um maybe maybe there's a feature you won't add it or um um and maybe you guys are better at Python than me um so i would welcome anyone to take a look at it and submit a pull request or leave a comment in the show notes or uh the other thing that's in the get lab repository it's it's there with a license i know um one time for a hpr episode uh put a script in the show notes but i didn't uh it didn't have a license attachment so um i want to be sure and uh offer a copy of the script with uh say em out t license with an em out t license um there are some other things i would i would kind of like to do with the script uh potentially with the solo cast script um one is instead of uh calling the socks binary directly there's a python library called uh pie socks um i think i could do everything with that library but i don't know i haven't looked at it enough so um there's something i'm thinking about doing um another change i would like to see or some additions i would like to see to solo cast is better post processing so like i said i like to look at i still like to look at the file and audacity um to look at the overall loudness um i'm sure socks is capable of taking a script and i or taking a audio file and adjusting the volume to uh whatever's appropriate for a podcast but i don't know how to do that so if that's something you guys know how to do with socks um i would definitely welcome the feedback another thing i like to do is um turn solo cast into a python package so you can install and be a pip um and then maybe there's some different recording tools that um you could use instead of socks i think that would be something uh interesting topic to explore and then on the uh last lastly there were on some the hpr community news there were discussing using ffmpeg instead of socks to do audio processing automation so maybe something uh interesting to look at is using ffmpeg instead of socks to record audio that's it what a what a whirlwind um it was it was funny um talking about a tool while i was using it to record that episode talking about the tool it was a little meta anyway um i'll be guys enjoyed my ramblings and i will see you guys next time you've been listening to hekar public radio at hekar public radio does work today's show was contributed by an hbr listener like yourself if you ever thought of recording a podcast then click on our contributing to find out how easy it really is hosting for hbr this kindly provided by an honesthost.com the internet archive and our sync.net unless otherwise stated today's show is released under a creative commons attribution share like 3.0 license