## Ogg(filename, buffersizeopt)

Constructor

#### # new Ogg(filename, buffersizeopt)

load OggVorbis for sound playback.

Note: OggVorbis module must be loaded by calling LoadLibrary("vorbis") before using!

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`filename` | string |  | file name of the soundfile to load.
`buffersize` | number | <optional> | playback buffer size, default is 16KiB.

See:
  - LoadLibrary()

# Members

Type: number

#### # buffersize

playback buffer size

Type: number

#### # channels

number of channels.

Type: Array.<string>

#### # comments

ogg vorbis comments

Type: number

#### # duration

length of the ogg in seconds

Type: string

#### # filename

name of file

Type: number

#### # maxframesize

max frame size

Type: number

#### # numsamples

length of the ogg in samples

Type: number

#### # samplerate

sample rate.

Type: string

#### # vendor

vendor field

# Methods

#### # Close()

Close Ogg after use.

#### # CurrentSample() → {number}

current play pos

Returns:

the current sample index.

Type: number

#### # Play()

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

#### # Rewind()

rewind to the start of the Ogg.

#### # Seek(idx)

move audio to specified sample index.

##### Parameters:

Name | Type | Description
--- | --- | ---
`idx` | number | new play index