Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultRate = Rate44100Hz
DefaultRate is the rate that all the audio will pe played on. If you need to change it, do it before loading any audio from Primen, as the audio context cannot be changed once it is created.
Functions ¶
Types ¶
type SampleRate ¶
type SampleRate int
SampleRate is the rate (in Hz) at which all the audio will be played. Ebiten recommends a sample rate of 44100Hz or 48000Hz. 22050Hz is reported to have playback issues on Safari.
const ( Rate44100Hz SampleRate = 44100 Rate48000Hz SampleRate = 48000 Rate22050Hz SampleRate = 22050 )
type StereoPanStream ¶
type StereoPanStream struct { audio.ReadSeekCloser // contains filtered or unexported fields }
StereoPanStream is an audio buffer that changes the stereo channel's signal based on the Panning.
func NewStereoPanStream ¶
func NewStereoPanStream(src []byte) *StereoPanStream
NewStereoPanStream returns a new StereoPanStream with a shared buffer src. The src's format must be linear PCM (16bits little endian, 2 channel stereo) without a header (e.g. RIFF header). The sample rate must be same as that of the audio context.
The src can be shared by multiple buffers.
func NewStereoPanStreamFromReader ¶
func NewStereoPanStreamFromReader(src audio.ReadSeekCloser) *StereoPanStream
NewStereoPanStreamFromReader returns a new StereoPanStream with buffer src.
The src's format must be linear PCM (16bits little endian, 2 channel stereo) without a header (e.g. RIFF header). The sample rate must be same as that of the audio context.
func (*StereoPanStream) Pan ¶
func (s *StereoPanStream) Pan() float64
func (*StereoPanStream) SetPan ¶
func (s *StereoPanStream) SetPan(pan float64)