Difference between revisions of "Component: Speech (Phoneme) (Audio Output)"

From Flowcode Help
Jump to navigationJump to search
 
(15 intermediate revisions by 2 users not shown)
Line 14: Line 14:
 
==Speech (Phoneme) component==
 
==Speech (Phoneme) component==
 
Speech component allowing Phoneme based speech for use on an embedded platform. The simulation also has an advanced speech engine allowing realistic text to speech in multiple languages using the RealSpeak voice engine.
 
Speech component allowing Phoneme based speech for use on an embedded platform. The simulation also has an advanced speech engine allowing realistic text to speech in multiple languages using the RealSpeak voice engine.
 +
 +
==Component Source Code==
 +
 +
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_speech.fcfx FC_Comp_Source_speech.fcfx]
 +
 +
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_speech.fcfx FC_Comp_Source_speech.fcfx]
  
 
==Detailed description==
 
==Detailed description==
Line 19: Line 25:
  
  
''No detailed description exists yet for this component''
 
  
==Examples==
 
  
  
  
  
Example of Phoneme Speech (download and simulation)
 
{{Fcfile|Speech.fcfx|Speech}}
 
The Phoneme based speech can be output on Microcontroller hardware using a number of methods.
 
  
  
PWM - Outputs using a single PWM pin, a simple external RC low pass filter can be used to remove the high frequency PWM to create an audio signal.
 
  
Parallel - Outputs using a 8-bit port, a simple 8-bit R2R DAC circuit can be used to combine the bits into an audio signal.
 
  
Other - A third option is to use the ReadByteFromPhoneme macro to pull out the phoneme values a byte at a time which can be used to pass on to an external DAC etc.
 
  
  
Another example of Phoneme Speech, taking a reading from an analogue channel and speaking the Voltage. (download and simulation)
 
{{Fcfile|Voice Meter_v6.fcfx|Talking Volt Meter}}
 
Example of Real Speak Speech (simulation only)
 
{{Fcfile|Speech2.fcfx|Speech2}}
 
