Return to Level1Techs.com

[Devember 2021] A soundboard based on tag search for use in voice chat

Overview:
I will develop a soundboard that uses a search window instead of the 1:1 keymapping that almost all soundboards use.

What are the benefits:
You are not limited by the amount of “free” key-combinations on your keyboard. If you wanted you could also just add your entire music collection to the list of audio files. You also don’t have to remember the key-combinations and it is much harder to fat-finger and play the wrong file. Of course typing will take slightly longer but that’s okay.

I also want to make this work for playing clips over voice chat. Usually the noise cancelling of voice chat apps will screw with the audio clip and cut it off or try to remove music from vocals. The only way I found to fix this is by disabling the noise cancelling of the voice chat app. To keep an acceptable voice quality I will need to process the microphone input myself and apply noise cancelling and maybe echo reduction beforehand. Afterwards I will add the audio from the sound clip (if any is playing) and push that to a virtual audio device.

There is some more detailed information about how this will work in the project’s readme.

Goals and challenges:
Since I am programming for a living the general programming task will not be the challenge but there are two things I want to improve myself on:

  • I am new to audio programming and want to learn how to use WASAPI in this project and maybe also learn some things about signal processing.
  • I want to get into DevOps and build a super overkill enterprise -ish integration pipeline in Gitlab’s CI/CD

I will probably start with the program part until I have something functioning before I start working on the DevOps part, just because I don’t see a reason to build and test executables that don’t do anything.

This is my first time joining in on Devember or any programming themed challenge so any feedback is greatly appreciated.

2 Likes

Update after a long time of stuff getting in between and procrastination. It’s been almost a month since I started but have only been working on it for on 5 or 6 days.

Updates:

  • Created library structure for audio clips (this includes tagging system and a prefix-table for all tags to easily search by incomplete tags, e.g. “rad” will return results with the tag “radiator”)
  • Created GUI (with edit-control for search list of suggestions that can be iterated through)
  • Suggestions are weighted by the number of matching tags and whether a tag matches exactly or is only prefixed (e.g. searching “any” will match “anyway” but is weighted lower)
  • Tags are extracted from filename

Currently the files are still all hardcoded and added to the audio clip library on start-up, which is what I will probably tackle next. For the next update I want to get to at least hardcoded directories that are scanned and added recursively so that I can easily add many audio clips to the library. This will help me to get a feel for how precise you actually are in selecting a specific clip when there’s a lot of them, which could be a deal breaker if it isn’t.

Here’s a demo of it filled with a handful of quotes from the movie ‘The Room’. Currently all clips include the tag “mp3” from the file extension, which is why the search for ‘m’ returns all those clips.

Demo

suggestion-list

Update from Nov 30 to Dec 7

  • The soundboard can now load files from directories recursively and I did some tests with 1429 files and 2737 distinct tags from two different vase directories. Works pretty good so far. Since I had some fears this might be too slow I also added some code to time the search request. None of my search queries took longer than 2ms which is good. No idea how it scales but for a mvp this should be plenty fast enough.
  • I started working on the audio part and got to the point where I can initialize devices and read data from a microphone input and send it to an output device in a separate thread in a loop (barely).

I have been slacking a bit. The base functionality is there but there are still a lot of rough edges and a lot of the configuration is currently hardcoded which makes it unreasonable to think about providing binaries in the DevOps/CD step I planned.

Update from Dec 7 to Dec 31:

  • I added playback of audio files. Added decoders for mp3 and flac files that can be selected and started.
  • Added noise cancelling to the microphone passthrough (this still has a major flaw since any discontinuity in the audio stream wrecks the noise cancelling causing audio to become distorted).
  • Added some special handling for commands: !stop (stops playback), !exit (terminates program), and !volume (sets the volume for audio clips to the next number after the command, given in percent).
  • Playback status is displayed in the app with current filename and the timecode of the audio file (cursor + total).

doDANLJBgT