Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Pédagogies Multimodales
Phonographe
Commits
c9d87c42
Commit
c9d87c42
authored
Mar 10, 2021
by
Sylvain Coulange
Browse files
corrections bugs
parent
b3866a7c
Changes
6
Hide whitespace changes
Inline
Side-by-side
clavier/text2speech.py
View file @
c9d87c42
...
...
@@ -23,7 +23,7 @@ def lambda_handler(ipa, loc):
# generate phoneme tag for polly to read
text
=
text
.
replace
(
' '
,
"'></phoneme><break/><phoneme alphabet='ipa' ph='"
)
# phoneme = "<prosody rate='"+debit+"%'><phoneme alphabet='ipa' ph='"+text+"'></phoneme></prosody>" #<prosody rate='85%'></prosody>
phoneme
=
"<phoneme alphabet='ipa' ph='"
+
text
+
"'></phoneme>"
#<prosody rate='85%'></prosody>
phoneme
=
"<
prosody rate='80%'><
phoneme alphabet='ipa' ph='"
+
text
+
"'></phoneme>
</prosody>
"
#<prosody rate='85%'></prosody>
# send to polly, requesting mp3 back
response
=
polly
.
synthesize_speech
(
...
...
clavier/views.py
View file @
c9d87c42
...
...
@@ -133,7 +133,7 @@ def playIpa(request):
colis
=
json
.
loads
(
request
.
body
)
ipa
=
colis
[
'ipa'
]
# debit = colis['debit']
print
(
"Lecture de ["
+
ipa
+
"] débit
10
0%"
)
print
(
"Lecture de ["
+
ipa
+
"] débit
8
0%"
)
audioBytes
,
lenssml
=
lambda_handler
(
ipa
,
"Celine"
)
...
...
static/js/clavier.js
View file @
c9d87c42
...
...
@@ -48,6 +48,29 @@ if (dataPage == 0) {
console
.
log
(
"
Langue non enregistrée ; default=fr
"
)
selectLang
(
"
fr
"
)
}
var
cartesListe
=
Array
.
from
(
document
.
getElementsByClassName
(
'
carte
'
))
cartesListe
.
forEach
(
(
carte
)
=>
{
carte
.
addEventListener
(
"
dblclick
"
,
function
(
e
)
{
var
tgt
=
e
.
target
// on passe le curseurb sur la carte d'avant
curseurPos
=
tgt
.
previousElementSibling
.
id
tgt
.
previousElementSibling
.
classList
.
add
(
'
startPoint
'
)
playEffect
(
"
delete
"
)
tgt
.
remove
()
// saveTrace('del phon '+rectId)
})
carte
.
addEventListener
(
'
dragstart
'
,
()
=>
{
carte
.
classList
.
add
(
'
dragging
'
)
console
.
log
(
'
DRAGGING
'
,
carte
.
id
)
})
carte
.
addEventListener
(
'
dragend
'
,
()
=>
{
carte
.
classList
.
remove
(
'
dragging
'
)
console
.
log
(
'
STOP DRAGGING
'
,
carte
.
id
)
})
})
}
...
...
static/js/dragdrop.js
View file @
c9d87c42
...
...
@@ -5,7 +5,7 @@
// https://www.youtube.com/watch?v=jfYWwQrtzzY&t=102s
// ajouter DragDropTouch.js pour compatibilité tactile
var
rep
=
document
.
getElementById
(
'
textZone
'
)
if
(
thisAppli
==
"
phonographe
"
)
rep
=
document
.
getElementById
(
'
textZone
'
)
rep
.
addEventListener
(
'
dragover
'
,
e
=>
{
e
.
preventDefault
()
...
...
static/js/syntheseVocale.js
View file @
c9d87c42
...
...
@@ -9,7 +9,7 @@ async function playIpa() {
if
(
thisPageLang
==
'
fr
'
){
// Si quelque chose est écrit...
var
phonEllist
=
document
.
getElementsByClassName
(
'
text
'
)
console
.
log
(
'
phonEllist =
'
,
phonEllist
)
if
(
phonEllist
.
length
>
0
)
{
// on récupère tous les élément classe "text" et on récupère leur classe phon_*
var
ipa
=
""
;
...
...
templates/clavier.html
View file @
c9d87c42
...
...
@@ -225,8 +225,8 @@
<script
type=
"text/javascript"
src=
"{% static 'js/interface.js' %}"
></script>
<script
type=
"text/javascript"
src=
"{% static 'js/clavierCalques.js' %}"
></script>
<script
type=
"text/javascript"
src=
"{% static 'js/popupAide.js' %}"
></script>
<script
type=
"text/javascript"
src=
"{% static 'js/clavier.js' %}"
></script>
<script
type=
"text/javascript"
src=
"{% static 'js/dragdrop.js' %}"
></script>
<script
type=
"text/javascript"
src=
"{% static 'js/DragDropTouch.js' %}"
></script>
<script
type=
"text/javascript"
src=
"{% static 'js/clavier.js' %}"
></script>
<script
type=
"text/javascript"
src=
"{% static 'js/syntheseVocale.js' %}"
></script>
{% endblock %}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment