Make your own CS:GO C4 PROP – Part 4 – SOFTWARE

INTRODUCTION

Welcome to part four of the tutorial to make your own CS:GO C4 game prop! In this, the final episode we’re going to be talking about the software that makes it all tick.

This blog post is supplemental to the YouTube video below. For the full tutorial please check out the video and refer back here for the source code and also any corrections or additions that were highlighted after the video was released.

Any questions, please leave a comment below or in the comments of the video.

The Sounds

I know you are itching to dig into the source code but before we do that the first thing we need to talk about are the sounds.

All the sounds that are used in the device are taken from the actual game sounds, each sound being stored on an SD-Card on the “Mp3 pLaYer” (notice the quote marks 😉), and the source code triggers each sound to be played at the appropriate time.

Obtaining the Sounds

Now, I can’t give you all of the sound files to download as they are not mine to give. They are owned by Valve and if I listed them here I’d probably end up on the receiving end of a lawsuit. However seeing as you will be making this as a one off game prop, as a kind of fan art not for commercial resale kind of thing there are ways that you can obtain the sound files that you need and still be able to sleep at night. #NotLegalAdvice

I can give you the countdown beep sound, this one I created myself in FL Studio because the one from the game just didn’t sound right played back on a small speaker. You can download that one in the table below. To obtain all the other sound files, read on…

The way I got the CS:GO C4 sounds was from a YouTube video by Isan Arditama (thanks buddy) which you can find here https://youtu.be/3xSrpsZFI68. It’s a video of all the sounds from CS:GO and what I did was use an online YouTube to MP3 converter to rip the MP3 audio from the video. I can’t link you to an MP3 converter as they seem to come and go, but you should be able to Google one with no problem.

If you can’t get the MP3 from an online converter, another option is to use OBS to record the YouTube video as it plays. Then use VLC Player to convert the MP4 file to MP3. There are loads of tutorials on how to user VLC Player to convert files on YouTube so I won’t go over the process here.

If the video is no longer available on YouTube for any reason you might be able to find another video with the CS:GO sounds, or failing that use OBS to capture the sounds directly from the game yourself and convert the video to MP3 using VLC Player.

Cutting up the sound file

Once you have an MP3 of all the sounds in one big chunk, you will need to cut the MP3 file into separate files, one for each sound you need to be able to play on the device. To do this we will use the awesome (and free) audio editor Audacity.

Load the MP3 file into Audacity and locate one of the sounds that you want to extract.

Before you export any sounds make sure the project is mixed from Stereo to Mono.

And that the project Format is set to 16 Bit PCM.

The Project Rate (Hz) needs to be 32000.

Click and drag with the left mouse button to select the section of audio that you need and on the File Menu select Export -> Export Selected Audio.

Choose a location to save the file and make sure you’re saving it as a WAV file. The wav files should be named 0000.wav, 0001.wav, 0003.wav etc… Name the wav files according to the table below.

Repeat this to grab every sound that is listed in the table below.

NOTE: BEEP_SOUND (0000.wav) was created by me so you can click on it in the table below to download it.

Arduino Source Code Sound NameGame Sound NameFile Name
BEEP_SOUND (Click to download)c4_click0000.wav
TERRORISTS_WIN_SOUNDterwin0001.wav
KEY_PRESS_SOUNDkey_press70002.wav
ABOUT_TO_BLOW_SOUNDnvg_on0003.wav
TIMES_UP_SOUNDarm_bomb0004.wav
EXPLODE_SOUNDc4_explode10005.wav
C4_INITIATE_SOUNDc4_initiate0006.wav
DEFUSING_USA_SOUNDdefusingbomb03 (seal)0007.wav
DEFUSED_SOUNDc4_disarmfinish0008.wav
DEFUSED_USA_SOUNDbombdef0009.wav
COUNTER_TERRORISTS_WIN_SOUNDctwin0010.wav

Remember, you don’t have to use the same sound files that I have, if for example you prefer a different defusing sound from a different faction, go ahead and use that instead.

Converting the files to AD4

I know, painful isn’t it. You’d think that a sound device sold as an “Mp3 pLaYer” would play MP3’s and we wouldn’t have to spend half the tutorial faffing around with sound editing. Now we have to convert the WAV files to AD4 files so that the “Mp3 pLaYer” will play them! 😂

To convert the files to AD4 format you can download the converter here – Download AD4 Converter.

Extract the AD4CONVERTER.EXE file to the same location as the exported WAV files.

Next launch a Command Prompt and set the current directory to wherever you saved the sound files and the AD4 Converter.

Type the following command and press Enter.

This will convert 0000.wav to 0000.AD4. Repeat this for every wav file and when done, copy all the .AD4 files to the SD Card and insert it into the “Mp3 pLaYer”.

