Arduino SAM
All Classes Files Functions Enumerations Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
SAM Class Reference

Arduino API for SAM Text to Speach Engine. More...

#include <sam_arduino.h>

Public Types

enum  Voice {
  Elf , LittleRobot , StuffyGuy , LittleOldLaydy ,
  ExtraTerrestrial , Sam
}
 SAM Voices.
 

Public Member Functions

 SAM ()
 Constructor - for text output to Serial.
 
 SAM (sam_callback cb)
 Constructor - for output to callback.
 
 SAM (Print &stream, bool as_text=false)
 Constructor - for output to a stream.
 
 SAM (SAMOutputBase &out)
 Constructor - for output with a SAMOutputBase class.
 
 SAM (SAMOutputBase *out)
 Constructor - for output with a SAMOutputBase class.
 
 SAM (i2s_port_t i2s_num)
 Deactivated: Legacy Constructor - for obsolete ESP32 I2S.
 
 ~SAM ()
 Destroy the SAM object.
 
void setPitch (uint8_t pitch)
 
void setSpeed (uint8_t speed)
 
void setMouth (uint8_t mouth)
 
void setThroat (uint8_t th)
 
void setSingMode (bool sing)
 
void setVoice (Voice voice)
 Set the Voice object 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.
 
bool say (const char *text)
 Process text input.
 
bool sayPhone (const char *text)
 Process text input.
 
SAMOutputBasegetOutput ()
 provides access to output information
 
void end ()
 Delete voice and cst_audio_streaming_info.
 
void setOutputChannels (int channel_count)
 Defines the number of output channels (default 1)
 
int bitsPerSample ()
 Provides the bits per sample.
 
int channels ()
 Provides the number of channels.
 
void setVolume (uint8_t volPercent)
 set the Volume range 0-100;
 

Static Public Member Functions

static int sampleRate ()
 Provides the sample rate (44100)
 

Protected Member Functions

void setOutput (SAMOutputBase *out)
 
void write (uint8_t in)
 Writes the data to the output. The data is provided on 1 channel as unsinged byte of int16 values.
 
bool textToSpeach (const char *str, bool is_phonetic)
 

Static Protected Member Functions

static void outputByteCallback (void *cbdata, unsigned char b)
 Used to feed the audio result back to this class.
 

Protected Attributes

SAMOutputBasearduino_output =nullptr
 
int bits_per_sample = 16
 
int channel_count = 1
 
float volume = 1.0
 

Detailed Description

Arduino API for SAM Text to Speach Engine.


The documentation for this class was generated from the following file: