255 word Speech IC

newplumber

Senior Member
Hi
I see that picaxe hardware gadgets have mp3 player but I was looking on the site (in the wrong spot) for a
255 word IC chip...I forget the name of it but in short
it has 255 words programmed on it and think it uses I2C just wondering if there is such a thing
maybe I will have to get the mp3 player?
well thanks hopefully I am not repeating a millions threads like this
 

erco

Senior Member
+1, that Emic2 chip is the best available. There used to be others (Babblebot, Robovoice, Speakjet, etc) but those are long gone. If you want a retro project, you can still find phoneme-based SP0256-AL2 chips. Counterfeit (but apparently working) chips are available from China: https://www.ebay.com/itm/VOICE-SYNTHESIZER-IC-MICROCHIP-DIP-28-SP0256A-AL2/152765807007

But IMO your best bet is to get a pricier legit chip pair with the crystal: https://www.ebay.com/itm/VINTAGE-GI-SPEECH-VOICE-SYNTHESIZER-IC-SP0256A-AL2-CTS256A-AL2-Text-to-Speech/273088524341

That's still quite a project to assemble. The Emic2 costs just a bit more and is better in every way.
 

newplumber

Senior Member
Thanks Busby....lol ..I'm trying not to raise my plumbing service prices tho :)
Maybe someday I will try it out ...and thanks for mentioning it

Thanks erco I like the $2.70 price range....I will look into it see if theres a chance I could make it work
and yes your probably right to choose the pricier one. But this project isn't important so its worth a gamble

The reason why I just want some 255 word chip is because was thinking like
when i upgrade the phase10 wizard ...it could sound out levels...etc
 

Buzby

Senior Member
That SP0256 and CTS256 is exactly what I used to build a serial-to-speech box many years ago. As well as the two chips, you need a crystal to set baud rate, and an audio amplifier to drive a speaker.

It was a cool bit of kit all those years ago. I used it to generate alarm messages from a Siemens S5 PLC.

I actually built two of these units, and I think I've still got one in some dark corner of the attic. If I can find it I'll fire it up and revive that Old Skool voice !.

( These last few weeks I've been messing around in RPi world. In 5 mins I got buttons on my phone triggering realistic speech from the PC, over WiFi, with not a line of code to write. Clever, but I haven't a clue how it works.)

Cheers,

Buzby
 

premelec

Senior Member
@newplumber As I have mentioned before Roman Black's one bit sound... http://www.romanblack.com/picsound.htm an interesting prospect - I have some of the SP0256 units around here also... and the alophone data stuff... as erco mentioned these things could be quite a bit of work so the Emic2 likely worth the money if your time is worth $omething... There used to be some addressable ISD chips you could store and record words on and they seem to have gone the way of Hollerith cards...
 

newplumber

Senior Member
That SP0256 and CTS256 is exactly what I used to build a serial-to-speech box many years ago. As well as the two chips, you need a crystal to set baud rate, and an audio amplifier to drive a speaker.
@ Buzby ...thats what i also seen on ebay for cheap ...thats cool you mentioned it ...but I didn't know it needs a CTS256 and a crystal but sounds like i can win with it ...well i mean there is a chance

@premelec wow you sure got some interesting stuff ..seems like its way over my head and I even stood on a chair reading it :)
but for reals ...in the alophone data ....if I used the "TABLE 6 - ALLOPHONE ADDRESS TABLE" and only used those words ...seems I could have a go at it
I got the data sheet from here
http://www.futurebots.com/spo256.pdf
btw my time is worth 1/10000 of the value of all you pros time is

FWIW I was going to keep my awesome phase10 level decider with no changes ...till texasclod came up with the great idea
of throwing bells and whistles on it ...in the finnished projects post ... so I figured why not try learning ...see how far I can go with it.
Maybe I will up my chances at winning the game more :)
 

Buzby

Senior Member
... I didn't know it needs a CTS256 and a crystal but sounds like i can win with it ...
It dosn't 'need' a CTS256, but it makes life a lot easier if you use one !.

The SPO256 generates the allophones that words are made from. Without a CTS you have to first work out what allophones you need, then send all the right commands at the right speed to make it speak. The SPO uses a parallel input, so you need lots of pins.

The CTS takes care of all that. You just need to send words serially ( using serout maybe ) and the CTS then generates the allophone commands for the SPO, at sends them at the right speed.

Easier or cheaper, the choice is yours !

Cheers,

Buzby
 

newplumber

Senior Member
It dosn't 'need' a CTS256, but it makes life a lot easier if you use one !.
Okay...well your the pro at it ...I need to do more night classes see if I can make more sense on it

Easier or cheaper, the choice is yours !
I always try to take the easier road but then some how the signs get switched before I turn on to it
but I will try the easier way for this one and thanks
 

newplumber

Senior Member
I am waiting for chips I ordered ...but playing around with a program needing some help on math
and i didn't want to start a new post

I have a program that is running at setfreq m32 on a 20m2
and I have a code like this
Code:
main program: 
Inc W3
'does some more unprofessional stuff
'then sends to lcd display  
Pause 7135 
goto main ' could be DO...Loop for yous that dont like goto's
I want to see how close I can get to perfect a second using this code with no changes
and after 24 perfect minutes ...it reads 24*60=1440
but my count is showing 1450 at the exact time of the puter clock

so how can I figure how much to change on the pause 7135 (obvious its going to be less)
If i divide 1440 /1450 = .99310
then divide 7135 / .99310 = 7184 which is wrong

if I divide 1450 / 1440 =1.0069
then 7135 / 1.0069 = 7086.105 ...7087 rounded up which seems closer
is this the way a person would calculate to get the pause closer to a second
using my math ?
 

lbenson

Senior Member
Not specific to your question, but is there a reason you don't want to use the M2 "time" variable? It won't be truly exact, but with code executing once a second:
Code:
symbol lastTime = s_w1
do  ' one loop per second
  ' do something here
  do while lastTime = time : loop
  lastTime = time 
loop
or with code executing many times a second and additional code executing once a second:
Code:
symbol lastTime = s_w1
do  ' many loops per second
  if lastTime <> time then
    lastTime = time 
    ' do something here once a second
  endif
  ' do something many times a second
loop
This assumes that your "do something" takes less than a second--no long pauses.
 
Last edited:

newplumber

Senior Member
Thanks lbenson ... I forget about "time" variable. so of course I can use it
I am running at M32 so will have to do some changes to your sample ... I'll see if I can figure it out
but thanks again

btw here is my code I am using for the lcd ...its a lcd with the PCF8574A I/O expander
which I'll never use it on anything ...cause its not plumber friendly ...but good for tests
Code:
'I2c LCD testing program code with PCF8574 I/O expander 
'the LCD display is a 16X2 
#picaxe 20M2
#NO_DATA
'#terminal 38400
setfreq M32

Symbol bitRS   = bit8
Symbol bitWR   = bit9
Symbol bitE    = bit10
Symbol bcklght = bit11
Symbol bitD4   = bit12
Symbol bitD5   = bit13
Symbol bitD6   = bit14
Symbol bitD7   = bit15
symbol lastTime = s_w1

bcklght = 1      ' back light 1= on / 0= off
Initialisation:
  HI2cSetup I2CMASTER,  %01111110, I2CSLOW, I2CBYTE
  gosub Int : pause 2 
  
MainProgram: '================== Main Program ===========================

do  ' one loop per second

 Inc W4 ' add 1 to w4 
  bintoascii w4,b7,b6,b5,b4,b3

   b7 = b7 - 48 :b6 = b6 - 48:b5 = b5 - 48:b4 = b4 - 48:b3 = b3 - 48