Adding additional language packs to the Real Speak engine.
 
  
[http://www.freedomscientific.com/downloads/RealSpeak-Solo-Direct-Voices/RealSpeak-Solo-Direct-Downloads.asp Real Speak Voice Downloads]
 
  
==Downloadable macro reference==
 
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadPhonemeLength'''
 
|-
 
| colspan="2" | Function to return the number of bytes used in a single phoneme array. 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 
| width="90%" | Phoneme
 
|-
 
| colspan="2" | Specifies a single Phoneme 
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''EnableOutput'''
 
|-
 
| colspan="2" | Sets up the output to allow the speech data to be streamed out. 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''DisableOutput'''
 
|-
 
| colspan="2" | Disables the output to prevent any buzzing etc while not speaking. 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
+
''No detailed description exists yet for this component''
|-
+
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
+
==Examples==
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadByteFromPhoneme'''
+
 
|-
+
 
| colspan="2" | Reads a single byte value from the specified phoneme data array. This function will not simulate correctly as it requires C style pointers. 
+
 
|-
+
 
|-
+
 
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
+
 
| width="90%" | Phoneme
+
 
|-
+
 
| colspan="2" | Specifies a single Phoneme 
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | Idx
 
|-
 
| colspan="2" | Specifies the position within the Phoneme 
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OutputPhoneme'''
 
|-
 
| colspan="2" | Streams a single Phoneme or string of comma seperated Phonemes. OutputPhoneme("OY") OutputPhoneme("OY,AY,OY") 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 
| width="90%" | DataString
 
|-
 
| colspan="2" |  
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetConsoleHandle'''
 
|-
 
| colspan="2" | Gets the handle to the console allowing data displaying on the panel etc. 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendByteArray'''
 
|-
 
| colspan="2" | Sends an array of bytes to the COM port. 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Data
 
|-
 
| colspan="2" | Data byte array to send 
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | Length
 
|-
 
| colspan="2" | Number of bytes to send 
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReceiveBinary16Bit'''
 
|-
 
| colspan="2" | Receives a binary 16-bit value split across two bytes. 
 
|-
 
|-
 
| width="10%" align="center" | [[File:]] -
 
| width="90%" | MSBfirst
 
|-
 
| colspan="2" | 0=Least significant byte first, 1=Most significant byte first 
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Timeout
 
|-
 
| colspan="2" | Max amount of time in ms to wait between bytes 
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReceiveFloat'''
 
|-
 
| colspan="2" | Attempts to receive a floating point number as ASCII characters and convert back into a numeric value. Note this function will receive until a timeout or a none numeric char is received, the none numeric char will be lost. 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Timeout
 
|-
 
| colspan="2" | Max time in ms to wait in between bytes 
 
|-
 
| width="10%" align="center" | [[File:]] -
 
| width="90%" | IgnoreData
 
|-
 
| colspan="2" | 0=Dont ignore any data, 1=Ignore any initial none numeric data 
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendFloat'''
 
|-
 
| colspan="2" | Sends out a floating point number as an ASCII String from the UART interface. 
 
|-
 
|-
 
| width="10%" align="center" | [[File:]] -
 
| width="90%" | Number
 
|-
 
| colspan="2" |  
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendHexNumber'''
 
|-
 
| colspan="2" | Sends out a number as an ASCII hexadecimal String from the UART interface. 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG
 
| width="90%" | Number
 
|-
 
| colspan="2" |  
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | NumChars
 
|-
 
| colspan="2" | Number of characters in the string data, 0 for auto, 2 for 0x00, 4 for 0x0000 
 
|-
 
| width="10%" align="center" | [[File:]] -
 
| width="90%" | Prefix
 
|-
 
| colspan="2" | Generate hexadecimal prefix 0x e.g. 1= 0xFF, 0= FF 
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
+
Example of Phoneme Speech (download and simulation)
|-
+
{{Fcfile|Speech.fcfx|Speech}}
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
+
The Phoneme based speech can be output on Microcontroller hardware using a number of methods.
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetFlowControl'''
 
|-
 
| colspan="2" | Allows the Flowcontrol signals to be enabled or disabled. 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | State
 
|-
 
| colspan="2" | A value of 0 disables flow control, 1 or above willl enable flow control. 
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
+
PWM - Outputs using a single PWM pin, a simple external RC low pass filter can be used to remove the high frequency PWM to create an audio signal.
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OpenPort'''
 
|-
 
| colspan="2" | Opens the currently selected COM port, allowing data to be sent and received. 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
 +
Parallel - Outputs using a 8-bit port, a simple 8-bit R2R DAC circuit can be used to combine the bits into an audio signal.
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
+
Other - A third option is to use the ReadByteFromPhoneme macro to pull out the phoneme values a byte at a time which can be used to pass on to an external DAC etc.
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReceiveHexNumber'''
 
|-
 
| colspan="2" | Attempts to receive a hex number as ASCII characters and convert back into a numeric value. Note this function will receive until a timeout or a none hexadecimal char is received, the none numeric char will be lost. 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Timeout
 
|-
 
| colspan="2" | Max time in ms to wait in between bytes 
 
|-
 
| width="10%" align="center" | [[File:]] -
 
| width="90%" | IgnoreData
 
|-
 
| colspan="2" | 0=Dont ignore any data, 1=Ignore any initial none numeric data 
 
|-
 
| width="10%" align="center" | [[File:]] -
 
| width="90%" | Prefix
 
|-
 
| colspan="2" | Look for prefix before receiving, 1=0xFF, 0=FF 
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u32-icon.png]] - ULONG
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
+
Another example of Phoneme Speech, taking a reading from an analogue channel and speaking the Voltage. (download and simulation)
|-
+
{{Fcfile|Voice Meter.fcfx|Talking Volt Meter}}
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetProp'''
 
|-
 
| colspan="2" | Allows the COM port property to be set from a parent component. 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 
| width="90%" | PropName
 
|-
 
| colspan="2" |  
 
|-
 
| width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG
 
| width="90%" | PropVal
 
|-
 
| colspan="2" |  
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
 +
==Macro reference==
  
 +
===DisableOutput===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendBinary32Bit'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''DisableOutput'''
 
|-
 
|-
| colspan="2" | Sends out a 32-bit binary value split across four bytes. 
+
| colspan="2" | Disables the output to prevent any buzzing etc while not speaking. 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG
 
| width="90%" | Value
 
|-
 
| colspan="2" |  
 
|-
 
| width="10%" align="center" | [[File:]] -
 
| width="90%" | MSBfirst
 
 
|-
 
|-
| colspan="2" | 0=Least significant byte first, 1=Most significant byte first 
 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 366: Line 103:
  
  
 +
===EnableOutput===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SendBinaryFloat'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''EnableOutput'''
 
|-
 
|-
| colspan="2" | Sends out a 32-bit binary floating point value split across four bytes. 
+
| colspan="2" | Sets up the output to allow the speech data to be streamed out. 
 
|-
 
|-
|-
 
| width="10%" align="center" | [[File:]] -
 
| width="90%" | Value
 
|-
 
| colspan="2" |  
 
|-
 
| width="10%" align="center" | [[File:]] -
 
| width="90%" | MSBfirst
 
|-
 
| colspan="2" | 0=Least significant byte first, 1=Most significant byte first 
 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 389: Line 117:
  
  
 +
===OutputPhoneme===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetProp'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''OutputPhoneme'''
 
|-
 
|-
| colspan="2" | Allows the property filter for the COM port list to be copied to a parent component. 
+
| colspan="2" | Streams a single Phoneme or string of comma seperated Phonemes. OutputPhoneme("OY") OutputPhoneme("OY,AY,OY") 
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | PropName
+
| width="90%" | DataString
 
|-
 
|-
 
| colspan="2" |  
 
| colspan="2" |  
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===ReadByteFromPhoneme===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReceiveByteArray'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadByteFromPhoneme'''
 
|-
 
|-
| colspan="2" | Attempts to receive an array of bytes using the COM port Returns the number of bytes received.  
+
| colspan="2" | Reads a single byte value from the specified phoneme data array. This function will not simulate correctly as it requires C style pointers. 
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Data
+
| width="90%" | Phoneme
 
|-
 
|-
| colspan="2" |  
+
| colspan="2" | Specifies a single Phoneme 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | MaxLength
+
| width="90%" | Idx
 
|-
 
|-
| colspan="2" | Max number of bytes to try and read 
+
| colspan="2" | Specifies the position within the Phoneme 
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Timeout
 
|-
 
| colspan="2" | Time to wait for incoming data in milliseconds 
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===ReadPhonemeLength===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReceiveString'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadPhonemeLength'''
 
|-
 
|-
| colspan="2" | Attempts to receive an string using the COM port Returns the number of bytes received.  
+
| colspan="2" | Function to return the number of bytes used in a single phoneme array. 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | Timeout
 
|-
 
| colspan="2" | Time to wait for incoming data in milliseconds 
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | MaxLength
 
|-
 
| colspan="2" | Max number of bytes to try and read 
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PWMEnable'''
 
|-
 
| colspan="2" | Allows pulse width modulated transistor outputs to be switched on or off. Bit 0 = Enable AB Bit 1 = A / Bit 2 = B Bit 3 = C / Bit 4 = D Bit 5 = Enable CD 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | EnableMask
 
|-
 
| colspan="2" | Range 0-63 or 0b00000 to 0b111111 
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 
|-
 
| colspan="2" |  
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetProp'''
 
|-
 
| colspan="2" | Allows the property filter for the COM port list to be copied to a parent component. 
 
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | PropName
+
| width="90%" | Phoneme
 
|-
 
|-
| colspan="2" |  
+
| colspan="2" | Specifies a single Phoneme 
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
 
 
  
  
Line 515: Line 185:
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
 +
|-
 +
|-
 +
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
 +
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Phoneme Settings
 
|-
 
|-
 
|-
 
|-
Line 567: Line 241:
 
| colspan="2" | The actual port pin assigned to the selected PWM channel. 
 
| colspan="2" | The actual port pin assigned to the selected PWM channel. 
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
+
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" | Word Dictionary
+
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Phoneme Selection
|-
 
| colspan="2" |  
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-12-icon.png]]
 
| width="90%" | Phonemes
 
|-
 
| colspan="2" |  
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]]
 
| width="90%" | Word Count
 
 
|-
 
|-
| colspan="2" |  
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
| width="90%" | Add
 
|-
 
| colspan="2" |  
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
 
| width="90%" | Word
 
|-
 
| colspan="2" |  
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
 
| width="90%" | Phonemes
 
|-
 
| colspan="2" |  
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
| width="90%" | Delete All
 
|-
 
| colspan="2" |  
 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
 
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]]
Line 931: Line 574:
 
|-
 
|-
 
| colspan="2" | Phoneme selection 
 
| colspan="2" | Phoneme selection 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connections'''
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Simulations'''
 
|-
 
 
|}
 
|}

Latest revision as of 10:11, 5 April 2023

Author Matrix Ltd
Version 1.2
Category Audio Output


Speech (Phoneme) component

Speech component allowing Phoneme based speech for use on an embedded platform. The simulation also has an advanced speech engine allowing realistic text to speech in multiple languages using the RealSpeak voice engine.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_speech.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_speech.fcfx

Detailed description

No detailed description exists yet for this component

Examples

Example of Phoneme Speech (download and simulation) FC6 Icon.png Speech The Phoneme based speech can be output on Microcontroller hardware using a number of methods.


PWM - Outputs using a single PWM pin, a simple external RC low pass filter can be used to remove the high frequency PWM to create an audio signal.

Parallel - Outputs using a 8-bit port, a simple 8-bit R2R DAC circuit can be used to combine the bits into an audio signal.

Other - A third option is to use the ReadByteFromPhoneme macro to pull out the phoneme values a byte at a time which can be used to pass on to an external DAC etc.


Another example of Phoneme Speech, taking a reading from an analogue channel and speaking the Voltage. (download and simulation) FC6 Icon.png Talking Volt Meter

Macro reference

DisableOutput

Fc9-comp-macro.png DisableOutput
Disables the output to prevent any buzzing etc while not speaking. 
Fc9-void-icon.png - VOID Return


EnableOutput

Fc9-comp-macro.png EnableOutput
Sets up the output to allow the speech data to be streamed out. 
Fc9-void-icon.png - VOID Return


OutputPhoneme

Fc9-comp-macro.png OutputPhoneme
Streams a single Phoneme or string of comma seperated Phonemes. OutputPhoneme("OY") OutputPhoneme("OY,AY,OY") 
Fc9-string-icon.png - STRING DataString
 
Fc9-void-icon.png - VOID Return


ReadByteFromPhoneme

Fc9-comp-macro.png ReadByteFromPhoneme
Reads a single byte value from the specified phoneme data array. This function will not simulate correctly as it requires C style pointers. 
Fc9-string-icon.png - STRING Phoneme
Specifies a single Phoneme 
Fc9-u16-icon.png - UINT Idx
Specifies the position within the Phoneme 
Fc9-u8-icon.png - BYTE Return


ReadPhonemeLength

