## Sample(filename)

Constructor

#### # new Sample(filename)

Load a WAV-file.

##### Parameters:

Name | Type | Description
--- | --- | ---
`filename` | string |

View Source doc/classes.js, line 228

# Members

#### # static bits

Sound resolution.

View Source doc/classes.js, line 244

#### # static filename

Name of the WAV.

View Source doc/classes.js, line 232

#### # static frequency

Sound frequency.

View Source doc/classes.js, line 240

#### # static length

Sound length.

View Source doc/classes.js, line 236

#### # static stereo

mono/stereo indicator.

View Source doc/classes.js, line 248

# Methods

#### # Get(sample) → {number}

Get sample data.

##### Parameters:

Name | Type | Description
--- | --- | ---
`sample` | number | index to return.

View Source doc/classes.js, line 266

Returns:
The sample value at that position. The sample data are always in unsigned format.
Type: number

#### # Play(volume, panning, loop) → {number}

Play the WAV.

##### Parameters:

Name | Type | Description
--- | --- | ---
`volume` | number | between 0-255.
`panning` | number | between (left) 0-255 (right).
`loop` | boolean | true := sample will loop, false := sample will only be played once.

View Source doc/classes.js, line 256

Returns:
used voice number or null if not played.
Type: number

#### # Stop()

Stop playing.

View Source doc/classes.js, line 260