lookup b7,("0","1","2","3","4","5","6","7","8","9"),B7
lookup b6,("0","1","2","3","4","5","6","7","8","9"),B6
lookup b5,("0","1","2","3","4","5","6","7","8","9"),B5
lookup b4,("0","1","2","3","4","5","6","7","8","9"),B4
lookup b3,("0","1","2","3","4","5","6","7","8","9"),B3

    If b7 = 48 then : b7 = 32 : endif
    If b6 = 48 and b7 = 32 then : b6 = 32 : endif
    If b5 = 48 and b6 = 32 then : b5 = 32 : endif
    If b4 = 48 and b5 = 32 then : b4 = 32 : endif

  b0 = $80 : Gosub SendB0AsCommandByte 
  b0 = "L" : Gosub SendB0AsDataByte    '1st line digit 1
  b0 = "C" : Gosub SendB0AsDataByte    '1st line digit 2
  b0 = "D" : Gosub SendB0AsDataByte    '1st line digit 3
  b0 = " " : Gosub SendB0AsDataByte    '1st line digit 4
  b0 = "1" : Gosub SendB0AsDataByte    '1st line digit 5
  b0 = "6" : Gosub SendB0AsDataByte    '1st line digit 6
  b0 = "x" : Gosub SendB0AsDataByte    '1st line digit 7  
  b0 = "2" : Gosub SendB0AsDataByte    '1st line digit 8  
  b0 = " " : Gosub SendB0AsDataByte    '1st line digit 9  
  b0 = "W" : Gosub SendB0AsDataByte    '1st line digit 10  
  b0 = " " : Gosub SendB0AsDataByte    '1st line digit 11  
  b0 = "E" : Gosub SendB0AsDataByte    '1st line digit 12
  b0 = "x" : Gosub SendB0AsDataByte    '1st line digit 13  
  b0 = "p" : Gosub SendB0AsDataByte    '1st line digit 14  
  b0 = "d" : Gosub SendB0AsDataByte    '1st line digit 15  
  b0 = "r" : Gosub SendB0AsDataByte    '1st line digit 16     

  b0 = $AA : Gosub SendB0AsCommandByte 
  b0 = "C" : Gosub SendB0AsDataByte    '2nd line digit 1
  b0 = "o" : Gosub SendB0AsDataByte    '2nd line digit 2    
  b0 = "u" : Gosub SendB0AsDataByte    '2nd line digit 3
  b0 = "n" : Gosub SendB0AsDataByte    '2nd line digit 4
  b0 = "t" : Gosub SendB0AsDataByte    '2nd line digit 5
  b0 = " " : Gosub SendB0AsDataByte    '2nd line digit 6
  b0 = "t" : Gosub SendB0AsDataByte    '2nd line digit 7  
  b0 = "e" : Gosub SendB0AsDataByte    '2nd line digit 8  
  b0 = "s" : Gosub SendB0AsDataByte    '2nd line digit 9  
  b0 = "t" : Gosub SendB0AsDataByte    '2nd line digit 10  
  b0 = " " : Gosub SendB0AsDataByte    '2nd line digit 11  
  b0 = b7 : Gosub SendB0AsDataByte     '2nd line digit 12  
  b0 = b6 : Gosub SendB0AsDataByte     '2nd line digit 13
  b0 = b5 : Gosub SendB0AsDataByte     '2nd line digit 14 
  b0 = b4 : Gosub SendB0AsDataByte     '2nd line digit 15 
  b0 = b3 : Gosub SendB0AsDataByte     '2nd line digit 16  
 
  do while lastTime = time : loop
  lastTime = time 
loop

Int:
  b0 = $33 : Gosub SendB0AsInitByte
  b0 = $33 : Gosub SendB0AsInitByte
  b0 = $32 : Gosub SendB0AsInitByte
  b0 = $28 : Gosub SendB0AsCommandByte
  b0 = $0C : Gosub SendB0AsCommandByte
  b0 = $06 : Gosub SendB0AsCommandByte
  b0 = $01 : Gosub SendB0AsCommandByte 
return

SendB0AsInitByte:
  Pause 15
  bitWR = 0         ; Keep WR signal low
SendB0AsCommandByte:
  bitRS = 0         ; Send byte as a command 
SendB0AsDataByte:
  bitD4 = bit4      ; Send msb first
  bitD5 = bit5
  bitD6 = bit6
  bitD7 = bit7
  bitE  = 1
  b2    = b1        ; b2 holds msb with E set
  bitE  = 0         ; b1 holds msb with E clear
  HI2cOut b1, ( b2, b1 )
  bitD4 = bit0      ; Send lsb second
  bitD5 = bit1
  bitD6 = bit2
  bitD7 = bit3
  bitE  = 1
  b2    = b1        ; b2 holds lsb with E set
  bitE  = 0         ; b1 holds lsb with E clear
  HI2cOut b1, ( b2, b1 )
  bitRS = 1         ; Send data byte next time
Return
The code is based off i think Hippys sample code from a different forum on this kind of lcd
I had one laying around so finally got it to work (of course thanks to the forum)
and I am glad I had only 1 laying around ....I love the six pin connector (with out the expander)
And of course I could rip off the expander but its fun trying different things
 

lbenson

Senior Member
With the "time" variable incrementing twice a second at 32mHz (or 8mHz), you could toggle a bit ("bit0 = bit0 XOR 1") with every change to time, and execute your once-a-second code when bit0=1 (after that toggle, within the "IF" block detecting the change in time).
 

AllyCat

Senior Member
Hi,

I want to see how close I can get to perfect a second using this code with no changes
and after 24 perfect minutes ...
Even if you avoid using too many "blocking" (time-slowing) commands (serin/out, pulsin/out, etc.), the "time" variable still might not increment perfectly accurately. So don't forget the CALIBFREQ command which should allow you to trim to within perhaps +/- 0.1%. At 1 part in 1,000 that's getting reasonably close to 1 second in 20 minutes. ;)

