Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit) (+1)

Using the SoundPlayer method, I was able to extend the class as SoundPlayerAdvanced, and add a Buffer interface to get auto-completion. I used Sup.log to test it, and I was able to get an array of data from the channels, along with the duration, length, and sampleRate of the buffer.

interface Buffer {
    sampleRate: number;
    length: number;
    duration: number;
    numberOfChannels: number;
    getChannelData(number);
    copyFromChannel(number);
    copyToChannel(number);
}

class SoundPlayerAdvanced extends Sup.Audio.SoundPlayer {
    buffer: Buffer;
    constructor(pathOrAsset: string|Sup.Sound, volume?: number, options?: {loop?: boolean, pitch?: number, pan?: number}) {
        super(pathOrAsset, volume, options);
        this.buffer = (this as any).__inner.buffer;
    }
}

Thanks again! :D