All Projects → s-macke → Sam

s-macke / Sam

Software Automatic Mouth - Tiny Speech Synthesizer

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Sam

Pysptk
A python wrapper for Speech Signal Processing Toolkit (SPTK).
Stars: ✭ 297 (-55.47%)
Mutual labels:  speech-synthesis
Espnet
End-to-End Speech Processing Toolkit
Stars: ✭ 4,533 (+579.61%)
Mutual labels:  speech-synthesis
Athena
an open-source implementation of sequence-to-sequence based speech processing engine
Stars: ✭ 542 (-18.74%)
Mutual labels:  speech-synthesis
Cognitive Speech Tts
Microsoft Text-to-Speech API sample code in several languages, part of Cognitive Services.
Stars: ✭ 312 (-53.22%)
Mutual labels:  speech-synthesis
Libfaceid
libfaceid is a research framework for prototyping of face recognition solutions. It seamlessly integrates multiple detection, recognition and liveness models w/ speech synthesis and speech recognition.
Stars: ✭ 354 (-46.93%)
Mutual labels:  speech-synthesis
Gantts
PyTorch implementation of GAN-based text-to-speech synthesis and voice conversion (VC)
Stars: ✭ 460 (-31.03%)
Mutual labels:  speech-synthesis
Parakeet
PAddle PARAllel text-to-speech toolKIT (supporting WaveFlow, WaveNet, Transformer TTS and Tacotron2)
Stars: ✭ 279 (-58.17%)
Mutual labels:  speech-synthesis
Fastspeech
The Implementation of FastSpeech based on pytorch.
Stars: ✭ 600 (-10.04%)
Mutual labels:  speech-synthesis
Voice Builder
An opensource text-to-speech (TTS) voice building tool
Stars: ✭ 362 (-45.73%)
Mutual labels:  speech-synthesis
Termit
Translations with speech synthesis in your terminal as a ruby gem
Stars: ✭ 505 (-24.29%)
Mutual labels:  speech-synthesis
Hifi Gan
HiFi-GAN: Generative Adversarial Networks for Efficient and High Fidelity Speech Synthesis
Stars: ✭ 325 (-51.27%)
Mutual labels:  speech-synthesis
Espeak
eSpeak NG is an open source speech synthesizer that supports 101 languages and accents.
Stars: ✭ 339 (-49.18%)
Mutual labels:  speech-synthesis
Autovc
AutoVC: Zero-Shot Voice Style Transfer with Only Autoencoder Loss
Stars: ✭ 485 (-27.29%)
Mutual labels:  speech-synthesis
Nnmnkwii
Library to build speech synthesis systems designed for easy and fast prototyping.
Stars: ✭ 308 (-53.82%)
Mutual labels:  speech-synthesis
Flowtron
Flowtron is an auto-regressive flow-based generative network for text to speech synthesis with control over speech variation and style transfer
Stars: ✭ 546 (-18.14%)
Mutual labels:  speech-synthesis
Glow Tts
A Generative Flow for Text-to-Speech via Monotonic Alignment Search
Stars: ✭ 284 (-57.42%)
Mutual labels:  speech-synthesis
Sprocket
Voice Conversion Tool Kit
Stars: ✭ 425 (-36.28%)
Mutual labels:  speech-synthesis
Parrot
RNN-based generative models for speech.
Stars: ✭ 601 (-9.9%)
Mutual labels:  speech-synthesis
Melgan Neurips
GAN-based Mel-Spectrogram Inversion Network for Text-to-Speech Synthesis
Stars: ✭ 592 (-11.24%)
Mutual labels:  speech-synthesis
Java Speech Api
The J.A.R.V.I.S. Speech API is designed to be simple and efficient, using the speech engines created by Google to provide functionality for parts of the API. Essentially, it is an API written in Java, including a recognizer, synthesizer, and a microphone capture utility. The project uses Google services for the synthesizer and recognizer. While this requires an Internet connection, it provides a complete, modern, and fully functional speech API in Java.
Stars: ✭ 490 (-26.54%)
Mutual labels:  speech-synthesis

SAM

Software Automatic Mouth - Tiny Speech Synthesizer

What is SAM?

Sam is a very small Text-To-Speech (TTS) program written in C, that runs on most popular platforms. It is an adaption to C of the speech software SAM (Software Automatic Mouth) for the Commodore C64 published in the year 1982 by Don't Ask Software (now SoftVoice, Inc.). It includes a Text-To-Phoneme converter called reciter and a Phoneme-To-Speech routine for the final output. It is so small that it will work also on embedded computers. On my computer it takes less than 39KB (much smaller on embedded devices as the executable-overhead is not necessary) of disk space and is a fully stand alone program. For immediate output it uses the SDL-library, otherwise it can save .wav files.

An online version and executables for Windows can be found on the web site: http://simulationcorner.net/index.php?page=sam

Compile

Simply type "make" in your command prompt. In order to compile without SDL remove the SDL statements from the CFLAGS and LFLAGS variables in the file "Makefile".

It should compile on every UNIX-like operating system. For Windows you need Cygwin or MinGW( + libsdl).

Fork

Take a look at https://github.com/vidarh/SAM for a more refactored and cleaner version of the code.

Usage

