"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", { value: true });
const index_1 = require("./index");
const path = require("path");
const sleep = (ms) => __awaiter(void 0, void 0, void 0, function* () {
    return new Promise((resolve) => {
        setTimeout(() => {
            resolve();
        }, ms);
    });
});
(() => __awaiter(void 0, void 0, void 0, function* () {
    const testPlayer = new index_1.AudioPlayer();
    console.log('Loading file..');
    const mediaPath = path.join(__dirname, 'media');
    const sampleFile = path.join(mediaPath, 'piano.wav');
    yield testPlayer.load(sampleFile);
    console.log('File loaded. Seeking to 10 seconds');
    yield testPlayer.seek(2000);
    console.log('Waiting 2 seconds before playback..');
    yield sleep(2000);
    console.log('Playing for 5 seconds');
    yield testPlayer.play();
    console.log('Waiting for 5 seconds');
    yield sleep(5000);
    console.log('Seeking back to 0');
    yield testPlayer.seek(0);
    console.log('Waiting for 5 seconds then seeking back to 0');
    yield sleep(100);
    yield testPlayer.seek(0);
    yield sleep(25000);
}))().catch((err) => {
    console.error(err);
});
//# sourceMappingURL=test.js.map