YappsJS Sound Problems!

Coordinator
Apr 17, 2012 at 9:55 AM
Edited May 14, 2012 at 5:57 AM

Im currently working on fixing the Sound Manager witch is currently using a element tag but its very "Bugget" 

im hoping somone has a way to play multiple sounds possibly looping. it would also be nice to preload

I want to use something like this? (PROBLEM SOLVED!)

var snd = new Audio("file.wav");
snd
.play();

Not this

YappsJS.SndManager = function() { //v1.4

 

    this.fileNm = "";
    this.spanObj = "";
    this.volume = 50;
    this.playing = false;
    this.Name = "Sound";
    this.Init = function(file, spanID, Name) {
        this.spanObj = document.getElementById(spanID);
        this.fileNm = file;
        this.Name = Name;
        this.spanObj.innerHTML = " ";
        this.playing = false;
    };
    this.Play = function(loop) {
        this.spanObj.innerHTML = "<embed src='" + this.fileNm + "' hidden=true autostart=true volume=" + this.volume + " loop=" + loop + ">";
        this.playing = true;
    };
    this.Stop = function() {
        this.spanObj.innerHTML = "<embed src='" + this.fileNm + "' hidden=true autostart=false volume=" + this.volume + " loop=false>";
        this.playing = false;
    };
    this.SetName = function(Name) {
        this.Name = Name;
    };
    this.SetVolume = function(volume) {
        this.volume = volume;
        //this.spanObj.innerHTML = "<embed src='" + this.fileNm + "' hidden=true autostart=true volume=" + this.volume + " loop=true>";
        this.playing = false;
    };
    this.Free = function() {
        this.spanObj.innerHTML = " ";
        this.playing = false;
    };
};
Coordinator
May 14, 2012 at 5:57 AM

I've fixed this problem will be in the next release. YappsJS.SoundManager() //v2.0