type

./sam I am Sam

for the first output.

If you have disabled SDL try

./sam -wav i_am_sam.wav I am Sam

to get a wav file. This file can be played by many media players available for the PC.

you can try other options like -pitch number -speed number -throat number -mouth number

Some typical values written in the original manual are:

DESCRIPTION          SPEED     PITCH     THROAT    MOUTH
Elf                   72        64        110       160
Little Robot          92        60        190       190
Stuffy Guy            82        72        110       105
Little Old Lady       82        32        145       145
Extra-Terrestrial    100        64        150       200
SAM                   72        64        128       128

It can even sing look at the file "sing" for a small example.

For the phoneme input table look in the Wiki.

A description of additional features can be found in the original manual at http://www.retrobits.net/atari/sam.shtml or in the manual of the equivalent Apple II program http://www.apple-iigs.info/newdoc/sam.pdf

Adaption To C

This program (disassembly at http://hitmen.c02.at/html/tools_sam.html) was converted semi-automatic into C by converting each assembler opcode. e. g.

lda 56		=>	A = mem[56];
jmp 38018  	=>	goto pos38018;
inc 38		=>	mem[38]++;
.			.
.			.

Then it was manually rewritten to remove most of the jumps and register variables in the code and rename the variables to proper names. Most of the description below is a result of this rewriting process.

Unfortunately it is still unreadable. But you should see from where I started :)

Short description

First of all I will limit myself here to a very coarse description. There are very many exceptions defined in the source code that I will not explain. Also a lot of code is unknown for me e. g. Code47503. For a complete understanding of the code I need more time and especially more eyes have a look on the code.

Reciter

It changes the english text to phonemes by a ruleset shown in the wiki.

The rule " ANT(I)", "AY", means that if he find an "I" with previous letters " ANT", exchange the I by the phoneme "AY".

There are some special signs in this rules like # & @ ^ + : % which can mean e. g. that there must be a vocal or a consonant or something else.

With the -debug option you will get the corresponding rules and the resulting phonemes.

Output

Here is the full tree of subroutine calls:

SAMMain() Parser1() Parser2() Insert() CopyStress() SetPhonemeLength() Code48619() Code41240() Insert() Code48431() Insert()

Code48547
	Code47574
		Special1
		Code47503
		Code48227

SAMMain() is the entry routine and calls all further routines. Parser1 transforms the phoneme input and transforms it to three tables phonemeindex[] stress[] phonemelength[] (zero at this moment)

This tables are now changed:

Parser2 exchanges some phonemes by others and inserts new. CopyStress adds 1 to the stress under some circumstances SetPhonemeLength sets phoneme lengths. Code48619 changes the phoneme lengths Code41240 adds some additional phonemes Code48431 has some extra rules

The wiki shows all possible phonemes and some flag fields.
The final content of these tables can be seen with the -debug command.

In the function PrepareOutput() these tables are partly copied into the small tables: phonemeindexOutput[] stressOutput[] phonemelengthOutput[] for output.

Final Output

Except of some special phonemes the output is build by a linear combination:

A =   A1 * sin ( f1 * t ) +
      A2 * sin ( f2 * t ) +
      A3 * rect( f3 * t )

where rect is a rectangular function with the same periodicity like sin. It seems really strange, but this is really enough for most types of phonemes.

Therefore the above phonemes are converted with some tables to pitches[] frequency1[] = f1 frequency2[] = f2 frequency3[] = f3 amplitude1[] = A1 amplitude2[] = A2 amplitude3[] = A3

Above formula is calculated in one very good omptimized routine. It only consist of 26 commands:

48087: 	LDX 43		; get phase	
CLC		
LDA 42240,x	; load sine value (high 4 bits)
ORA TabAmpl1,y	; get amplitude (in low 4 bits)
TAX		
LDA 42752,x	; multiplication table
STA 56		; store 

LDX 42		; get phase
LDA 42240,x	; load sine value (high 4 bits)
ORA TabAmpl2,y	; get amplitude (in low 4 bits)
TAX		
LDA 42752,x	; multiplication table
ADC Var56	; add with previous values
STA 56		; and store

LDX 41		; get phase
LDA 42496,x	; load rect value (high 4 bits)
ORA TabAmpl3,y	; get amplitude (in low 4 bits)
TAX		
LDA 42752,x	; multiplication table
ADC 56		; add with previous values

ADC #136		
LSR A		; get highest 4 bits
LSR A		
LSR A		
LSR A		
STA 54296	;SID   main output command

The rest is handled in a special way. At the moment I cannot figure out in which way. But it seems that it uses some noise (e. g. for "s") using a table with random values.

License

The software is a reverse-engineered version of a software published more than 34 years ago by "Don't ask Software".

The company no longer exists. Any attempt to contact the original authors failed. Hence S.A.M. can be best described as Abandonware (http://en.wikipedia.org/wiki/Abandonware)

As long this is the case I cannot put my code under any specific open source software license. However the software might be used under the "Fair Use" act (https://en.wikipedia.org/wiki/FAIR_USE_Act) in the USA.

Contact

If you have questions don' t hesitate to ask me. If you discovered some new knowledge about the code please mail me.

Sebastian Macke Email: [email protected]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].