A very basic soundboard for Android, written in Kotlin.
Add a sound to the view by doing the following:
- Place a sound file (such as
example.wav
) in the raw directory. - Add a string to strings.xml, which represents the displayed text in the button. Like this:
<resources>
<string name="app_name">kotlin-soundboard</string>
<string name="splash_sounds">Splash sounds</string>
<string name="splash">splash</string>
<string name="example">example sound</string>
</resources>
- Register the button in MainActivity.kt, by adding it to
layout
:
val layout = arrayOf(
"textview_splash_sounds",
"button_splash",
"button_example"
)
It is also possible to add textviews to the layout to split the sounds in categories.