Documentation
¶
Overview ¶
Package audioplayer plays audio from a URL or from bytes, with pause, seek, volume, speed and looping. It needs no permission. For a spoken turn with the microphone, see the audio plugin.
nimbus native plugin add audio-player
p, err := audioplayer.Open(ctx, audioplayer.Source{URL: "https://example.com/show.mp3"})
defer p.Close(ctx)
p.Play(ctx)
go p.Watch(ctx, setStatus)
Index ¶
- type Player
- func (p *Player) Close(ctx context.Context) error
- func (p *Player) Pause(ctx context.Context) error
- func (p *Player) Play(ctx context.Context) error
- func (p *Player) Seek(ctx context.Context, seconds float64) error
- func (p *Player) SetLoop(ctx context.Context, loop bool) error
- func (p *Player) SetRate(ctx context.Context, rate float64) error
- func (p *Player) SetVolume(ctx context.Context, volume float64) error
- func (p *Player) Status(ctx context.Context) (Status, error)
- func (p *Player) Watch(ctx context.Context, f func(Status)) error
- type Source
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Player ¶
type Player struct {
// contains filtered or unexported fields
}
Player is one sound. Close it when you're done.
Click to show internal directories.
Click to hide internal directories.