Documentation
¶
Index ¶
- Variables
- func AssertSamplesEqual(t *testing.T, expected, actual [][2]float64)
- func AssertStreamerHasCorrectReturnBehaviour(t *testing.T, s beep.Streamer, expectedSamples int)
- func Collect(s beep.Streamer) [][2]float64
- func CollectNum(num int, s beep.Streamer) [][2]float64
- func NewDataStreamer(data [][2]float64) (s beep.StreamSeeker)
- func NewDelayedErrorStreamer(s beep.Streamer, numSamples int, err error) beep.StreamSeeker
- func NewErrorStreamer(err error) beep.StreamSeeker
- func NewSequentialDataStreamer(numSamples int) (s beep.StreamSeeker, data [][2]float64)
- func RandomDataStreamer(numSamples int) (s beep.StreamSeeker, data [][2]float64)
- func TestFilePath(path string) string
- type ErrorStreamer
- type SeekErrorStreamer
Constants ¶
This section is empty.
Variables ¶
var (
TestDataDir = filepath.Join(filepath.Dir(callerPath), "../testdata")
)
Functions ¶
func AssertSamplesEqual ¶
func AssertStreamerHasCorrectReturnBehaviour ¶
AssertStreamerHasCorrectReturnBehaviour tests whether the return values returned by the streamer s adhere to the description on the Streamer interface.
func Collect ¶
func Collect(s beep.Streamer) [][2]float64
Collect drains Streamer s and returns all the samples it streamed.
func CollectNum ¶
CollectNum collects num samples from the streamer in chunks and returns them all.
func NewDataStreamer ¶
func NewDataStreamer(data [][2]float64) (s beep.StreamSeeker)
NewDataStreamer creates a streamer which streams the given data.
func NewDelayedErrorStreamer ¶
NewDelayedErrorStreamer wraps streamer s but returns an error after numSamples have been streamed.
func NewErrorStreamer ¶
func NewErrorStreamer(err error) beep.StreamSeeker
NewErrorStreamer returns a streamer which errors immediately with the given err.
func NewSequentialDataStreamer ¶
NewSequentialDataStreamer creates a streamer which streams samples with values {0, 0}, {1, 1}, {2, 2}, etc. Note that this aren't valid sample values in the range of [-1, 1], but it can nonetheless be useful for testing.
func RandomDataStreamer ¶
RandomDataStreamer generates numSamples random samples and returns a StreamSeeker to stream them.
func TestFilePath ¶
Types ¶
type ErrorStreamer ¶
type ErrorStreamer struct { Error error // contains filtered or unexported fields }
func (*ErrorStreamer) Err ¶
func (e *ErrorStreamer) Err() error
func (*ErrorStreamer) Len ¶
func (e *ErrorStreamer) Len() int
func (*ErrorStreamer) Position ¶
func (e *ErrorStreamer) Position() int
func (*ErrorStreamer) Seek ¶
func (e *ErrorStreamer) Seek(p int) error
type SeekErrorStreamer ¶
type SeekErrorStreamer struct {
// contains filtered or unexported fields
}
func NewSeekErrorStreamer ¶
func NewSeekErrorStreamer(s beep.StreamSeeker, err error) *SeekErrorStreamer
func (*SeekErrorStreamer) Err ¶
func (s *SeekErrorStreamer) Err() error
func (*SeekErrorStreamer) Len ¶
func (s *SeekErrorStreamer) Len() int
func (*SeekErrorStreamer) Position ¶
func (s *SeekErrorStreamer) Position() int
func (*SeekErrorStreamer) Seek ¶
func (s *SeekErrorStreamer) Seek(p int) error