Cheers, Alan.
 

newplumber

Senior Member
you could toggle a bit ("bit0 = bit0 XOR 1")
@ lbenson thanks ... I tried to be smart and say "yep" totally understand ...but sadly ...I tried to and my computer (not me ...never me) got confused :)(joking of course)
I am guessing ....each time it reads "bit0 = bit0 XOR 1" ...it will flip from 1 to 0 to 1 to 0 ...I'm going to go back on "Time"

@ Allycat thanks ...I am going to do some testing on CALIBFREQ....I never used it.
that's getting reasonably close to 1 second in 20 minutes
yes I agree its reasonably close...actually that's perfect for my standards....was thinking about using 20m2/ lcd/expander... for a minute count down counter with out a RTC

Now I'm back to a meeting with myself ...on how to clean out my garage and only burn 2 calories or less
 

newplumber

Senior Member
True and thanks erco....I have some on order should be here soon...it was from a usa seller...but looks like the seller is acting from china...should have been here by now.

Also I ordered some other chips ....and after watching videos of the Emic2 .. which is pretty impressive .. I will order them when i have a important project.
 

lbenson

Senior Member
... my computer (not me ...never me) got confused
Not sure if it worked for you or not. Try this if you're still experimenting
Code:
#picaxe 20m2

setfreq M32 ' or M8
symbol lastTime = s_w1
do
  if lastTime <> time then
    lastTime = time
    bit0 = bit0 XOR 1
    if bit0 = 1 then
      sertxd(".") ' should "tick" once a second
    endif
  endif
loop
 

newplumber

Senior Member
Thanks lbenson ... I guess i didn't really understand how XOR works
I was thinking bit0 was part of "Time" somehow but then was thinking it can't because bit0 is part of b0
So I was studying "Time" variable...looking for a bit0 ....kinda like searching for dry land in the Mariana's trench
so now that you explained to me in awesome way ....now it makes sense...lol...I must be #1 on this forum with misunderstanding ratings
thanks again ...I will try it out.
 

newplumber

Senior Member
Mark, you are "#1" at trying out new things that you don't know about and succeeding
Maybe right about trying out new things ....mostly the wrong way :)...but I sometimes succeed ...ONLY because of all of you
great people on this forum patiently help me.... and someday maybe i can help you all by programming a pipe to stop leaking :)

that's funny lbenson .... "too short" ...I didn't know that.
btw I tried out your code and changed it to read minutes/seconds

Code:
#picaxe 20M2
#NO_DATA
#terminal 38400 

setfreq M32 ' or M8
symbol lastTime = s_w1
do
	
  if lastTime <> time then
    lastTime = time
    bit0 = bit0 XOR 1
    if bit0 = 1 then	    
      sertxd("minutes/seconds = ",#b2,":",#b1,cr,lf) ' should read minutes/seconds once a second
	inc b1
	if b1 => 60 then : b1 = 0 :INC b2:endif
    endif
  endif
loop
and after 64 minutes it was off by 2 seconds
that is as perfect as it can get i think for a 1 minute count down timer.
 

lbenson

Senior Member
I like "=>" here: if b1 => 60 then

That's thinking like a programmer--checking for ">" as well as "=", to cover possibilities that you think shouldn't occur, but might in exceptional circumstances.
 

newplumber

Senior Member
I always use that....=>...=< ...unless of course it has to hit a certain number
and your exactly right on "covering the possibilities".
I did some more tests on the code and it seems every 32.33333 minutes ....the timing is off 1 second slower
so even more precise then expected
 

premelec

Senior Member

erco

Senior Member
I'm sorry I don't have a number for that millisecond delay. IMO, the precision you imply is that there aren't any significant pauses before/after each word file, so those files would need to be edited carefully. I can say that a new play command will interrupt the file currently playing, so if timing is critical, you could manually insert experimentally-determined delays between play commands to get them close. My video below just advances tracks every few seconds. I suspect the big pauses are (mostly) recorded dead space.

BTW, those MP3 modules ONLY work with MP3 files (not WMA). Free online audio editor at https://mp3cut.net/

 

premelec

Senior Member
Thanks erco... I figured if the files are too close together i can put in a call delay... I had in mind to compose simple word sentences e.g. " voltage is twenty three" with 4 sound files being called... and a whole mess of short sound files... ;-0

Or perhaps have set of verbs and nouns called at random for senseless sentences...
 

erco

Senior Member
Like the old "time & temperature" phone number. The time is.....................eleven...................................thirty......................................seven!
 

premelec

Senior Member
I hope not ....... ;-0 One time years ago I went into Radio Shack and they had a talking clock - with Japanese heavily accented english.... I have made several Morse reporting devices since that's so easy compared to speech...
 

newplumber

Senior Member
thanks erco...I will need to practice on using that program (mp3 editor) on making short recording ...this reminds of the "Self confidence Help" tapes in the 80's when I was kid
where you send in your name and they just record everywhere on the cassette tape where a persons name should be.
I didn't need them tho...I always had confidence my project would fail...and confidence I have 100 more trys to get it right...and confidence it will fit in the garbage truck.:)

but back to the mp3...if I get lucky and they do show up...its going to fun using alot of words to make sentences.
can you control the speed of the player ....so you can go high/low pitch voice recordings?
plus they should have emotion voice control too.... like 0 - 10 which equals ....calm..... to.... YOUR CAR IS ON MY FOOT!
 

techElder

Well-known member
Mark, you should concentrate on making "phrases" that you want to play back at points in your program as opposed to concatenating words.
 

newplumber

Senior Member
your right texas.....it would save on memory...etc...well if/when I get it in my hand I'll do some testing


@erco ..thats what I wanted at first post of this thread...I should have put "17" word speech chip :)
but now since I have ordered a few different ones ..i'll try them first
but awesome to know and thanks
 

