Welcome to Katz - Pinoy Underground Forum

Join us now to get access to all our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, and so, so much more. It's also quick and totally free, so what are you waiting for?
  • Compact Safety Notice
  • Weekly Grants Lottery is live! Win a 20,000 ₪ jackpot — tickets are just 30 ₪, drawn every week. Buy your tickets »

Question Soundboard for cosplay

B 287

blank_

Abecedarian
Member
Access
Member
Access
2 Year Silver Member 2y Silver
Joined
Oct 14, 2023
Messages
157
Reaction score
6
Points
18
grants
₲209
Hi,

Has anyone know how to create a simple soundboard for cosplay, the sound is activated by buttons that are connected to gpio.

Thank you in advance!
 
1 824

1two50

Abecedarian
Member
Access
Member
Access
Rising Star
3 Year Silver Member 3y Silver
Joined
Aug 6, 2023
Messages
127
Reaction score
252
Points
43
grants
₲65
Here's a guide to creating a simple soundboard for cosplay using GPIO buttons:

1. Gather Materials:



  • Microcontroller board: Raspberry Pi Pico, Arduino Uno, or similar
  • Buttons: As many as you need for sound effects
  • Jumper wires
  • MicroSD card (if using Raspberry Pi Pico)
  • Speaker: Small, portable speaker or headphones
  • Sound files: Your desired sound effects in compatible formats (MP3, WAV, etc.)

2. Set Up Hardware:


  • Connect buttons:
    • Wire one button's pins to GPIO pins on the board, following the board's pinout diagram.
    • Use pull-down resistors (usually 10k ohms) between GPIO pins and ground to prevent floating signals.
  • Connect speaker:
    • Wire the speaker's audio output to the appropriate audio output pin on the board.

3. Write Code:


  • Choose a programming language: Python (CircuitPython for Pico), C++, or Arduino IDE's language.
  • Import necessary libraries: For GPIO control and audio playback.
  • Set GPIO pins as inputs: For the buttons.
  • Initialize audio playback: Set up the audio output device.
  • Create loop: Continuously check button states.
  • Play sounds: When a button is pressed, play the corresponding sound file using the audio library functions.

4. Load Sound Files:


  • Store sound files: On the board's memory (if possible) or on an external microSD card.
  • Access sound files: In your code using appropriate file paths.

5. Assemble and Test:


  • Secure components: On a breadboard or create a custom enclosure.
  • Upload code: To the microcontroller board.
  • Test buttons and sound: Press buttons to ensure sounds play correctly.

Example Code (Python for Raspberry Pi Pico):


Python
import board
import digitalio
import audiocore
import audioio

button1 = digitalio.DigitalInOut(board.GP15)
button1.switch_to_input(pull=digitalio.Pull.DOWN)

sound = audioio.WaveFile(open("sound1.wav", "rb"))
audio = audioio.AudioOut(board.SPEAKER)

while True:
if button1.value:
audio.play(sound)
while audio.playing:
pass

Use code with caution. Log in or register to view links
content_copy

Additional Tips:
  • Experiment with different button configurations and sound effects.
  • Add visual feedback (LEDs) for button presses.
  • Consider power management for battery-powered cosplays.
  • Explore more advanced features like volume control or sound mixing.
  • Seek online tutorials and forums for specific board and library guidance.
 
N 150

NotUglyPato

Abecedarian
Member
Access
Member
Access
1 Year Bronze Member 1y Bronze
Joined
Feb 9, 2025
Messages
94
Reaction score
0
Points
6
grants
₲57
Gaano ito tatagal kung powerbank ay mga mahigit 10k mAh
Here's a guide to creating a simple soundboard for cosplay using GPIO buttons:

1. Gather Materials:



  • Microcontroller board: Raspberry Pi Pico, Arduino Uno, or similar
  • Buttons: As many as you need for sound effects
  • Jumper wires
  • MicroSD card (if using Raspberry Pi Pico)
  • Speaker: Small, portable speaker or headphones
  • Sound files: Your desired sound effects in compatible formats (MP3, WAV, etc.)

2. Set Up Hardware:


  • Connect buttons:
    • Wire one button's pins to GPIO pins on the board, following the board's pinout diagram.
    • Use pull-down resistors (usually 10k ohms) between GPIO pins and ground to prevent floating signals.
  • Connect speaker:
    • Wire the speaker's audio output to the appropriate audio output pin on the board.

3. Write Code:


  • Choose a programming language: Python (CircuitPython for Pico), C++, or Arduino IDE's language.
  • Import necessary libraries: For GPIO control and audio playback.
  • Set GPIO pins as inputs: For the buttons.
  • Initialize audio playback: Set up the audio output device.
  • Create loop: Continuously check button states.
  • Play sounds: When a button is pressed, play the corresponding sound file using the audio library functions.

4. Load Sound Files:


  • Store sound files: On the board's memory (if possible) or on an external microSD card.
  • Access sound files: In your code using appropriate file paths.

5. Assemble and Test:


  • Secure components: On a breadboard or create a custom enclosure.
  • Upload code: To the microcontroller board.
  • Test buttons and sound: Press buttons to ensure sounds play correctly.

Example Code (Python for Raspberry Pi Pico):


Python
import board
import digitalio
import audiocore
import audioio

button1 = digitalio.DigitalInOut(board.GP15)
button1.switch_to_input(pull=digitalio.Pull.DOWN)

sound = audioio.WaveFile(open("sound1.wav", "rb"))
audio = audioio.AudioOut(board.SPEAKER)

while True:
if button1.value:
audio.play(sound)
while audio.playing:
pass

Use code with caution. Log in or register to view links
content_copy

Additional Tips:
  • Experiment with different button configurations and sound effects.
  • Add visual feedback (LEDs) for button presses.
  • Consider power management for battery-powered cosplays.
  • Explore more advanced features like volume control or sound mixing.
  • Seek online tutorials and forums for specific board and library guidance.
 
Top Bottom