Alternative voice files for en_GB_2

Also, added abilty to read from separate ambe files in a dir
as well as the G4KLX style indexed files
This commit is contained in:
Simon 2021-05-09 14:36:02 +01:00
parent 22068bfbb1
commit 6ba08711e2
45 changed files with 147 additions and 47 deletions

BIN
Audio/en_GB_2/0.ambe Normal file

Binary file not shown.

BIN
Audio/en_GB_2/1.ambe Normal file

Binary file not shown.

BIN
Audio/en_GB_2/2.ambe Normal file

Binary file not shown.

BIN
Audio/en_GB_2/3.ambe Normal file

Binary file not shown.

1
Audio/en_GB_2/4.ambe Normal file
View File

@ -0,0 +1 @@
υ‰Ε'RΙ Ξχ£uwL¥Ή<C2A5>ΡεzCp_<>¦ΔsqKθυ2XΨ<58>^4h®µΛ€@<0F><>σ"Z§}r <09>T—c¶[―@¦©ΧήτΑ=Έψ±½¥¦]φJX+δ<>†ez<65><7A>&'Ρ9 ζΆkΰ Η^^Δρ-βεzNΔδΗ_R<5F>Δ4UΘYϊBΫA &ωk^ΒτbΖΟQ)_>θΞo>"B!ƒ}/Η[ B K(c—,z#s(Fΐϋ79§E>5G<35>Ο,Λe;)ΞqΣ;οbXαω_oβ"`eLEiΗ<69>Ρ`6]eOΗ<4F>ΰC?<58>@&ODG 8†Wh{0ο<05><¦3L<33>c<EFBFBD>]/§Ζc(Έ4Α<34>M|σD<0F><08>E§Δ*°Cdz01ψ·IΗ!“'

3
Audio/en_GB_2/5.ambe Normal file
View File

@ -0,0 +1,3 @@
ÃtÇ`d˜û³€ÓÑç%exñ†jÇPƒq¶Û¢!pŒØƒå:¢v6=S¾õå'LÍ_Ø %"ýþÅ€ï¦ac…Ø¥—¢<E28094>u fÃÂX¥±W+pÒµI¤ £WHdñ£o{ëâ3+SOË£óŽ€`>#šYÍÂŽ€`˜/û&¿~‹Òör5<04> kœ÷Lyܨ!ütÁ=]Wï!·â…Ø8w\°ZȆãME3úÁ†Ánhf劈ү bXÜM˜{äDÃØ@€GŽ <09>e†÷(ØXJÏ#“…1jº• -9ý[R <09>',JÅCÇ×6l^/Y40Ú…d.²N|K*ö©]櫧Eo÷"ñœ†cóoëTÙ@ç} !Qp¶±<C2B6>ˆ¤
b½_˨#¤G…7 ûNƒ)o
§æå6 Tèzõˆå!S`)Ø

BIN
Audio/en_GB_2/6.ambe Normal file

Binary file not shown.

BIN
Audio/en_GB_2/7.ambe Normal file

Binary file not shown.

BIN
Audio/en_GB_2/8.ambe Normal file

Binary file not shown.

BIN
Audio/en_GB_2/9.ambe Normal file

Binary file not shown.

BIN
Audio/en_GB_2/alpha.ambe Normal file

Binary file not shown.

BIN
Audio/en_GB_2/bravo.ambe Normal file

Binary file not shown.

BIN
Audio/en_GB_2/busy.ambe Normal file

Binary file not shown.

View File

@ -0,0 +1,4 @@
Æ^£?#€¯oĉå!b4«)±´Ç'QQ1u<31>óõ a4ÔgÂÔ¢ch×1Àô a/ÂVD¨çä•gå=cÊÇæPðªƒÜ¿<C39C>¦3µ*Sî袱q <63>¤GÖvrmXxÊÅfZV.xj<>wZmRî\™Óå%涌@ËÕ,ó%=ˆ<>6lŒ4Èóö<C3B3>¯Ñ(¿Y€„H¯¦:¬{1€ÆI<C386>‡óA¢¬5½þ¶4#IÇ%Òêð"#44Íì<Ç—G
hbÇqÇZ
¡ƒL8n¡à ]Ñ[½üÐy*H
ËOL`\Q¬»ÒZ/ƒoõš“L-Fpí ê㤹 O¢Ñe.ÛTIÈ·“7<E2809C>VS(HùÀEÅP&©ÿã

2
Audio/en_GB_2/delta.ambe Normal file
View File

@ -0,0 +1,2 @@
ä™Å'RË+±†ç6#!urŒ¡•åRd$Vþ´ø¢+Ή…Äsê,"xõ,‡›"®EMŽÚÀߥÅó¢­O¯#¹;¿Ü¢ù•ãQëG•š[r•9$îK<C3AE>.¶8$Øk…]ƒ:=EнE2fç9&çAÒxw(ã%¶_!
mHŸ Çp<>¨sRi¦N™ØÚáPOزg_i³%á0ZÞP@~íÌÁ{J:9íÂ(M<>Ï:êk<1C>ø<EFBFBD># B· \qÞ´&’¢ Ìú£·'’¶>Ý<>ò÷%m_:l@tžñ[ HND<4E>½„†oÝPÉ]²ÔR)Ûu™>zód.<2E>DoŒrÅÂWçSaŸŒã

1
Audio/en_GB_2/echo.ambe Normal file
View File

@ -0,0 +1 @@
çºçqYù °ñÄos_”ïæ˜ÇEf%<1B>.²—çpbv@0É÷aÈv{×Mƒãæ¢`=VsçŒæT«™#NÍ YíÓÊšl Ï¢,ðû-™Ï>qI"°ƒÍž;/bkä°ÜžzmFžÉ ª Ñ ¦¯Zt&`O+ŸE¦²Š<C2B2>·9™½£„u×(ˆÛH¶xõuS÷Yây·×\<5C>r½J¢Å[˜—“"thºU€c~ÔdaÔÓašnÒ<&ÀJχòðI+h;düÛ³àX+iK@¸ž<C2B8>ÀKhOØ-0Þ°8*¥˜@(zÂkO€ ÑÕ·fO³'ÕýÕV qH¶r;œ«Ø†½¡ C"HtC

BIN
Audio/en_GB_2/foxtrot.ambe Normal file

Binary file not shown.

BIN
Audio/en_GB_2/freedmr.ambe Normal file

Binary file not shown.

BIN
Audio/en_GB_2/gateway.ambe Normal file

Binary file not shown.

1
Audio/en_GB_2/golf.ambe Normal file
View File

@ -0,0 +1 @@
lÝ…d5™yVòvåd`aøȷשåg`4\­ÑåriÄGsÑç€&)µ"gíæƒs'^“­þò†1NIïÑí©Åï<C3AF>ÑqÊK7µ³Ýs¹}õwµ$…|"¤Æ2œ9cXe±ðˆÏ .)`†6TIÍNolT9…š<E280A6> yj„ar}ØiÔ/%àJKnà{!¦d)=i!7ð{JHB¬Pͳ jÀkѦeÑ-Ê}qÕ^i€oHŽI K×n€"vcѶ·ƒ emG×…-êÀ‡$7‰mÎGùÓÄ;&¿mÙÁ…FSÉŽwxX²Ì?0é<^ƒì…±Ÿ‡ Ä»åB1É:

BIN
Audio/en_GB_2/hotel.ambe Normal file

Binary file not shown.

BIN
Audio/en_GB_2/india.ambe Normal file

Binary file not shown.

View File

@ -0,0 +1,3 @@
À<EFBFBD>ƒKua<75>ãþõ¡SJçûÏÔ<C38F>Sr'M¡<4D>ÙA3xŸŠÑ÷Cú}á £ä*€7tMSœß䦟)´<>£hÍü†÷Ù“˜k±è=áQ²vWÏþgÝ9¾ÄëÈgû7ê^ÔÁè­î€%ÉQ…GY.wf˜e¢(ÞÊ6éQAwxngRêÑ£¦×åÊQgÁ<67>iNnÿcÆC0»^áoÇ} -O .H´1ý—ùM)©´ª{²&,#y±pãk  =klO‡[ô§„HeÇnaȮ§YhìŸ?3ái>£8 D¦ÿ³ å`¸u[h÷
öG;Àãº
³!ÈBé:d<1F>:»Ã†Ô”·{ÿOíÑh™(*¿ç—‡_̆k¢£ÁWµµ#²‡3<E280A1>}6Z)ÄŠÇ'rMˆ

BIN
Audio/en_GB_2/kilo.ambe Normal file

Binary file not shown.

BIN
Audio/en_GB_2/lima.ambe Normal file

Binary file not shown.

Binary file not shown.

BIN
Audio/en_GB_2/mike.ambe Normal file

Binary file not shown.

Binary file not shown.

BIN
Audio/en_GB_2/november.ambe Normal file

Binary file not shown.

BIN
Audio/en_GB_2/oscar.ambe Normal file

Binary file not shown.

BIN
Audio/en_GB_2/papa.ambe Normal file

Binary file not shown.

View File

@ -0,0 +1,2 @@
ΤΈε%0MυΆpaX΄G3ΗGfc™ΓΕΆD?†Rc<52>Τ4b]Ρ4c¤η2 3VCάµιΆ%2mΝνΧ¶¤Ξ<C2A4><CE9E><EFBFBD>»X5έβγβ1δλe®³lλΓ4οdκ9<CEBA>Z2…zBΏ*LΦ@ƒΞf<E280BA>£.®]ι4ϊUµρp\z=H M-(™/Ψ)¦v<08>M
Ο/<2F><>3£mΉo¶'LΤZβ8Χ<38>°ή>{ήu<75>΅ά<>σ`Ε<> ο“·–βΩ“:Υ. “¤ΐkκ yF)γ <0C>{η£(T#Mμ§π>igGΰ<47>Κ*5KΛQfh#/½$΅w0 ²οwΖ)5+pχμA<CEBC><41>?足LΰpC™“yρ/¦Tf·BsΖΆ7g a3Ίη<CE8A>ε6@mΨ

BIN
Audio/en_GB_2/repeater.ambe Normal file

Binary file not shown.

BIN
Audio/en_GB_2/romeo.ambe Normal file

Binary file not shown.

View File

@ -0,0 +1,6 @@
•KæP°w¤ZäA#HÂC@l#ÇIZƒÂCm°_{‚â åïdÄDfi ®7£` ³Ù݆¼¡lYÝt„q;²ó×wèÑ…'GØNÏc߇B'Í­üÉ•¡ÁB!ØFk3·¡B,säõMl%8X|Œak~v.K“åŠfv^ ³_!/,R@O‡%—b<E28094>>t@m íŠÁg^q_ÈÛ /(#EÇ”g†ÿ(tF,Ô¬÷ià؈Fû-
ÂâÊ<C3A2><C38A>+|e0Ä”z;;¢@&žeíÓ#\Ôp¶9˜VzXÏ
Ñv“>üw2´ÔåÐPÅACâ
ˆP?¯¤#4(-DïöçSm3.UÔþ µYjìÌ
)&ѱ@æóô F´Jß^J&Ôd<C394>ú¢†.h,<ÁHµÃ÷%h•8AÍJ¶†!ož"Ë]÷AÊVàé
.}ÍÓrD¨?]·a4èmV

BIN
Audio/en_GB_2/tango.ambe Normal file

Binary file not shown.

BIN
Audio/en_GB_2/uniform.ambe Normal file

Binary file not shown.

BIN
Audio/en_GB_2/victor.ambe Normal file

Binary file not shown.

BIN
Audio/en_GB_2/whiskey.ambe Normal file

Binary file not shown.

BIN
Audio/en_GB_2/x-ray.ambe Normal file

Binary file not shown.

View File

@ -0,0 +1,4 @@
ÿǃVe9Àÿœ·Ä1‹ÖÌÖ<C38C>qR çÿ“„ç!d@A®yɨB}׉€6€|\šXq#ymý´ø 4
üü´§Q9—.(jÈѹzÝ<>+²?Ä•¬ÏÜ<@{Ññë®jM#6¦ÞO«¶
3Á/§fEúöM”Ã1ï%<14>œº”þ%gØRœ¾ÁS­#cÃö<C383>#A4‰`}Àpw<>M}éY¨ß&d!)]4-
;NEȉ;½;„oâFP£CÀ˜ÌÐœû£Ô§¢oƒoES€³z‰,O7O¥JŽ(Æ)e˜ÙS^˜/ÖKï­£®¤E§>Y|k;öS~5}$§Žk²}-DÙ8Ëö±Ln#z¼G«<47> G1Í9ê÷€n G0ÝË÷âkn¢fõ¡ÁµH.Îg €ëGуƒNA&t½Å

BIN
Audio/en_GB_2/zulu.ambe Normal file

Binary file not shown.

View File

@ -568,8 +568,8 @@ def ident():
_say.append(words[character])
_say.append(words['silence'])
_say.append(words['silence'])
#test
#_say.append(AMBEobj.readSingleFile('44xx.ambe'))
test
#_say.append(AMBEobj.readSingleFile('alpha.ambe'))
_all_call = bytes_3(16777215)
_source_id= bytes_3(5000)
speech = pkt_gen(_source_id, _all_call, bytes_4(16777215), 1, _say)

View File

@ -2,6 +2,38 @@ voiceMap = {
'en_GB': {
'to': '2',
},
'en_GB_2': {
'A': 'alpha',
'B': 'bravo',
'C': 'charlie',
'D': 'delta',
'E': 'echo',
'F': 'foxtrot',
'G': 'golf',
'H': 'hotel',
'I': 'india',
'J': 'juliet',
'K': 'kilo',
'L': 'lima',
'M': 'mike',
'N': 'november',
'O': 'oscar',
'P': 'papa',
'Q': 'quebec',
'R': 'romeo',
#'S': 'sierra',
'T': 'tango',
'U': 'uniform',
'V': 'victor',
'W': 'whiskey',
'X': 'x-ray',
'Y': 'yankee',
'Z': 'zulu',
'to': 'silence',
'notlinked': 'not-linked',
'linkedto': 'linked-to'
},
'en_US:': {
'to': '2',

View File

@ -1,5 +1,7 @@
from bitarray import bitarray
from itertools import islice
import os
import glob
class readAMBE:
@ -17,51 +19,88 @@ class readAMBE:
def readfiles(self):
_AMBE_LENGTH = 9
indexDict = {}
try:
with open(self.prefix+'.indx') as index:
for line in index:
(voice,start,length) = line.split()
indexDict[voice] = [int(start) * _AMBE_LENGTH ,int(length) * _AMBE_LENGTH]
index.close()
except IOError:
return False
ambeBytearray = {}
_wordBitarray = bitarray(endian='big')
_wordBADict = {}
try:
with open(self.prefix+'.ambe','rb') as ambe:
for _voice in indexDict:
ambe.seek(indexDict[_voice][0])
_wordBitarray.frombytes(ambe.read(indexDict[_voice][1]))
#108
_wordBADict[_voice] = []
pairs = 1
_lastburst = ''
for _burst in self._make_bursts(_wordBitarray):
#Not sure if we need to pad or not? Seems to make little difference.
if len(_burst) < 108:
pad = (108 - len(_burst))
for i in range(0,pad,1):
_burst.append(False)
if pairs == 2:
_wordBADict[_voice].append([_lastburst,_burst])
_lastburst = ''
pairs = 1
next
else:
pairs = pairs + 1
_lastburst = _burst
_wordBitarray.clear()
ambe.close()
except IOError:
return False
_wordBADict['silence'] = ([
[bitarray('101011000000101010100000010000000000001000000000000000000000010001000000010000000000100000000000100000000000'),
bitarray('001010110000001010101000000100000000000010000000000000000000000100010000000100000000001000000000001000000000')]
])
return _wordBADict
if os.path.isdir(self.prefix):
ambeBytearray = {}
_wordBitarray = bitarray(endian='big')
_wordBADict = {}
_glob = self.prefix + "/*.ambe"
for ambe in glob.glob(_glob):
basename = os.path.basename(ambe)
_voice,ext = basename.split('.')
inambe = open(ambe,'rb')
_wordBitarray.frombytes(inambe.read())
inambe.close()
_wordBADict[_voice] = []
pairs = 1
_lastburst = ''
for _burst in self._make_bursts(_wordBitarray):
#Not sure if we need to pad or not? Seems to make little difference.
if len(_burst) < 108:
pad = (108 - len(_burst))
for i in range(0,pad,1):
_burst.append(False)
if pairs == 2:
_wordBADict[_voice].append([_lastburst,_burst])
_lastburst = ''
pairs = 1
next
else:
pairs = pairs + 1
_lastburst = _burst
_wordBitarray.clear()
_wordBADict['silence'] = ([
[bitarray('101011000000101010100000010000000000001000000000000000000000010001000000010000000000100000000000100000000000'),
bitarray('001010110000001010101000000100000000000010000000000000000000000100010000000100000000001000000000001000000000')]
])
return _wordBADict
else:
try:
with open(self.prefix+'.indx') as index:
for line in index:
(voice,start,length) = line.split()
indexDict[voice] = [int(start) * _AMBE_LENGTH ,int(length) * _AMBE_LENGTH]
index.close()
except IOError:
return False
ambeBytearray = {}
_wordBitarray = bitarray(endian='big')
_wordBADict = {}
try:
with open(self.prefix+'.ambe','rb') as ambe:
for _voice in indexDict:
ambe.seek(indexDict[_voice][0])
_wordBitarray.frombytes(ambe.read(indexDict[_voice][1]))
#108
_wordBADict[_voice] = []
pairs = 1
_lastburst = ''
for _burst in self._make_bursts(_wordBitarray):
#Not sure if we need to pad or not? Seems to make little difference.
if len(_burst) < 108:
pad = (108 - len(_burst))
for i in range(0,pad,1):
_burst.append(False)
if pairs == 2:
_wordBADict[_voice].append([_lastburst,_burst])
_lastburst = ''
pairs = 1
next
else:
pairs = pairs + 1
_lastburst = _burst
_wordBitarray.clear()
ambe.close()
except IOError:
return False
_wordBADict['silence'] = ([
[bitarray('101011000000101010100000010000000000001000000000000000000000010001000000010000000000100000000000100000000000'),
bitarray('001010110000001010101000000100000000000010000000000000000000000100010000000100000000001000000000001000000000')]
])
return _wordBADict
#Read a single ambe file from the audio directory
def readSingleFile(self,filename):
@ -100,7 +139,9 @@ class readAMBE:
if __name__ == '__main__':
test = readAMBE('en_GB','./Audio/')
#test = readAMBE('en_GB','./Audio/')
#print(test.readfiles())
test = readAMBE('en_GB_2','./Audio/')
print(test.readfiles())
print(test.readSingleFile('44xx.ambe'))