Fc9-comp-macro.png ReadPhonemeLength
Function to return the number of bytes used in a single phoneme array. 
Fc9-string-icon.png - STRING Phoneme
Specifies a single Phoneme 
Fc9-u16-icon.png - UINT Return


Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png Phoneme Settings
Fc9-type-16-icon.png Phoneme Selection
Selects which phonemes are included in the embedded firmware 
Fc9-type-16-icon.png Phoneme Data Set
Specifies if the phonemes used are based on the inbuilt phoneme wav files set or a custom file set. To create your own phonemes, copy the wav files from the components directory, then overwrite the phonemes you wish to edit. Phonemes are re-parsed on simulation start and on compile to C. 
Fc9-type-14-icon.png Pitch (Hz)
The frequency at which the phoneme data is output in bytes/samples per second. 
Fc9-type-14-icon.png Phoneme Data Size
The number of bytes used by the current phoneme selection 
Fc9-type-14-icon.png ROM Size
The maximum number of bytes available in the ROM of the selected target device. The ROM has to contain the program as well as the Phoneme data. 
Fc9-type-14-icon.png Base ROM Address
The address in ROM to place the phoneme data. It is recomended to always use the suggested address as this will place the phonemes right at the end of ROM and away from the program. 
Fc9-type-14-icon.png Suggested Address
The ideal address to allow all the selected phonemes to fit into the end of the ROM memory Thereby allowing the maximum space for the user program. 
Fc9-type-16-icon.png Output Mode
Determines how the phoneme data is going to be output. 
Fc9-type-16-icon.png PWM Pin
PWM channel selection used to determine which PWM peripheral to stream the Phoneme data to. 
Fc9-type-5-icon.png PWM Pin
The actual port pin assigned to the selected PWM channel. 
Fc9-conn-icon.png Phoneme Selection
Fc9-type-7-icon.png Select All
Selects all Phonemes 
Fc9-type-7-icon.png Select None
Deselects all Phonemes 
Fc9-type-7-icon.png PA1 (10ms)
10ms Pause - Always included 
Fc9-type-7-icon.png PA2 (30ms)
30ms Pause - Always included 
Fc9-type-7-icon.png PA3 (50ms)
50ms Pause - Always included 
Fc9-type-7-icon.png PA4 (100ms)
100ms Pause - Always included 
Fc9-type-7-icon.png PA5 (200ms)
200ms Pause - Always included 
Fc9-type-7-icon.png AA - hOt
Phoneme selection 
Fc9-type-7-icon.png AE - hAt
Phoneme selection 
Fc9-type-7-icon.png AO - AUght
Phoneme selection 
Fc9-type-7-icon.png AR - alARm
Phoneme selection 
Fc9-type-7-icon.png AW - sOUnd
Phoneme selection 
Fc9-type-7-icon.png AX - Apple
Phoneme selection 
Fc9-type-7-icon.png AY - skY
Phoneme selection 
Fc9-type-7-icon.png BB1 - Brown
Phoneme selection 
Fc9-type-7-icon.png BB2 - Business
Phoneme selection 
Fc9-type-7-icon.png CH - CHurCH
Phoneme selection 
Fc9-type-7-icon.png DD1 - enD
Phoneme selection 
Fc9-type-7-icon.png DD2 - Down
Phoneme selection 
Fc9-type-7-icon.png DH1 - THey
Phoneme selection 
Fc9-type-7-icon.png DH2 - baTHe
Phoneme selection 
Fc9-type-7-icon.png EH - Extent
Phoneme selection 
Fc9-type-7-icon.png EL - angLE
Phoneme selection 
Fc9-type-7-icon.png ER1 - intERupt
Phoneme selection 
Fc9-type-7-icon.png ER2 - bIRd
Phoneme selection 
Fc9-type-7-icon.png EY - grEAt
Phoneme selection 
Fc9-type-7-icon.png FF - Food
Phoneme selection 
Fc9-type-7-icon.png GG1 - Get
Phoneme selection 
Fc9-type-7-icon.png GG2 - Green
Phoneme selection 
Fc9-type-7-icon.png GG3 - anGer
Phoneme selection 
Fc9-type-7-icon.png HH1 - Help
Phoneme selection 
Fc9-type-7-icon.png HH2 - Hope
Phoneme selection 
Fc9-type-7-icon.png IH - sIt
Phoneme selection 
Fc9-type-7-icon.png IY - trEAt
Phoneme selection 
Fc9-type-7-icon.png JH - inJure
Phoneme selection 
Fc9-type-7-icon.png KK1 - Clown
Phoneme selection 
Fc9-type-7-icon.png KK2 - tasK
Phoneme selection 
Fc9-type-7-icon.png KK3 - Crane
Phoneme selection 
Fc9-type-7-icon.png LL - Lake
Phoneme selection 
Fc9-type-7-icon.png MM - Milk
Phoneme selection 
Fc9-type-7-icon.png NG - aNGer
Phoneme selection 
Fc9-type-7-icon.png NN1 - thiN
Phoneme selection 
Fc9-type-7-icon.png NN2 - Now
Phoneme selection 
Fc9-type-7-icon.png OR - stORe
Phoneme selection 
Fc9-type-7-icon.png OW - zOne
Phoneme selection 
Fc9-type-7-icon.png OY - nOIse
Phoneme selection 
Fc9-type-7-icon.png PP - triP
Phoneme selection 
Fc9-type-7-icon.png RR1 - WRite
Phoneme selection 
Fc9-type-7-icon.png RR2 - gRease
Phoneme selection 
Fc9-type-7-icon.png SH - SHip
Phoneme selection 
Fc9-type-7-icon.png SS - teSt
Phoneme selection 
Fc9-type-7-icon.png TH - THin
Phoneme selection 
Fc9-type-7-icon.png TT1 - tesT
Phoneme selection 
Fc9-type-7-icon.png TT2 - Test
Phoneme selection 
Fc9-type-7-icon.png UH - bOOk
Phoneme selection 
Fc9-type-7-icon.png UW1 - cumpUter
Phoneme selection 
Fc9-type-7-icon.png UW2 - fOOd
Phoneme selection 
Fc9-type-7-icon.png VV - Vest
Phoneme selection 
Fc9-type-7-icon.png WH - WHite
Phoneme selection 
Fc9-type-7-icon.png WW - Work
Phoneme selection 
Fc9-type-7-icon.png XR - haiR
Phoneme selection 
Fc9-type-7-icon.png YR - clEAR
Phoneme selection 
Fc9-type-7-icon.png YY1 - compUter
Phoneme selection 
Fc9-type-7-icon.png YY2 - Yes
Phoneme selection 
Fc9-type-7-icon.png ZH - aZure
Phoneme selection 
Fc9-type-7-icon.png ZZ - phaSe
Phoneme selection