Skip to content

Instantly share code, notes, and snippets.

@UnforeseenOcean
Created June 8, 2020 09:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save UnforeseenOcean/b1462febd499ae21f87d994870efffad to your computer and use it in GitHub Desktop.
Save UnforeseenOcean/b1462febd499ae21f87d994870efffad to your computer and use it in GitHub Desktop.
Format description for speech.json
Structure of the speech.json:
{
"lang":"cn",
"unit":["./etc/unit/percent.wav","./etc/unit/negative.wav","./etc/unit/degrees.wav","./etc/unit/celsius.wav","./etc/unit/fahrenheit.wav","./etc/unit/kelvin.wav"],
"week":["./etc/week/sunday.wav","./etc/week/monday.wav","./etc/week/tuesday.wav","./etc/week/wednesday.wav","./etc/week/thursday.wav","./etc/week/friday.wav","./etc/week/saturday.wav"],
"month": null,
"specialDay": null,
"hour": null,
"number":["./num/0.wav","./num/1.wav","./num/2.wav","./num/3.wav","./num/4.wav","./num/5.wav","./num/6.wav","./num/7.wav","./num/8.wav","./num/9.wav","./num/10.wav","./num/100.wav","./num/1000.wav"],
"specialDigits": null,
"greetings":["./seg/goodmorning.wav","./seg/goodafternoon.wav","./seg/goodevening.wav","./seg/goodnight.wav"],
"ampm":["./seg/am.wav","./seg/pm.wav"],
"sentence":["./seg/timeis.wav","./seg/todayis.wav","./seg/tempis.wav","./seg/humis.wav"],
"literal":["./seg/hour.wav","./seg/minute.wav","./seg/year.wav","./seg/month.wav","./seg/day.wav"],
"end": null,
"sequence":["alert","pause","greetings","special","pause","timeis","ampm","hour12h","hour24h","hourword","minute","minuteword","pause","todayis","year","yearword","month","monthword","day","dayword","pause","weekday","pause","tempis","unit","minus","temp","degrees","kelvin","pause","humis","humid","percent"],
"settings":{
"hourFormat": ["12", "24"],
"synthesisType": "asian",
"literalDate": true,
"endOfSentence": false,
"specialDayAudio": false,
"specialHourAudio": false,
"specialDigitAudio": false,
"specialAudio": {"month": "12","day": "25","id": "christmas","audio": "./seg/christmas.wav"},
"lcd":{"page1":[["ampm","hr","colon","minute"],["temp","humid"]],"page2":[["weekday"],["year","y","month","m","day","d"]]}
}
}
Any speech data with "null" as the content will be regarded as disabled, and it will take higher priority than the settings
lang: The language this configuration is intended for ("common" applies to all sentences and its contents are loaded first)
unit: Audio files for units in this sequence: Percent, Negative, Degrees, Celsius, Fahrenheit, Kelvin
week: Audio files for weekdays in this sequence: Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday
month: Audio files for Western/European date format (January ~ December)
specialDay: Any files for specialized date formats (such as "January First" instead of "January 1")
hour: Used if specialHourAudio is set to true -- uses separate files for reading hours (for Korean language, which uses different pronunciation for reading hours)
number: Audio files for synthesizing numbers (in this sequence: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 1000)
specialDigits: Any files for specialized numbers (used when specialDigitAudio is set to true, such as using separate voice clips for "11")
greetings: Time-based greeting message
ampm: Audio files for AM or PM announcement (null if 24hr-only)
sentence: Audio files for sentences in this sequence: Time Is, Today Is, Temperature Is, Humidity Is
literal: Used when literalDate is set to true -- if you need to literally read out "year", "month", "day", etc. (used for Chinese-Japanese-Korean where they read it like "2019 year")
end: Used when endOfSentence is set to true -- used for Japanese and Korean language (because the sentence ends with some specific word)
sequence: Order of which clips should play:
alert: The beginning of the sentence
ampm: AM/PM
day: Day of the month
dayword: Literal "day"
degrees: Literal "degrees" (exempt from literalDate settings)
greetings: Time-based greeting message
hour12h: 12hr time hours, will not be read when 24hr time is enabled (not available if the region is 24hr-only)
hour24h: 24hr time hours, will not be read when 12hr time is enabled
hourword: Literal "hours"
humid: Current humidity
humis: "(and) the humidity is"
kelvin: Only used when Kelvin is selected in the units
minus: "Negative"
minute: Minutes
minuteword: Literal "minutes"
month: Month
monthword: Literal "month"
pause: 0.25 seconds of pause
percent: Percent
special: Special audio clip that plays when the condition defined in specialAudio is satisfied
temp: Current temperature
tempis: "The temperature is"
timeis: "The time is"
todayis: "Today is"
unit: The unit for the temperature
weekday: Day of the week, Sunday to Saturday
year: Current year, in the format dictated by the synthesisType
yearword: Literal "year"
settings: Language-specific settings
hourFormat: "12" and/or "24". Chooses what format is available for this language (24hr only for DE, JP, NL and SE)
synthesisType: "asian", "western" or "european", selects which format to use for the speech:
Asian: "five hour four ten five minutes, two thousand twenty year six month eight day"
Western: "five forty-five, June eighth twenty-twenty"
European: "five clock forty-five, June eighth, two thousand twenty"
literalDate: Decided whether or not to read the "literal" part of the sentence
endOfSentence: If true, will insert the clip defined in the "end" when the dialog asks for it
specialDayAudio: Used when the day is read differently from other numbers, like "January twenty-second"
specialHourAudio: Used when the hour is read differently from other numbers, such as in Korean
specialDigitAudio: Used when the numbers are read differently from number to number (such as "11" or "30" in English)
specialAudio: Defines if there is a special dialog (null if not)
month: Which month this should activate at
day: Which day this should activate at
id: What is this day
audio: The audio file to play when "special" is in the dialog
lcd:
page1: First page of the LCD, first array is the first line and the second array is the second line
page2: Second page of the LCD, first array is the first line and the second array is the second line
syntax:
ampm: AM/PM
colon: Literal colon character ":"
d: "Day"
dot: Literal dot character "."
hr: "Hour"
humid: Current humidity
hyphen: Literal hyphen character "-"
m: "Minute"
minute: Current minute
slash: Literal forward-slash character "/"
temp: Current temperature
weekday: Day of the week
y: "Year"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment