Snippets

SinnyStar [Ren'Py] Speaking Sound

Created by J. Tran

File audio.rpy Added

  • Ignore whitespace
  • Hide word diff
+init python:
+
+    sfx = "sfx/"
+
+    # Blips
+    sfx_blip = sfx+"blip.wav"
+    renpy.music.register_channel("blip", mixer="blip", loop=True, tight=False)
+    
+    def blip_play(on=False):
+        if on:
+            renpy.music.play(sfx_blip, channel="blip")
+        else:
+            renpy.music.stop(channel="blip")
+    
+    def blips(event, **kwargs):
+        if event == "show" or event == "begin":
+            blip_play(True)          
+        if event == "slow_done" or event == "end":
+            blip_play(False)

File screens.rpy Added

  • Ignore whitespace
  • Hide word diff
+screen preferences():
+
+    # ...
+
+            frame:
+                style_group "pref"
+                has vbox
+
+                label _("Text Volume")
+                bar value MixerValue("blip")
+
+                textbutton _("Test"):
+                    action Play("blip", sfx_blip, loop=False)
+                    style "soundtest_button"
HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.