commons

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ShortBeep soundType = iota
	LongBeep
	ShortDelay
)
View Source
const (
	DefaultDitDuration = time.Millisecond * 60
	MorseWordSeparator = '/'

	CharGapMinimum = 3
)

Variables

View Source
var (
	AudioFormat = beep.Format{
		SampleRate:  24_000,
		NumChannels: 2,
		Precision:   2,
	}

	SoundEndDelaySamples = AudioFormat.SampleRate.N(DefaultDitDuration)
)
View Source
var MorseCodeLookup = map[rune]string{
	'a': ".,",
	'b': ",...",
	'c': ",.,.",
	'd': ",..",
	'e': ".",
	'f': "..,.",
	'g': ",,.",
	'h': "....",
	'i': "..",
	'j': ".,,,",
	'k': ",.,",
	'l': ".,..",
	'm': ",,",
	'n': ",.",
	'o': ",,,",
	'p': ".,,.",
	'q': ",,.,",
	'r': ".,.",
	's': "...",
	't': ",",
	'u': "..,",
	'v': "...,",
	'w': ".,,",
	'x': ",..,",
	'y': ",.,,",
	'z': ",,..",
}

Functions

func MorseCharSound

func MorseCharSound(str string, speed float64, charGap int) beep.Streamer

func MorseCharSoundDefault added in v1.1.0

func MorseCharSoundDefault(str string, speed float64) beep.Streamer

Types

type Drill

type Drill struct {
	Text string

	Correct []bool
	Current int
}

type TrainingModel

type TrainingModel struct {
	Drills       []Drill
	CurrentDrill int

	Correct []bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL