I'm noob, lol.
I'm trying to make a beep every time a character is show on a dialogue. So I put the code on the top of script.rpy just like shown here and here.
However, it doesn't beep while text appears...
It is a 3 seconds .mp3 file...
Can someone please help me? Thank you very much.
Adding sound to text like a typewritter
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
-
- Newbie
- Posts: 5
- Joined: Sat Jun 17, 2017 6:47 pm
- Contact:
- papiersam
- Veteran
- Posts: 231
- Joined: Fri Aug 12, 2016 2:24 pm
- Completed: Gem Hunt Beta, 1/Probably, Animunch
- Projects: The Panda Who Dreamed
- Contact:
Re: Adding sound to text like a typewritter
Most likely cause is that there's a delay/silence in the beginning of the mp3 file.
...I think.
...I think.
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3791
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: Adding sound to text like a typewritter
I would not suggest .mp3 for short audio. Use .wav or .ogg instead (but really best is .wav) due to two reasons:
.mp3 is not free
.mp3 is not optimised for instantaneous playback (it is compressed and needs to be decompressed first)
.wav will not experience the lag if you use Linear PCM
.ogg is less prone to playback delay and also royalty-free
The difference between a 160kbps lame mp3 and 160kbps ogg vorbis is practically non-existent. This is called "transparent" - meaning to the human ear, both files sound identical.
.mp3 is not free
.mp3 is not optimised for instantaneous playback (it is compressed and needs to be decompressed first)
.wav will not experience the lag if you use Linear PCM
.ogg is less prone to playback delay and also royalty-free
The difference between a 160kbps lame mp3 and 160kbps ogg vorbis is practically non-existent. This is called "transparent" - meaning to the human ear, both files sound identical.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Twitter
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
-
- Newbie
- Posts: 5
- Joined: Sat Jun 17, 2017 6:47 pm
- Contact:
Re: Adding sound to text like a typewritter
Well, I make it to work because I didn't set a character to say. lol I found Renpy would set as a narrator whatever.
Thank you.
I'm going to use .ogg because FL Studio seems to not have support for exporting PCM.Imperf3kt wrote:I would not suggest .mp3 for short audio. Use .wav or .ogg instead (but really best is .wav) due to two reasons:
.mp3 is not free
.mp3 is not optimised for instantaneous playback (it is compressed and needs to be decompressed first)
.wav will not experience the lag if you use Linear PCM
.ogg is less prone to playback delay and also royalty-free
The difference between a 160kbps lame mp3 and 160kbps ogg vorbis is practically non-existent. This is called "transparent" - meaning to the human ear, both files sound identical.
Thank you.
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3791
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: Adding sound to text like a typewritter
You can export to pcm using FLstudio, infact on my version (FLstudio 10 free/demo) .ogg needs to be added and is not included by default.
To use LPCM, choose the output to WAV option.
In my copy, at least, exporting to WAV is the program's default.
In any case, .ogg is perfectly suitable and smaller than lossless 16bit LPCM WAV
To use LPCM, choose the output to WAV option.
In my copy, at least, exporting to WAV is the program's default.
In any case, .ogg is perfectly suitable and smaller than lossless 16bit LPCM WAV
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Twitter
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
-
- Newbie
- Posts: 5
- Joined: Sat Jun 17, 2017 6:47 pm
- Contact:
Re: Adding sound to text like a typewritter
Interesting. Anyway, I have another question.
Can Renpy make a bleep for every letter entered?
Can Renpy make a bleep for every letter entered?
Re: Adding sound to text like a typewritter
Are you asking how to make a chyron or a Phoenix Wright-style beeping/chirping? I got you covered
(It drove me nuts finding out how to do it and I'm still not exactly sure how it works, but here's what I have)
Add your sound (type.wav) and, if you want to create a chyron-type thing this is how you set a different font for it (cour.ttf). I have this set up so the typing sound only occurs when the "loc" (location) 'character' speaks. If you want to apply this to more characters I'm sure this can be modified.
(It drove me nuts finding out how to do it and I'm still not exactly sure how it works, but here's what I have)
Code: Select all
init python:
def callback(event, **kwargs):
if event == "show":
renpy.music.play("type.wav", channel="sound", loop=True)
elif event == "slow_done" or event == "end":
renpy.music.stop(channel="sound")
$ loc = Character(what_font="cour.ttf", callback=callback)
Who is online
Users browsing this forum: AWizardWithWords, Google [Bot]