Go Down

Topic: using speaker for talking arduino (Read 322 times) previous topic - next topic

Isra2006

Jan 17, 2020, 11:52 pm Last Edit: Jan 17, 2020, 11:54 pm by Isra2006
i have a project and i need to make it talks , i am using the talkie library and i have
Code: [Select]
include "talkie.h"
Talkie voice;
const int8_t spDinar[] PROGMEM = {0x0A,0x28,0xA5,0x72,0xE8,0x29,0x89,0x6B,0xB0,0xD2,0x61,0xA7,0x40,0xAE,0x2D,0x4A,0x86,0x13};


this is one of the examples in this library
my problem is
i know how to transform voice file to hex to give arduino the ability of spilling it i am using the HxD hex editor to find the hex
but the HxD is giving a very lot of hex values such as this
Code: [Select]
FF F3 44 C4 00 12 72 82 18 00 08 44 B9 64 00 00 C6 CC 08 63 18 E0 44 00 66 31 E0 00 00 00 79 8C 71 8F 00 01 C1 FF F0 2F 7D 4E 7E 42 35 4E 7F D5 ED F5 39 CF 3B C8 46 E4 65 7D 09 CE 7E 84 3B A9 DF EA 77 90 99 CF CE 2C F3 3F F3 3C 3C B0 04 73 0C E9 E0 61 E1 EF 9D 0C CE 41 44 91 AD 12 B6 30 FF F3 44 C4 09 12 70 42 24 00 18 C6 25 A4 BF A0 54 59 3D 17 4D E9 B4 F3 87 02 AB 8E FE DE FD EA F6 B4 D9 3F C9 82 B1 4F FF 0E EF 22 F8 57 0E FB DC 57 FF FB 07 42 5F BB DF FC 20 A9 82 61 45 24 37 BE 6B 30 4D 0A C4 10 DE FC 23 AF FE 49 88 88
but the arduino should find values like that 0x00
it is very hard to write all the values by hand
is there any way or hex editor to make it more easier ?

Grumpy_Mike

#1
Jan 18, 2020, 07:16 am Last Edit: Jan 18, 2020, 07:20 am by Grumpy_Mike
Quote
it is very hard to write all the values by hand
I would tend to think impossible rather than very hard.

You do not have a waveform as an input but compressed data. The compression used is called a Linear Predictive Encoder, so you need to run your sound samples through some software that will do that for you. This was an encoded format famous used in the old "Speak and spell " toys of the 80s.

Unfortunately I don't know of any software that will do this but there must be some somewhere.

If all you want to do is prefix 0x to each number then write a small piece of code to read these values and print them out with 0x first. You can treat the numbers as strings. Then copy them from the serial monitor and paste them into your program.

Isra2006

thanks for your reply
the idea of using the serial monitor was in my head all the time but i don't know how to do that because i have a very lot of numbers and i can't put 0x before each one of them

Isra2006

i am trying to use Exel to format the values to 0x00, but i have a problem
because some times some values does not change

Grumpy_Mike

#4
Jan 18, 2020, 11:13 pm Last Edit: Jan 18, 2020, 11:15 pm by Grumpy_Mike
thanks for your reply
the idea of using the serial monitor was in my head all the time but i don't know how to do that because i have a very lot of numbers and i can't put 0x before each one of them

You do it programmatically, write the code to do it once and put it in a loop.

Where are these numbers you want to convert?

Go Up