NOTE: If you have any problems with playback once you have loaded the sound files onto the SD Card it could be that the audio volume level is too high for the device. If so, load up the wav files in Audacity and lower their volume. Re-convert them to AD4 format and try them again. I found I had to lower the volume of the wav files to about -18db to get it to work properly.

We’re now ready for some code!

The Software

The software for this project is in two parts. The first is the source code that will run on the Arduino and will handle the LCD Screen, the Keypad and the sounds etc… And the second is a small Windows Desktop application named the CS:GO C4 Configurator that can talk to the CS:GO C4 Prop over USB in order to be able to set the time for the clock and also the LCD backlight levels.

Arduino Source Code

So with no further faffing here’s a full listing of the source code for the Ardunio. I’ll put a download link at the end of the article so you can download all of the source code and the 0000.wav sound file all in a single zip file.

If you want to know more about how the Arduino source code works, checkout the video at the top of this article. In that I talk more about how the code is structured, how it works and how you can modify it.

With the above source code you should be able to load it up in your favourite IDE and upload it to the Arduino in the CS:GO C4 Prop.

You will need to have the following external code libraries installed in order for the code to be able to talk to the various hardware modules. You can install the libraries using the Arduino IDE Library Manager, search for them by their Library Name.

LIBRARY NAMETALKS TOAUTHORVERSION
LiquidCrystalLCD DisplayArdunio (Built into IDE)1.0.7
WTV020SD16P“Mp3 pLaYer”Diego J. Arevalo1.4
KeypadKeypadMark Stanley, Alexander Brevig3.1
DS3231Real Time ClockAndy Wickert1.0.2
PCF8574I2C GPIO ExpanderRob Tillaart0.2.4
EEPROMArduino EEPROMArdunio (Built into IDE)n/a

The author names and versions have been included to help you know that you have the correct library. The versions probably won’t matter but just in case you have any problems I have listed the versions that I used.

The CS:GO C4 Configurator

If you have been following along with the series you will probably know that the CS:GO C4 Prop doubles up as a bedside clock after 30 seconds of inactivity.

And being a clock, you will need a way of setting the time. This is where the CS:GO C4 Configurator Application comes in as it allows you to configure the CS:GO Prop via its USB Port in the rear of the device.

I’m not going to list the source code for the CS:GO C4 Configurator here as it’s a number of files and it wouldn’t really help you much to see the code here. The source code for the Desktop Application will be included in the zip file at the end of the article. You can load it up in Visual Studio to build it and run it.

To configure the CS:GO Prop, run the CS:GO C4 Configurator application. Don’t plug the CS:GO Prop into the USB port just yet.

Choose a COM Port and click the Connect button.

Next you will be asked to plug the CS:GO Prop into a USB Port on your PC.

Next you will be asked to wait until the CS:GO Prop boots to the password screen, click the OK button and when the CS:GO Prop gets to the password screen, press and hold the * key on the prop for at least 3 seconds.

The prop will now go into USB Mode:

After a few seconds, the Configurator will load all the settings for the CS:GO Prop and display them as follows:

As well as being able to set the current time, you can set a daytime and a nighttime brightness for the LCD display. If you’re going to use this as a bedside clock you want the LCD to be dim while you are sleeping and brighter during daylight hours.

The Daytime Brightness value will be applied after the Daytime Begins time, and the Nighttime Brightness will be applied after the Nighttime begins time.

You can test the brightness of each by clicking the Test button.

Click Save to save your changes.

Final Thoughts

There are loads of options for customising the CS:GO C4 Prop even further…

If I had time I would have liked to added an alarm clock facility so that it could be used as a bedside alarm clock. The Real Time Clock module has the facility to be able to set alarms so it wouldn’t be too difficult to do.

It would also be possible to code in a daylight savings time feature so that if your country follows daylight savings time, the clock will automatically adjust itself with the seasons.

If you wanted to use the prop for Airsoft scenarios, you could consider adding in a small audio amplifier and a bigger speaker so that the prop sounds are a lot louder. It’d be really cool to play CS:GO Defuse the Bomb with real BBs.

Before we conclude the series and I leave you with the download link for the software assets I’d like to say a big thank you for following along with the series. A special thanks to all that have supported me on YouTube by liking my videos and subscribing to the channel and also to all of you that take the time to leave comments and ask questions.

Finally, have fun! If you find any errors in the information here comment below or leave a comment on the YouTube video and I’ll make corrections to this web page.

downloads

The files below are free to download and use, if you enjoy them and want to support the channel and help me to make more great content feel free to hit the “Buy me a Beer” links on the right or at the bottom of the page, or head over and join my Patreon.

Below you can download the source code and beep wav file for the CS:GO C4 Game Prop…

Source Code Files (139kb)

A ZIP file containing all the source code for the Arduino, the source code and executable for the configurator and the 0000.wav beep sound for the project.

SHARE

Leave a Comment

You might also enjoy

Support RadBoogie

Buy Me a Beer