Use new audio files and add some new languages.

This commit is contained in:
Jonathan Naylor
2017-09-29 21:41:22 +01:00
parent 15ea4418e0
commit b72539dab1
22 changed files with 475 additions and 133 deletions

Binary file not shown.

View File

@@ -1,12 +1,44 @@
0 0 18 0 78 24
1 18 24 1 121 24
2 42 24 2 163 25
3 66 24 3 202 28
4 90 27 4 248 30
5 117 29 5 295 27
6 146 28 6 340 32
7 174 31 7 391 32
8 205 23 8 440 25
9 228 25 9 484 32
connected 253 77 alpha 533 25
disconnected 330 72 bravo 576 31
charlie 629 26
delta 676 30
A 725 19
B 769 21
C 818 27
D 870 23
E 917 23
F 965 23
G 1014 22
H 1060 24
I 1109 18
J 1151 26
K 1207 26
L 1258 23
M 1305 21
N 1351 25
O 1401 19
P 1446 19
Q 1493 24
R 1543 23
S 1591 21
T 1644 23
U 1693 22
V 1740 19
W 1784 22
X 1831 24
Y 1883 34
Z 1943 25
linkedto 1995 40
notlinked 2088 50
linkingto 2158 44
isbusy 2268 40

BIN
Audio/dk_DK.ambe Normal file

Binary file not shown.

44
Audio/dk_DK.indx Normal file
View File

@@ -0,0 +1,44 @@
0 82 21
1 120 15
2 160 19
3 198 22
4 236 35
5 288 24
6 329 31
7 378 27
8 422 27
9 466 24
alpha 506 32
bravo 558 27
charlie 604 38
delta 663 27
A 710 18
B 754 16
C 796 20
D 843 16
E 885 14
F 923 18
G 967 13
H 1005 19
I 1049 13
J 1087 23
K 1137 20
L 1180 20
M 1224 19
N 1268 17
O 1310 16
P 1352 15
Q 1395 17
R 1437 18
S 1480 19
T 1525 19
U 1569 18
V 1611 17
W 1655 34
X 1714 20
Y 1759 19
Z 1802 23
linkedto 1852 37
notlinked 1928 50
linkingto 1998 34
isbusy 2071 40

Binary file not shown.

View File

@@ -1,12 +1,44 @@
0 0 50 0 85 41
1 50 31 1 144 24
2 81 30 2 186 25
3 111 43 3 229 30
4 154 42 4 278 35
5 196 48 5 331 35
6 244 40 6 384 39
7 284 37 7 441 34
8 321 32 8 494 29
9 353 43 9 541 35
connected 396 52 alpha 595 31
disconnected 448 45 bravo 646 33
charlie 700 31
delta 753 30
A 804 24
B 850 33
C 898 23
D 933 33
E 990 34
F 1041 34
G 1093 34
H 1145 40
I 1204 30
J 1253 35
K 1307 33
L 1358 30
M 1406 28
N 1452 30
O 1500 23
P 1541 32
Q 1592 39
R 1648 23
S 1689 33
T 1742 32
U 1791 35
V 1845 33
W 1896 38
X 1953 35
Y 2007 28
Z 2060 37
linked 2124 19
notlinked 2194 44
linking 2258 31
isbusy 2350 33

BIN
Audio/en_US.ambe Normal file

Binary file not shown.

44
Audio/en_US.indx Normal file
View File

@@ -0,0 +1,44 @@
0 89 39
1 146 34
2 202 22
3 246 31
4 294 34
5 345 46
6 409 39
7 466 37
8 521 29
9 568 35
alpha 621 26
bravo 669 34
charlie 726 34
delta 781 31
A 833 19
B 870 24
C 938 27
D 1009 24
E 1076 28
F 1148 29
G 1221 24
H 1290 31
I 1363 29
J 1432 33
K 1510 25
L 1578 22
M 1644 28
N 1715 28
O 1785 27
P 1858 24
Q 1927 25
R 1993 26
S 2063 29
T 2139 25
U 2208 25
V 2273 27
W 2344 33
X 2421 24
Y 2489 26
Z 2561 32
linked 2637 20
notlinked 2710 49
linking 2779 25
isbusy 2872 34

