Class

Rawplay

Rawplay(filename, samplerate, buffersizeopt)

Constructor

# new Rawplay(filename, samplerate, buffersizeopt)

load RAW sound file (signed 16 bit, stereo, interleaved) for playback. This was just a test module for vorbis and mpeg1 sound output but I decided to keep it.

Note: Rawplay module must be loaded by calling LoadLibrary("rawplay") before using!

Parameters:
Name Type Attributes Description
filename string

file name of the soundfile to load.

samplerate number

sample rate in Hz.

buffersize number <optional>

playback buffer size, default is 4KiB.

See:
  • LoadLibrary()

Members

number

# buffersize

playback buffer size

string

# filename

name of file

number

# length

length of the file in samples (file size / 2 channels / 16 bit)

number

# samplerate

sample rate.

Methods

# Close()

Close sample after use

# CurrentSample() → {number}

current play pos

the last used sample index

number

# Play(left, right)

must be called periodically (e.g. every Loop()) to update the playback buffer

Parameters:
Name Type Description
left bool

true to play left channel

right bool

true to play right channel

# Rewind()

rewind to the start of the sample.

# Seek(idx)

move audio to specified sample index.

Parameters:
Name Type Description
idx number

new play index