Weekly Dev Update 13
Project Muse Finished | Oh Javascript… |
Project Muse Finished
Project Muse started in January, and finally, I have made the final push I plan to make for a while. The project has grown beyond its original MVP, but I wanted to get it to a ‘workable’ version for my own interests and uses before putting it down entirely. I’ve described how Muse works before, but in summary, using a microphone/camera to stream to the RTSP server, it uses FFMPEG to pull out the audio. Using AWS-S3 we upload the mp3s into a bucket. AWS_Lambda on an event trigger for seeing a new mp3 file in the bucket, it uses AWS_Transcribe to get a JSON object, which includes a string of any human speech detected, a transcription. Another S3 bucket for those, and another Lambda watching here, creating AWS_SQS messages. Why? Well querying SQS instead of S3 is 10x cheaper. My original plan was for this app to work properly, and possibly for me to use it. Being a house running on one entry-level web developer’s budget, I figured anything would be better than nothing!
A new service checks AWS_SQS for new messages periodically, pulls them down, queries S3 for the appropriate JSON, then gets the transcription. Here’s where it gets more interesting, however. We communicate to an AI, Anthropic in this case. We give it a JSON structure to fill, and the transcription, with some simple instructions. I wanted it to summarize conversations, and I wanted to set ’triggers’ when certain conversations I’m interested in pop up. What does that entail? Well, if I add my name, and if my name is mentioned, the JSON object returns with an ‘alert’, telling me the quote of what caused the alert, a summary of what was said. You can add alerts for anything, but if I did have dozens of little devices collecting people’s conversations, I could get a surprisingly conmprehensive set of alerts in these JSON objects.
Of course, that’s all well and good, but far from feeling complete. So, I have a final service that takes in created summaries and alerts from conversations, and then send me the data in a formatted email. That’s it! The project is complete. While I want to expand on the project, write some applications to put on Rasperry Pis and do the hardware myself, or host the application so I can at least use my phone to do this, I’m happy with where the project is. I want to move on for a time, probably revisiting game development with project Prism, the terminal ASCII-art AR game, more reminiscent of Pokemon Go than anything else. I’ve yet to decide.
Oh Javascript…
When I first came to my company, we didn’t have a fantastic process for our front-end development environment. Meaning, our IDE had less programming features than Microsoft Word.
Choosing between insanity, and fixing this, I chose the latter.
I eventually developed a little application that saw me save code in a remote repo from my IDE of choice, and in our editor, I placed a script to fetch the file and inject it into the webpage.
Clever, to be sure, but the part I didn’t mention was that this script, albeit, saved me a ridiculous amount of time, was still costing me time. I knew there were some bugs. The script would sometimes completely empty the file. It also mandated that you quit out of the file when you changed it, and re-open it. It didn’t account of a lot of edge cases.
Mostly due to me not loving JavaScript, the language I originally wrote it in, I just tried to ignore it.
This week I finally put the time aside to refactor it. I discovered the file-emptying occurs due to a race condition between my app, and my IDE. Sometimes my IDE would create a new file, move all the text from the saved file to the new file, delete the old file, and then rename the new file to the name of the old file. Why? Who cares. It’s a feature. The point is, my app would read the original file after it had been emptied, but before it had been deleted, then paste that empty file into the new file, deleting everything. Pretty fun challenge, I honestly just stopped and re-ran the function whenever this happens.
I also discovered some other errors. One by one, little by little, learning more, just playing around, I found myself not hating the application, like I usually do. Normally I’m swearing under my breath, wishing I had the time to rewrite it in Go. However, this wasn’t the case this time. I’ve been reluctantly embracing JS lately, putting away its quirks, and trying to just recognize that it’s a very useful language for what it’s for.
Summary
That’s it for the last week or two. I’ve slowed things down, as my wife is in her third trimester for bringin our baby girl into our family. While we eagerly await, a lot of my free time is spent just trying to maintain the life I/we have. I have a lot happening at work, and not to mention, I need to revisit my portfolio next week and update the UI, the project display is absolutely ugly as sin.
See you next time! Thanks for sticking around until the end! It means a lot, more than you know, when people come up to me IRL and know who I am from my tiny social media presence.