Documentation
¶
Index ¶
- Constants
- Variables
- func InitTTS(l *log.Logger) error
- func RequestTTS(voice Voice, text string, lg *log.Logger) (<-chan []byte, error)
- type AircraftTypeSnippetFormatter
- type AirportSnippetFormatter
- type AltRestrictionSnippetFormatter
- type AltSnippetFormatter
- type AppControllerSnippetFormatter
- type ApproachSnippetFormatter
- type BasicNumberSnippetFormatter
- type BeaconCodeSnippetFormatter
- type CallsignSnippetFormatter
- type DepControllerSnippetFormatter
- type FixSnippetFormatter
- type FrequencySnippetFormatter
- type GroupFormSnippetFormatter
- type HeadingSnippetFormatter
- type LetterSnippetFormatter
- type PhraseFormatString
- type RadioTransmission
- type RadioTransmissionType
- type SIDSnippetFormatter
- type STARSnippetFormatter
- type SnippetFormatter
- type SpeedSnippetFormatter
- type TTSRequest
- type Voice
Constants ¶
const ( RadioTransmissionUnknown = iota RadioTransmissionContact // Messages initiated by the pilot RadioTransmissionReadback // Reading back an instruction RadioTransmissionUnexpected // Something urgent or unusual )
Variables ¶
Functions ¶
Types ¶
type AircraftTypeSnippetFormatter ¶
type AircraftTypeSnippetFormatter struct{}
func (AircraftTypeSnippetFormatter) Spoken ¶
func (AircraftTypeSnippetFormatter) Spoken(r *rand.Rand, arg any) string
func (AircraftTypeSnippetFormatter) Validate ¶
func (AircraftTypeSnippetFormatter) Validate(arg any) error
func (AircraftTypeSnippetFormatter) Written ¶
func (AircraftTypeSnippetFormatter) Written(arg any) string
type AirportSnippetFormatter ¶
type AirportSnippetFormatter struct{}
func (AirportSnippetFormatter) Spoken ¶
func (AirportSnippetFormatter) Spoken(r *rand.Rand, arg any) string
func (AirportSnippetFormatter) Validate ¶
func (AirportSnippetFormatter) Validate(arg any) error
func (AirportSnippetFormatter) Written ¶
func (AirportSnippetFormatter) Written(arg any) string
type AltRestrictionSnippetFormatter ¶
type AltRestrictionSnippetFormatter struct{}
func (AltRestrictionSnippetFormatter) Spoken ¶
func (AltRestrictionSnippetFormatter) Spoken(r *rand.Rand, arg any) string
func (AltRestrictionSnippetFormatter) Validate ¶
func (AltRestrictionSnippetFormatter) Validate(arg any) error
func (AltRestrictionSnippetFormatter) Written ¶
func (AltRestrictionSnippetFormatter) Written(arg any) string
type AltSnippetFormatter ¶
type AltSnippetFormatter struct{}
AltSnippetFormatter formats altitudes, which may be given as ints or float32s.
func (*AltSnippetFormatter) Spoken ¶
func (a *AltSnippetFormatter) Spoken(r *rand.Rand, arg any) string
func (*AltSnippetFormatter) Validate ¶
func (a *AltSnippetFormatter) Validate(arg any) error
func (*AltSnippetFormatter) Written ¶
func (a *AltSnippetFormatter) Written(arg any) string
type AppControllerSnippetFormatter ¶
type AppControllerSnippetFormatter struct{}
func (AppControllerSnippetFormatter) Spoken ¶
func (AppControllerSnippetFormatter) Spoken(r *rand.Rand, arg any) string
func (AppControllerSnippetFormatter) Validate ¶
func (AppControllerSnippetFormatter) Validate(arg any) error
func (AppControllerSnippetFormatter) Written ¶
func (AppControllerSnippetFormatter) Written(arg any) string
type ApproachSnippetFormatter ¶
type ApproachSnippetFormatter struct{}
func (ApproachSnippetFormatter) Spoken ¶
func (ApproachSnippetFormatter) Spoken(r *rand.Rand, arg any) string
func (ApproachSnippetFormatter) Validate ¶
func (ApproachSnippetFormatter) Validate(arg any) error
func (ApproachSnippetFormatter) Written ¶
func (ApproachSnippetFormatter) Written(arg any) string
type BasicNumberSnippetFormatter ¶
type BasicNumberSnippetFormatter struct{}
func (BasicNumberSnippetFormatter) Spoken ¶
func (BasicNumberSnippetFormatter) Spoken(r *rand.Rand, arg any) string
func (BasicNumberSnippetFormatter) Validate ¶
func (BasicNumberSnippetFormatter) Validate(arg any) error
func (BasicNumberSnippetFormatter) Written ¶
func (BasicNumberSnippetFormatter) Written(arg any) string
type BeaconCodeSnippetFormatter ¶
type BeaconCodeSnippetFormatter struct{}
func (BeaconCodeSnippetFormatter) Spoken ¶
func (BeaconCodeSnippetFormatter) Spoken(r *rand.Rand, arg any) string
func (BeaconCodeSnippetFormatter) Validate ¶
func (BeaconCodeSnippetFormatter) Validate(arg any) error
func (BeaconCodeSnippetFormatter) Written ¶
func (BeaconCodeSnippetFormatter) Written(arg any) string
type CallsignSnippetFormatter ¶
type CallsignSnippetFormatter struct{}
func (CallsignSnippetFormatter) Spoken ¶
func (CallsignSnippetFormatter) Spoken(r *rand.Rand, arg any) string
func (CallsignSnippetFormatter) Validate ¶
func (CallsignSnippetFormatter) Validate(arg any) error
func (CallsignSnippetFormatter) Written ¶
func (CallsignSnippetFormatter) Written(arg any) string
type DepControllerSnippetFormatter ¶
type DepControllerSnippetFormatter struct{}
func (DepControllerSnippetFormatter) Spoken ¶
func (DepControllerSnippetFormatter) Spoken(r *rand.Rand, arg any) string
func (DepControllerSnippetFormatter) Validate ¶
func (DepControllerSnippetFormatter) Validate(arg any) error
func (DepControllerSnippetFormatter) Written ¶
func (DepControllerSnippetFormatter) Written(arg any) string
type FixSnippetFormatter ¶
type FixSnippetFormatter struct{}
func (FixSnippetFormatter) Spoken ¶
func (f FixSnippetFormatter) Spoken(r *rand.Rand, arg any) string
func (FixSnippetFormatter) Validate ¶
func (FixSnippetFormatter) Validate(arg any) error
func (FixSnippetFormatter) Written ¶
func (FixSnippetFormatter) Written(arg any) string
type FrequencySnippetFormatter ¶
type FrequencySnippetFormatter struct{}
func (FrequencySnippetFormatter) Spoken ¶
func (FrequencySnippetFormatter) Spoken(r *rand.Rand, arg any) string
func (FrequencySnippetFormatter) Validate ¶
func (FrequencySnippetFormatter) Validate(arg any) error
func (FrequencySnippetFormatter) Written ¶
func (FrequencySnippetFormatter) Written(arg any) string
type GroupFormSnippetFormatter ¶
type GroupFormSnippetFormatter struct{}
func (GroupFormSnippetFormatter) Spoken ¶
func (GroupFormSnippetFormatter) Spoken(r *rand.Rand, arg any) string
func (GroupFormSnippetFormatter) Validate ¶
func (GroupFormSnippetFormatter) Validate(arg any) error
func (GroupFormSnippetFormatter) Written ¶
func (GroupFormSnippetFormatter) Written(arg any) string
type HeadingSnippetFormatter ¶
type HeadingSnippetFormatter struct{}
func (HeadingSnippetFormatter) Spoken ¶
func (HeadingSnippetFormatter) Spoken(r *rand.Rand, arg any) string
func (HeadingSnippetFormatter) Validate ¶
func (HeadingSnippetFormatter) Validate(arg any) error
func (HeadingSnippetFormatter) Written ¶
func (HeadingSnippetFormatter) Written(arg any) string
type LetterSnippetFormatter ¶
type LetterSnippetFormatter struct{}
func (LetterSnippetFormatter) Spoken ¶
func (LetterSnippetFormatter) Spoken(r *rand.Rand, arg any) string
func (LetterSnippetFormatter) Validate ¶
func (LetterSnippetFormatter) Validate(arg any) error
func (LetterSnippetFormatter) Written ¶
func (LetterSnippetFormatter) Written(arg any) string
type PhraseFormatString ¶
type PhraseFormatString string
PhraseFormatString is a string that potentially includes
func (PhraseFormatString) Spoken ¶
func (s PhraseFormatString) Spoken(r *rand.Rand, args []any) string
type RadioTransmission ¶
type RadioTransmission struct {
Strings []PhraseFormatString
Args [][]any // each slice contains values passed to the corresponding PhraseFormatString
Controller string
Type RadioTransmissionType
}
RadioTransmission holds components that together represent a single radio transmission by a pilot; they may be built up from multiple instructions provided in a single controller command.
func MakeContactTransmission ¶
func MakeContactTransmission(s string, args ...any) *RadioTransmission
MakeContactRadioTransmission is a helper function to make a pilot transmission for initial contact from a single formatting string and set of arguments.
func MakeReadbackTransmission ¶
func MakeReadbackTransmission(s string, args ...any) *RadioTransmission
MakeReadbackTransmission is a helper function to make a pilot transmission of a readback from a single formatting string and set of arguments.
func MakeUnexpectedTransmission ¶
func MakeUnexpectedTransmission(s string, args ...any) *RadioTransmission
MakeUnexpectedTransmission similarly makes a single pilot transmission from the provided format string and arguments, but also marks the transmission as unexpected.
func (*RadioTransmission) Add ¶
func (rt *RadioTransmission) Add(s string, args ...any)
Add is a convenience function to add a transmission snippet to the RadioTransmission. It's more or less equivalent to calling Merge(MakeRadioTransmission(...)).
func (*RadioTransmission) Merge ¶
func (rt *RadioTransmission) Merge(r *RadioTransmission)
Merge takes a separately-constructed RadioTransmission and merges its contents with the current one.
func (RadioTransmission) Spoken ¶
func (rt RadioTransmission) Spoken(r *rand.Rand) string
Spoken returns a string corresponding to how the transmission should be spoken, which appropriate phonetic substitutions made (e.g. "9" -> "niner").
func (*RadioTransmission) Validate ¶
func (rt *RadioTransmission) Validate(lg *log.Logger)
Validate ensures that the types of arguments match with the formatting directives in the PhraseFormatStrings; errors are logged to the provided logger.
type RadioTransmissionType ¶
type RadioTransmissionType int
func (RadioTransmissionType) String ¶
func (r RadioTransmissionType) String() string
type SIDSnippetFormatter ¶
type SIDSnippetFormatter struct{}
func (SIDSnippetFormatter) Validate ¶
func (SIDSnippetFormatter) Validate(arg any) error
func (SIDSnippetFormatter) Written ¶
func (s SIDSnippetFormatter) Written(arg any) string
type STARSnippetFormatter ¶
type STARSnippetFormatter struct{}
func (STARSnippetFormatter) Spoken ¶
func (STARSnippetFormatter) Spoken(r *rand.Rand, arg any) string
func (STARSnippetFormatter) Validate ¶
func (STARSnippetFormatter) Validate(arg any) error
func (STARSnippetFormatter) Written ¶
func (s STARSnippetFormatter) Written(arg any) string
type SnippetFormatter ¶
type SnippetFormatter interface {
// Written
Written(arg any) string
Spoken(r *rand.Rand, arg any) string
Validate(arg any) error
}
SnippetFormatter defines an interface for formatting short text snippets corresponding to various aviation-related concepts into both speech and text. Each is takes a single value specifying the value of the corresponding thing (altitude, speed, etc.)
type SpeedSnippetFormatter ¶
type SpeedSnippetFormatter struct{}
func (SpeedSnippetFormatter) Spoken ¶
func (SpeedSnippetFormatter) Spoken(r *rand.Rand, arg any) string
func (SpeedSnippetFormatter) Validate ¶
func (SpeedSnippetFormatter) Validate(arg any) error
func (SpeedSnippetFormatter) Written ¶
func (SpeedSnippetFormatter) Written(arg any) string