About SAM
SAM (Software Automatic Mouth) is a speech synthesis program made by Mark Barton and released in 1982. This library is a Unity C# port of SAM (https://github.com/kurtdekker/UnitySAM/) ported into s&box.
Usage
There are a few ways to utilize the library. You can choose to write the samples to a SoundStream yourself, or just call the ready-to-use methods.
For more information about the API, please check: https://asset.party/fish/sam/api/SAMLibrary/
/*
The following code will generates sound samples for the input "Hello, I am SAM!",
and play them as a 2D sound.
*/
var samples = SAMLibrary.Generate( "Hello, I am SAM!", 72, 64, 128, 128, false );
if ( samples == null )
return;
var stream = new SoundStream( SAMLibrary.SAMPLE_RATE );
stream.WriteData( samples );
var sound = stream.Play();
sound.ListenLocal = true;
Reviews