erco

Senior Member
I probably have one of those SP0256-17 types squirreled away somewhere. Never tried it, but I may have to after hearing this video. Sounds are pretty good, much better than are easily achieved with the more general SP0256 . https://www.youtube.com/watch?v=0t6P_8OkBVQ

BTW I may have a few of the oddball 3.12 MHz crystals these GI chips require, if anyone needs one. People often use the more common 3.579 MHz TV colorburst crystals, but the sound is always off.

Vintage Votrax chips are also very good. Rarer and pricier than the SP0256. https://www.youtube.com/watch?v=H7GLSQ-ZRts

 
Last edited:

premelec

Senior Member
@newplumber - there is a good open source sound editor "Audacity" with which you can make versions with pitch changed but not tempo and record small selected bits from larger files etc... as all new programs it takes some learning... ;-0 BTW one great fail with voice recognition was when a model at an auto show slammed her finger in a car door and then tried to get the car to recognize her voice in its distressed state... My phone does much better with my voice than it's keyboard... we're getting better at speechy stuff...
 

westaust55

Moderator
I probably have one of those SP0256-17 types squirreled away somewhere. Never tried it, but I may have to after hearing this video. Sounds are pretty good, much better than are easily achieved with the more general SP0256 .

BTW I may have a few of the oddball 3.12 MHz crystals these GI chips require, if anyone needs one. People often use the more common 3.579 MHz TV colorburst crystals, but the sound is always off.

Vintage Votrax chips are also very good. Rarer and pricier than the SP0256.
Futurlec sell a 3.2 MHz crystal that would be closer to 3.12 MHz
http://www.futurlec.com/cgi-bin/search/search.cgi?search=Crystal&search_base=40&page_no=5

I used a SC-01 chip from around 1980 for some years. With US naval research labs test to speech alogorithm (sent to me from US) codes for 6502 CPU and &#8220;wedged into Basic (changed LET to SAY) it worked very well for its day.
 

erco

Senior Member
Westy, you're always ahead of the curve! :)

Good info on that crystal. Some people have reported bad experiences with Futurelec. I have used them with good results, but sometime shipping is very slow. Order before you need them!
 

newplumber

Senior Member
@erco ... thanks good video...hate the screen the persons using...60 htz :( yuck...i think thats what made me turn into 4 eyes
I'm so happy I have a HD24" but still peeking at the 32 or bigger ones ...all the more easier to program


@ premelec ...thanks..I will try it when i get time ...poor model ...I'm sure someone was glad to help tho :)
I remember when droid first came out with voice rec...and my bro (always has the newest) was showing me how cool it was
only took 4 minutes and saying google about 200 times to bring up the app ...I never use it cause I can handle if I touch the wrong app vs phone bringing up wrong one
 

premelec

Senior Member
It occurs to me that if you have a sound generating device with a crystal controlling it substituting a Direct Digital Synthesizer and varying its frequency some while the sound is generated could be quite interesting... BTW Audacity has some far out echo and g-verb effects...
 
Top