Binary file not shown.

View File

@@ -1,12 +1,44 @@
0 0 26 0 83 31
1 26 23 1 128 32
2 49 32 2 174 33
3 81 26 3 226 30
4 107 29 4 273 36
5 136 33 5 323 42
6 169 29 6 379 37
7 198 30 7 430 37
8 228 28 8 480 35
9 256 32 9 529 34
connected 288 77 alpha 578 34
disconnected 365 51 bravo 628 36
charlie 682 43
delta 742 38
A 798 26
B 836 22
C 881 22
D 923 24
E 967 17
F 1004 31
G 1053 26
H 1097 35
I 1150 20
J 1189 34
K 1246 22
L 1287 30
M 1337 30
N 1388 33
O 1439 22
P 1480 21
Q 1524 26
R 1571 32
S 1622 31
T 1675 22
U 1718 23
V 1756 28
W 1804 52
X 1876 28
Y 1925 17
Z 1961 35
linkedto 2017 64
notlinked 2133 68
linkingto 2217 66
isbusy 2364 58

Binary file not shown.

View File

@@ -1,12 +1,44 @@
0 0 32 0 94 29
1 32 16 1 140 16
2 48 30 2 173 20
3 78 30 3 215 19
4 108 32 4 255 24
5 140 37 5 298 29
6 177 33 6 344 34
7 210 34 7 398 25
8 244 41 8 440 24
9 285 39 9 481 23
connected 324 45 alpha 521 29
disconnected 369 57 bravo 568 27
charlie 615 30
delta 666 30
A 714 21
B 753 27
C 796 34
D 848 30
E 895 23
F 936 27
G 982 27
H 1026 30
I 1075 20
J 1113 29
K 1162 22
L 1201 28
M 1248 28
N 1295 28
O 1341 23
P 1386 21
Q 1426 23
R 1466 28
S 1511 31
T 1567 21
U 1606 22
V 1646 30
W 1693 46
X 1756 31
Y 1806 21
Z 1844 14
linkedto 1858 35
notlinked 1941 46
linkingto 2008 38
isbusy 2091 47

Binary file not shown.

View File

@@ -1,12 +1,44 @@
0 0 38 0 86 33
1 38 42 1 136 27
2 80 33 2 180 30
3 113 35 3 231 17
4 148 42 4 270 38
5 190 56 5 328 38
6 246 33 6 383 31
7 279 44 7 431 36
8 323 40 8 485 33
9 363 40 9 535 39
connected 403 112 alpha 591 34
disconnected 515 69 bravo 644 35
charlie 701 35
delta 757 34
A 810 12
B 840 19
C 883 17
D 923 17
E 965 14
F 1001 34
G 1058 20
H 1100 32
I 1155 14
J 1192 43
K 1263 30
L 1316 34
M 1373 30
N 1426 29
O 1477 13
P 1519 15
Q 1559 16
R 1598 28
S 1649 30
T 1699 20
U 1741 12
V 1775 21
W 1819 47
X 1888 25
Y 1936 43
Z 2002 35
linkedto 2064 48
notlinked 2154 65
linkingto 2239 41
isbusy 2321 51

BIN
Audio/no_NO.ambe Normal file

Binary file not shown.

44
Audio/no_NO.indx Normal file
View File

@@ -0,0 +1,44 @@
0 67 28
1 102 29
2 137 27
3 170 25
4 199 36
5 238 30
6 272 38
7 314 31
8 349 34
9 386 28
alpha 418 36
bravo 472 30
charlie 519 34
delta 569 34
A 622 23
B 665 24
C 710 24
D 758 21
E 803 28
F 856 24
G 903 32
H 955 31
I 1007 18
J 1045 30
K 1100 28
L 1152 19
M 1196 20
N 1241 17
O 1282 27
P 1332 24
Q 1378 24
R 1426 19
S 1470 31
T 1524 24
U 1572 23
V 1616 20
W 1658 40
X 1722 32
Y 1779 24
Z 1823 29
linkedto 1882 40
notlinked 1966 49
linkingto 2034 40
isbusy 2148 38

BIN
Audio/pl_PL.ambe Normal file

Binary file not shown.

44
Audio/pl_PL.indx Normal file
View File

@@ -0,0 +1,44 @@
0 99 36
1 163 38
2 229 29
3 290 31
4 351 37
5 420 42
6 490 41
7 559 43
8 630 34
9 692 50
alpha 771 30
bravo 820 32
charlie 873 35
delta 931 34
A 987 17
B 1012 30
C 1070 25
D 1118 27
E 1169 29
F 1221 36
G 1281 30
H 1333 26
I 1383 18
J 1425 32
K 1485 23
L 1532 26
M 1581 26
N 1629 24
O 1676 18
P 1724 23
Q 1773 20
R 1817 23
S 1863 35
T 1926 25
U 1975 22
V 2021 28
W 2070 15
X 2107 31
Y 2161 39
Z 2226 12
linkedto 2263 45
notlinked 2360 51
linkingto 2433 45
isbusy 2559 59

BIN
Audio/se_SE.ambe Normal file

Binary file not shown.

44
Audio/se_SE.indx Normal file
View File

@@ -0,0 +1,44 @@
0 83 35
1 138 33
2 188 32
3 240 28
4 286 41
5 345 30
6 393 43
7 451 34
8 505 35
9 555 28
alpha 603 35
bravo 660 35
charlie 716 32
delta 768 48
A 836 30
B 894 28
C 946 33
D 1005 22
E 1053 34
F 1115 20
G 1160 36
H 1223 30
I 1280 27
J 1333 35
K 1393 29
L 1453 25
M 1507 26
N 1560 20
O 1607 26
P 1657 28
Q 1714 34
R 1781 23
S 1833 30
T 1890 25
U 1943 23
V 1989 35
W 2050 47
X 2126 27
Y 2178 19
Z 2223 45
linkedto 2298 39
notlinked 2390 51
linkingto 2461 36
isbusy 2577 54

103
Voice.cpp
View File

@@ -30,19 +30,6 @@
const unsigned char SILENCE[] = {0xACU, 0xAAU, 0x40U, 0x20U, 0x00U, 0x44U, 0x40U, 0x80U, 0x80U}; const unsigned char SILENCE[] = {0xACU, 0xAAU, 0x40U, 0x20U, 0x00U, 0x44U, 0x40U, 0x80U, 0x80U};
const unsigned int POSITION_0 = 0U;
const unsigned int POSITION_1 = 1U;
const unsigned int POSITION_2 = 2U;
const unsigned int POSITION_3 = 3U;
const unsigned int POSITION_4 = 4U;
const unsigned int POSITION_5 = 5U;
const unsigned int POSITION_6 = 6U;
const unsigned int POSITION_7 = 7U;
const unsigned int POSITION_8 = 8U;
const unsigned int POSITION_9 = 9U;
const unsigned int POSITION_CONNECTED = 10U;
const unsigned int POSITION_DISCONNECTED = 11U;
const unsigned char COLOR_CODE = 3U; const unsigned char COLOR_CODE = 3U;
CVoice::CVoice(const std::string& directory, const std::string& language, unsigned int id, unsigned int slot, unsigned int tg) : CVoice::CVoice(const std::string& directory, const std::string& language, unsigned int id, unsigned int slot, unsigned int tg) :
@@ -58,15 +45,12 @@ m_seqNo(0U),
m_streamId(0U), m_streamId(0U),
m_sent(0U), m_sent(0U),
m_ambe(NULL), m_ambe(NULL),
m_positions(NULL), m_positions(),
m_data(), m_data(),
m_it() m_it()
{ {
m_embeddedLC.setLC(m_lc); m_embeddedLC.setLC(m_lc);
m_positions = new CPositions[12U];
::memset(m_positions, 0x00U, 12U * sizeof(CPositions));
#if defined(_WIN32) || defined(_WIN64) #if defined(_WIN32) || defined(_WIN64)
m_indxFile = directory + "\\" + language + ".indx"; m_indxFile = directory + "\\" + language + ".indx";
m_ambeFile = directory + "\\" + language + ".ambe"; m_ambeFile = directory + "\\" + language + ".ambe";
@@ -81,10 +65,13 @@ CVoice::~CVoice()
for (std::vector<CDMRData*>::iterator it = m_data.begin(); it != m_data.end(); ++it) for (std::vector<CDMRData*>::iterator it = m_data.begin(); it != m_data.end(); ++it)
delete *it; delete *it;
for (std::map<std::string, CPositions*>::iterator it = m_positions.begin(); it != m_positions.end(); ++it)
delete it->second;
m_data.clear(); m_data.clear();
m_positions.clear();
delete[] m_ambe; delete[] m_ambe;
delete[] m_positions;
} }
bool CVoice::open() bool CVoice::open()
@@ -121,46 +108,15 @@ bool CVoice::open()
char* p3 = ::strtok(NULL, "\t\r\n"); char* p3 = ::strtok(NULL, "\t\r\n");
if (p1 != NULL && p2 != NULL && p3 != NULL) { if (p1 != NULL && p2 != NULL && p3 != NULL) {
std::string symbol = std::string(p1);
unsigned int start = ::atoi(p2) * 9U; unsigned int start = ::atoi(p2) * 9U;
unsigned int length = ::atoi(p3) * 9U; unsigned int length = ::atoi(p3) * 9U;
if (::strcmp(p1, "0") == 0) { CPositions* pos = new CPositions;
m_positions[POSITION_0].m_start = start; pos->m_start = start;
m_positions[POSITION_0].m_length = length; pos->m_length = length;
} else if (::strcmp(p1, "1") == 0) {
m_positions[POSITION_1].m_start = start; m_positions[symbol] = pos;
m_positions[POSITION_1].m_length = length;
} else if (::strcmp(p1, "2") == 0) {
m_positions[POSITION_2].m_start = start;
m_positions[POSITION_2].m_length = length;
} else if (::strcmp(p1, "3") == 0) {
m_positions[POSITION_3].m_start = start;
m_positions[POSITION_3].m_length = length;
} else if (::strcmp(p1, "4") == 0) {
m_positions[POSITION_4].m_start = start;
m_positions[POSITION_4].m_length = length;
} else if (::strcmp(p1, "5") == 0) {
m_positions[POSITION_5].m_start = start;
m_positions[POSITION_5].m_length = length;
} else if (::strcmp(p1, "6") == 0) {
m_positions[POSITION_6].m_start = start;
m_positions[POSITION_6].m_length = length;
} else if (::strcmp(p1, "7") == 0) {
m_positions[POSITION_7].m_start = start;
m_positions[POSITION_7].m_length = length;
} else if (::strcmp(p1, "8") == 0) {
m_positions[POSITION_8].m_start = start;
m_positions[POSITION_8].m_length = length;
} else if (::strcmp(p1, "9") == 0) {
m_positions[POSITION_9].m_start = start;
m_positions[POSITION_9].m_length = length;
} else if (::strcmp(p1, "connected") == 0) {
m_positions[POSITION_CONNECTED].m_start = start;
m_positions[POSITION_CONNECTED].m_length = length;
} else if (::strcmp(p1, "disconnected") == 0) {
m_positions[POSITION_DISCONNECTED].m_start = start;
m_positions[POSITION_DISCONNECTED].m_length = length;
}
} }
} }
} }
@@ -174,32 +130,36 @@ bool CVoice::open()
void CVoice::linkedTo(unsigned int number, unsigned int room) void CVoice::linkedTo(unsigned int number, unsigned int room)
{ {
char letters[10U]; char letters[10U];
::sprintf(letters, "%03u%02u", number, room % 100U); ::sprintf(letters, "%03u", number);
std::vector<unsigned int> words; std::vector<std::string> words;
words.push_back(POSITION_CONNECTED); words.push_back("linkedto");
words.push_back(letters[0U] - '0'); words.push_back("X");
words.push_back(letters[1U] - '0'); words.push_back("L");
words.push_back(letters[2U] - '0'); words.push_back("X");
words.push_back(letters[3U] - '0'); words.push_back(std::string(1U, letters[0U]));
words.push_back(letters[4U] - '0'); words.push_back(std::string(1U, letters[1U]));
words.push_back(std::string(1U, letters[2U]));
words.push_back(std::string(1U, 'A' + room - 1U));
createVoice(words); createVoice(words);
} }
void CVoice::unlinked() void CVoice::unlinked()
{ {
std::vector<unsigned int> words; std::vector<std::string> words;
words.push_back(POSITION_DISCONNECTED); words.push_back("notlinked");
createVoice(words); createVoice(words);
} }
void CVoice::createVoice(const std::vector<unsigned int>& words) void CVoice::createVoice(const std::vector<std::string>& words)
{ {
unsigned int ambeLength = 0U; unsigned int ambeLength = 0U;
for (std::vector<unsigned int>::const_iterator it = words.begin(); it != words.end(); ++it) for (std::vector<std::string>::const_iterator it = words.begin(); it != words.end(); ++it) {
ambeLength += m_positions[*it].m_length; CPositions* position = m_positions.at(*it);
ambeLength += position->m_length;
}
// Ensure that the AMBE is an integer number of DMR frames // Ensure that the AMBE is an integer number of DMR frames
if ((ambeLength % 27U) != 0U) { if ((ambeLength % 27U) != 0U) {
@@ -215,9 +175,10 @@ void CVoice::createVoice(const std::vector<unsigned int>& words)
::memcpy(ambeData + i, SILENCE, 9U); ::memcpy(ambeData + i, SILENCE, 9U);
unsigned int pos = 0U; unsigned int pos = 0U;
for (std::vector<unsigned int>::const_iterator it = words.begin(); it != words.end(); ++it) { for (std::vector<std::string>::const_iterator it = words.begin(); it != words.end(); ++it) {
unsigned int start = m_positions[*it].m_start; CPositions* position = m_positions.at(*it);
unsigned int length = m_positions[*it].m_length; unsigned int start = position->m_start;
unsigned int length = position->m_length;
::memcpy(ambeData + pos, m_ambe + start, length); ::memcpy(ambeData + pos, m_ambe + start, length);
pos += length; pos += length;
} }

View File

@@ -27,6 +27,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include <map>
enum VOICE_STATUS { enum VOICE_STATUS {
VS_NONE, VS_NONE,
@@ -66,12 +67,12 @@ private:
unsigned int m_streamId; unsigned int m_streamId;
unsigned int m_sent; unsigned int m_sent;
unsigned char* m_ambe; unsigned char* m_ambe;
CPositions* m_positions; std::map<std::string, CPositions*> m_positions;
std::vector<CDMRData*> m_data; std::vector<CDMRData*> m_data;
std::vector<CDMRData*>::const_iterator m_it; std::vector<CDMRData*>::const_iterator m_it;
void createHeaderTerminator(unsigned char type); void createHeaderTerminator(unsigned char type);
void createVoice(const std::vector<unsigned int>& words); void createVoice(const std::vector<std::string>& words);
}; };
#endif #endif