Greetings! My name is Luni (LuniSolar Resident) and I joined Second Life on my birthday in 2020. My goal is to learn as much as I can about all kinds of interesting things. Right now (May 2020) my focus is on human avatar appearance and Linden Scripting Language. My plan is to learn how to do some basic things and see if I can create a worthwhile example to post in Marketplace for others to learn what I learned. My hope is to make this little exercises free as long as Second Life doesn't charge me for putting them there.
THIS ITEM WILL ATTACH AS A HUD WHEN YOU "ADD" IT. IT IS NOT A TOUCH HUD, JUST A BOX YOU CAN SEE ON THE LOWER LEFT.
(You can move it to any HUD position you prefer. It will work in-world if you like. Please read the Notecard to understand.)
This is an example of a few things:
1. Using an external test-to-speech engine to create Sounds for Second Life,
2. Using a Linden Scripting Language (LSL) Script to Play sounds,
3. Using LSL timer(s) to play a different sound every few minutes,
4. Playing sounds only you hear versus sounds other nearby can hear.
1. The external text-to-speech engine
This is a fun site out of an MIT student project and I hope you enjoy it as much as I do. I am not the site maintainer, but a big fan. I especially like the My Little Pony voices and find it's most effective if you keep generating the phrases repeatedly until you get exactly what you want. (This also helps the site learn, so you are contributing by doing that.) There is ore detail at the bottom of this note about the site and I highly recommend you go and play!
After using the WAVE file generator of the text-to-speech engine, I loaded the files into Audacity under macOS. This allowed me to convert the files from 32-bit to 16-bit and to boost the sound level by 3-db. Second Life requires 16-bit files and converts everything to monaural and the sound boost makes them easier to hear without distortion. More on sound levels a bit later.
2. Playing Sounds in Linden Scripting Language
There are three (3) commands important to playing sounds in Second Life: "pre-load", "play" and "toggle". There were other ways to go this in the past but they are "deprecated" and I didn't make any attempt to use them or know if they still exist. I discovered the pre-load capability when I played my first sound and the first words were missing. Once I used pre-load things played perfectly every time. The Play command is interesting because you can add a HUD to your viewer and have it play sounds only you can hear. I will use that myself for message like "Welcome Home" or "Someone just entered your area" or maybe even try them as UUID's under the viewer Preferences. (The Toggle sound is used when you might wear a HUD but want others wearby to hear the sound, too.
I haven't been here very long but I have already encountered many people who use Gestures to put a lot of text in Local Chat and play and animation and a sound. This can be quite tiring at a nice Club or Social Area so I would caution you against happily spamming everyone around you with sounds. But having you automated bot at your in-world store say "Greetings and Welcome to Your New Favorite Store!" might not be a bad thing if it isn't so loud every customer in your store hears it.
3. Timers and Repetitive Programming
The idea for this script came to me when I had a single sound file play when I touched a button on my screen, "Greetings and Welcome to Second Life!". I stood in the New Resident Welcome Area and pressed it every once in awhile just for fun, but quickly realized this was tedious for me and maybe annoying to the Helpers and Assistants there. So, I stopped that pretty quickly. I think. Well, if not, I apologize. Anyway, I thought it might be nice to have some idea about a varied message, maybe inspirational phrases in dark times. Or maybe even "the time is now 3:00 AM and why are you still online?". So, all of those are in my job jar and this first version is just a few things I grew up with from a famous feminist. All women know these and men should study them.
Anyway, the idea of a timer is it times things. Every so often it will "trigger an event" and you normally make that event do the same thing: play a sound, increment which sound to play for next time, and end. And then each time the timer expires the same code executes but plays a different sound. That is what this is intended to do, and you can build on things from there.
4. Playing Sounds only You hear
The use of llPlaySound() in a HUD plays a sound only you can hear. Using the exact same logic and syntax, a llTriggerSound() will play the sound from your avatar center at the moment of the trigger (the sound does not move if you move) to be heard by those around you. I recommend you use a HUD with llPlaySound() rather than llTriggerSound() but they are both valid uses if done properly.
-----
I love to learn and I hope you do, too! I am very much enjoying Second Life and the things you can do here. But most of all there are such nice people here who are happy to help you along with advice and guidance, wiith technical clues and just nice conversation. I hope you are one of them and enjoy learning new things and meeting new people. If possible, it would be very nice if you could leave a positive review on Marketplace. Thank you.
Love, Luni
-----
Text-to-Speech Attributions:
reference: https://fifteen.ai/
This is a text-to-speech tool that you can use to generate high-quality voices of various characters. The voices are generated in real time using multiple audio synthesis algorithms and customized deep neural networks trained on very little available data (between 55 seconds and 120 minutes of clean dialogue for each character). This project demonstrates a significant reduction in the amount of audio required to realistically clone voices while retaining their affective prosodies.
I plan to keep this tool up gratis and ad-free indefinitely. This website is intended for strictly non-commercial use. If you do use this website for your own projects / purposes and plan to put your results up online, I only ask that you include a citation (simply including the URL of this website is sufficient).
-----
There is a Thank You message included in the Sounds. When you delete that from the object, the script will reset and reread the sounds inside the object inventory. This will happen anytime you change contents of the object.
- Simple Timer Script is Full-Permission
- Short Sample Sound FIles for Dermonstration
- Notecard included for Future Reference
- Demonstrates Scripting Lists, Timers, Events
- All Sound Files generated 16-bit WAVE by me




