Documentation
¶
Overview ¶
Package ebiten plays a synth.Stream of the voice library on an Ebiten audio context. It is a nested module, so programs that do not use Ebiten never depend on it.
Index ¶
Constants ¶
const DefaultBufferSize = 50 * time.Millisecond
DefaultBufferSize is a player buffer that keeps the typewriter and the sound in step (notes start within about this much of their Sink call) without underruns on desktop or in browsers.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Player ¶
type Player struct {
// contains filtered or unexported fields
}
Player plays a synth.Stream on an Ebiten audio context. The stream must be in FormatFloat32 at the context's sample rate.
The Ebiten player owns the stream's Read from its own goroutine; keep calling only the stream's Sink methods (through a voice.Speaker) from the game. Browsers start audio only after a user gesture; Ebiten resumes the context on the first input, so sound starts then. Keep the Player referenced while it plays: the audio library closes a player that is garbage collected.
func NewPlayer ¶
NewPlayer starts playing s on ctx with the given buffer size (0 means DefaultBufferSize). It returns an error, and starts nothing, when the stream's format or sample rate does not fit the context.
func (*Player) Close ¶
Close stops playback and releases the Ebiten player. The stream is left as it is.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
say
command
Command say speaks a line of text through the default audio device, with no WAV file in between, and types the text out in the terminal as it is spoken.
|
Command say speaks a line of text through the default audio device, with no WAV file in between, and types the text out in the terminal as it is spoken. |
|
Package dialoguebox is an Ebiten game that shows a dialogue: a dark screen with a box at the bottom, the speaker's name, the text typing out in the speaker's voice, and a hint.
|
Package dialoguebox is an Ebiten game that shows a dialogue: a dark screen with a box at the bottom, the speaker's name, the text typing out in the speaker's voice, and a hint. |
|
Command example plays a dialogue in an Ebiten window: each line is spoken in its character's voice while the text types out.
|
Command example plays a dialogue in an Ebiten window: each line is spoken in its character's voice while the text types out. |