asl97 / Bingo-Spinner

A simple bingo spinner with text to speech
https://asl97.github.io/Bingo-Spinner/
MIT License
0 stars 0 forks source link

Customize tts number callout #15

Closed asl97 closed 10 months ago

asl97 commented 10 months ago

will probably be done using regex sub, users will need to know regex

allow customizing to include letters in callout. related: #14

note to self, probably something like this: pass 123B to (\d)(\d?)(\d?)([BINGO]?)

and user gives something like $1$2$3 $1 $2 $3 (current default) which produces 123 1 2 3.

take note of leading zeros. use parseInt and then some math:

number = parseInt(span.textContent)
grouping = Math.floor(max/5);
max_grouping = group*5
index = number > max_grouping : number-max_grouping ? Math.floor(number/grouping)
return number.toString()+"BINGO"[index]
asl97 commented 10 months ago

Added in 320248cd6cd312ec2b1266a2b665636c279759de

each group of text to be spoken together should be separated by dash -

dash is replaced with space in the TTS

try $4$1$2$3 group-$4 number-$1$2$3 $1-$2-$3,

for N35 it will say N35, group N, number 35, 3 5