Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 13
  1. #1
    Utente di HTML.it L'avatar di ett
    Registrato dal
    Dec 2002
    Messaggi
    251

    PIU' SUONI DI SOTTOFONDO

    Ciao a tutti,
    Ad un filmato volevo aggiungere della musica di sottofondo ( wav o mp3, cmq un estensione che sentano tutti ), ma non volevo un'unica traccia ma diverse che ovviamente il mio filmato vada a prendere esternamente.
    Il tutto " ovviamente " non deve pesare sul caricamento, non so' se la musica puo' partire subito anche se la carica poco per volta, boh ?

    Ringrazio anticipatamente, bacioni a tutti i testoni ! :rollo:

  2. #2
    spieghi bene cosda devi fare???

    una sorta di lettore che pre nde dalla caretella le canzoni e le manda in streaming

    oppure hai solo 2/3 canzoni

    come vuoi che funzioni esattamente la cosa? una specie di jukeboxche carica le canzoni man mano da una cartella indipendentemente da quante ne hai?

    spiegat bene e se domani ho un pò di tempo provo a fare qualcosa anche se nn ti prometto nulla che sono incasinatissimo

    ciao
    Consulenza aziendale a 360° http://www.gruppodg.it http://www.gruppodg.it/3d
    Realizzazione siti internet, Siti Flash, Ricerca Location per bar negozi , esercizi commerciali, sviluppo pratiche e allestimento

  3. #3
    Utente di HTML.it L'avatar di ett
    Registrato dal
    Dec 2002
    Messaggi
    251
    (grazie per la pazienza)
    in grandi linee, l'audio dovrebbe essere come se ascoltassi un cdaudio mentre guardo il sito.
    Le canzoni potrebbero essere 2,3 o 5.
    Cmq il numero non ha importanza l'importante e' che non pesi sul filmato.
    Sul filmato stesso a me basta che ci sia l' ON - OFF e nient'altro.
    Non mi interessa scegliere le canzoni. Queste dovrebbero andare in sequenza e di continuo. Va bene anche che ricomincino da capo se si preme OFF -> ON.
    "" una specie di jukeboxche carica le canzoni man mano da una cartella indipendentemente da quante ne hai? "" -> YES

    Ciao e buona serata ( se non ci sentiamo )

  4. #4
    Utente di HTML.it L'avatar di ett
    Registrato dal
    Dec 2002
    Messaggi
    251
    Sto provando a far qualcosa ma e' uno schifo

  5. #5
    Utente di HTML.it L'avatar di ett
    Registrato dal
    Dec 2002
    Messaggi
    251
    Enigma79 tu sei riuscito a scoprire qualcosa ?

  6. #6
    Utente di HTML.it L'avatar di ett
    Registrato dal
    Dec 2002
    Messaggi
    251
    Novita' !!
    Sono riuscita a mettere in sequenza delle canzoni , ma non andando a prenderle esternamente il tutto diventa . . . . pesantissimo

  7. #7
    scusa l'assenza ma sono stato impegnatissimo
    in giro per il web ho trovato una classe per andare al leggere gli mp3 da una playlist quindi con i file esterni
    ecco il codice
    codice:
    // mp3Player class
    _soundbuftime = 1;
    mp3Player = function (songs, interF, reservedDepth) {
    	if (songs != undefined && interF != undefined && reservedDepth != undefined && typeof songs == "object" && typeof interF == "object" && typeof reservedDepth == "number") {
    		this.sound = new Object(new Sound(_root));
    		this.songs = songs;
    		this.player = interF;
    		this.positionDump = 0;
    		this.songs.index = 0;
    		this.sound.paused = false;
    		this.sound.stopped = false;
    		this.curVolume = 100;
    		this.player.songInfo.html = true;
    		this.player.songInfo.condenseWhite = true;
    		this.player.songInfo.autoSize = "left";
    		this.player.volumeNR.autoSize = "center";
    		this.safeDepth = reservedDepth-1;
    		this.player.progressIndicator.offset = this.player.progressIndicator._x;
    		this.loadHandler = _root.createEmptyMovieClip("LH", ++this.safeDepth);
    		this.progressHandler = _root.createEmptyMovieClip("PH", ++this.safeDepth);
    		this.volumeHandler = _root.createEmptyMovieClip("VH", this.safeDepth+3);
    		this.volumeSlideHandler = _root.createEmptyMovieClip("VSH", ++this.safeDepth+4);
    		// Start functions ----------------------------------------------------------------------------------------------------
    		this.setRollOver(1);
    		this.setControls();
    		this.setInitialVolume(100);
    		this.sound.loadSound(this.songs[this.songs.index].url, true);
    		this.showLoaded();
    		this.showSongInfo();
    		this.indicateStatus(1);
    		this.indicateProgress();
    		this.enableDrag();
    		// 
    	} else {
    		trace("Invalid parameter(s) specified.");
    	}
    };
    mp3Player.prototype.stopProgressIndicator = function() {
    	delete this.progressHandler.onEnterFrame;
    };
    mp3Player.prototype.resetProgressIndicator = function() {
    	delete this.progressHandler.onEnterFrame;
    	this.player.progressIndicator._x = this.player.progressIndicator.offset;
    };
    mp3Player.prototype.disableDrag = function() {
    	delete this.player.progressIndicator.onPress;
    	delete this.player.progressIndicator.onRelease;
    	delete this.player.progressIndicator.onReleaseOutside;
    };
    mp3Player.prototype.indicateStatus = function(stat) {
    	var tar;
    	stat>0 ? tar=this.player.playButton : stat+1 ? tar=this.player.pauseButton : tar=this.player.stopButton;
    	this.player.statusIndicator.easeX(tar._x);
    };
    mp3Player.prototype.showSongInfo = function() {
    	var artist = this.songs[this.songs.index].artist;
    	var title = this.songs[this.songs.index].title;
    	var output = artist+" - "+title;
    	this.player.songInfo.htmlText = output;
    };
    mp3Player.prototype.next = function() {
    	this.sound.stop();
    	this.songs.index++;
    	if (this.songs.index>this.songs.length-1) {
    		this.songs.index = 0;
    	}
    	this.showSongInfo();
    	this.sound = new Object(new Sound(_root));
    	this.sound.loadSound(this.songs[this.songs.index].url, true);
    	this.sound.setVolume(this.curVolume);
    	this.showLoaded();
    	this.indicateStatus(1);
    	this.indicateProgress();
    };
    mp3Player.prototype.setInitialVolume = function(x) {
    	var ref = this;
    	var tgt = x/100*this.player.volumeHeight;
    	var vitgt = this.player.volumeBar._y-tgt;
    	this.player.volumeNR.text = 100;
    	this.sound.setVolume(x);
    	this.curVolume = x;
    	this.volumeHandler.onEnterFrame = function() {
    		ref.player.volumeIndicator._y = vitgt-(vitgt-ref.player.volumeIndicator._y)/1.2;
    		ref.player.volumeBar._height = tgt-(tgt-ref.player.volumeBar._height)/1.2;
    		if (ref.player.volumeIndicator._y>vitgt-1 && ref.player.volumeIndicator._y<vitgt+1 && ref.player.volumeBar._height>tgt-1 && ref.player.volumeBar._height<tgt+1) {
    			delete this.onEnterFrame;
    		}
    	};
    };
    mp3Player.prototype.setVolumeDrag = function(x) {
    	if (x>100) {
    		x = 100;
    	}
    	if (x<0) {
    		x = 0;
    	}
    	var ref = this;
    	var tgt = x/100*this.player.volumeHeight;
    	this.sound.setVolume(x);
    	this.curVolume = x
    	this.player.volumeNR.text = Math.round(x);
    	this.volumeHandler.onEnterFrame = function() {
    		ref.player.volumeBar._height = tgt-(tgt-ref.player.volumeBar._height)/1.2;
    		if (ref.player.volumeBar._height>tgt-1 && ref.player.volumeBar._height<tgt+1) {
    			delete this.onEnterFrame;
    		}
    	};
    };
    mp3Player.prototype.dragVolumeSlider = function() {
    	var ref = this;
    	var maxH = this.player.volumeHeight;
    	var vi = this.player.volumeIndicator;
    	var vb = this.player.volumeBar;
    	this.volumeSlideHandler.onEnterFrame = function() {
    		conv = {x:0, y:_root._ymouse};
    		globalToLocal(conv);
    		this._y = conv.y;
    		if (conv.y>=vb._y-maxH-1 && conv.y<=vb._y+1) {
    			vi._y = conv.y;
    			ref.setVolumeDrag((vb._y-conv.y)*100/maxH);
    		}
    	};
    };
    mp3Player.prototype.previous = function() {
    	this.sound.stop();
    	this.songs.index--;
    	if (this.songs.index<0) {
    		this.songs.index = this.songs.length-1;
    	}
    	this.showSongInfo();
    	this.sound = new Object(new Sound(_root));
    	this.sound.loadSound(this.songs[this.songs.index].url, true);
    	this.sound.setVolume(this.curVolume);
    	this.showLoaded();
    	this.indicateStatus(1);
    	this.indicateProgress();
    };
    mp3Player.prototype.indicateProgress = function() {
    	var ref = this;
    	this.progressHandler.onEnterFrame = function() {
    		var played = ref.sound.position;
    		var total = ref.songs[ref.songs.index].duration;
    		ref.player.progressIndicator._x = ref.player.progressIndicator.offset+((played/total)*ref.player.loadWidth);
    		if (played>=total) {
    			delete this.onEnterFrame;
    			ref.resetProgressIndicator();
    			ref.next();
    		}
    	};
    };
    mp3Player.prototype.showLoaded = function() {
    	var ref = this;
    	this.loadHandler.onEnterFrame = function() {
    		var loaded = ref.sound.getBytesLoaded();
    		var total = ref.songs[ref.songs.index].totalbytes;
    		ref.player.loadBar._width = (loaded/total)*ref.player.loadWidth;
    		if (loaded == total) {
    			delete this.onEnterFrame;
    		}
    	};
    };
    mp3Player.prototype.setRollOver = function(grow) {
    	if (grow) {
    		this.player.previousButton.onRollOver = this.player.stopButton.onRollOver=this.player.pauseButton.onRollOver=this.player.playButton.onRollOver=this.player.nextButton.onRollOver=function () {
    			this.grow();
    		};
    		this.player.previousButton.onRollOut = this.player.stopButton.onRollOut=this.player.pauseButton.onRollOut=this.player.playButton.onRollOut=this.player.nextButton.onRollOut=function () {
    			this.shrink();
    		};
    	} else {
    		this.player.previousButton._alpha = this.player.stopButton._alpha=this.player.pauseButton._alpha=this.player.playButton._alpha=this.player.nextButton._alpha=30;
    		this.player.previousButton.onRollOver = this.player.stopButton.onRollOver=this.player.pauseButton.onRollOver=this.player.playButton.onRollOver=this.player.nextButton.onRollOver=function () {
    			this.fadeIn();
    		};
    		this.player.previousButton.onRollOut = this.player.stopButton.onRollOut=this.player.pauseButton.onRollOut=this.player.playButton.onRollOut=this.player.nextButton.onRollOut=function () {
    			this.fadeOut();
    		};
    	}
    };
    mp3Player.prototype.setControls = function() {
    	var ref = this;
    	var playB = this.player.playButton;
    	var prevB = this.player.previousButton;
    	var stopB = this.player.stopButton;
    	var nextB = this.player.nextButton;
    	var pauseB = this.player.pauseButton;
    	var volIndic = this.player.volumeIndicator;
    	volIndic.onPress = function() {
    		ref.dragVolumeSlider();
    	};
    	volIndic.onRelease = volIndic.onReleaseOutside=function () {
    		delete ref.volumeSlideHandler.onEnterFrame;
    	};
    	pauseB.onRelease = function() {
    		if (!ref.sound.stopped) {
    			ref.sound.stop();
    			ref.indicateStatus(0);
    			ref.sound.paused = true;
    			ref.sound.stopped = false;
    			ref.sound.pausedPosition = ref.sound.position;
    			ref.stopProgressIndicator();
    		}
    	};
    	stopB.onRelease = function() {
    		ref.sound.stop();
    		ref.indicateStatus(-1);
    		ref.sound.stopped = true;
    		ref.sound.paused = false;
    		ref.sound.pausedPosition = 0;
    		ref.resetProgressIndicator();
    	};
    	playB.onRelease = function() {
    		if (ref.sound.stopped) {
    			ref.indicateProgress();
    			ref.indicateStatus(1);
    			ref.sound.start(0, 1);
    			ref.sound.stopped = false;
    		} else if (ref.sound.paused) {
    			ref.indicateProgress();
    			ref.indicateStatus(1);
    			ref.sound.start(ref.sound.pausedPosition/1000, 1);
    			ref.sound.paused = false;
    		}
    	};
    	nextB.onRelease = function() {
    		ref.resetProgressIndicator();
    		ref.next();
    	};
    	prevB.onRelease = function() {
    		ref.resetProgressIndicator();
    		ref.previous();
    	};
    };
    mp3Player.prototype.enableDrag = function() {
    	var ref = this;
    	this.player.progressIndicator.onPress = function() {
    		ref.sound.stop();
    		ref.stopProgressIndicator();
    		ref.indicateStatus(0);
    		ref.sound.paused = true;
    		ref.sound.stopped = false;
    		total = ref.songs[ref.songs.index].duration;
    		this.onEnterFrame = function() {
    			conv = {x:_root._xmouse};
    			globalToLocal(conv);
    			this._x = conv.x;
    			if (conv.x<ref.player.loadBar._x) {
    				this._x = ref.player.loadBar._x;
    			}
    			if (conv.x>ref.player.loadBar._x+ref.player.loadWidth) {
    				this._x = ref.player.loadBar._x+ref.player.loadWidth;
    			}
    			var percent = ((this._x-ref.player.loadBar._x)/ref.player.loadWidth)*100;
    			this.newPosition = (percent*total)/100;
    		};
    	};
    	this.player.progressIndicator.onRelease = this.player.progressIndicator.onReleaseOutside=function () {
    		if (this.newPosition>=ref.songs[ref.songs.index].duration) {
    			this.newPosition = ref.songs[ref.songs.index].duration-1;
    		}
    		delete this.onEnterFrame;
    		ref.sound.start(ref.player.progressIndicator.newPosition/1000, 1);
    		ref.sound.paused = false;
    		ref.sound.stopped = false;
    		ref.indicateStatus(1);
    		ref.indicateProgress();
    	};
    };
    //prototypes
    MovieClip.prototype.fadeIn = function() {
    	this.onEnterFrame = function() {
    		this._alpha += 2;
    		this._alpha>=100 ? delete this.onEnterFrame : null;
    	};
    };
    MovieClip.prototype.fadeOut = function() {
    	this.onEnterFrame = function() {
    		this._alpha -= 2;
    		this._alpha<=30 ? delete this.onEnterFrame : null;
    	};
    };
    MovieClip.prototype.grow = function() {
    	var t = 150;
    	this.onEnterFrame = function() {
    		this._xscale = this._yscale=t-(t-this._xscale)/1.2;
    		if (this._xscale>t-1 && this._xscale<t+1) {
    			delete this.onEnterFrame;
    		}
    	};
    };
    MovieClip.prototype.shrink = function() {
    	var t = 100;
    	this.onEnterFrame = function() {
    		this._xscale = this._yscale=t-(t-this._xscale)/1.2;
    		if (this._xscale>t-1 && this._xscale<t+1) {
    			delete this.onEnterFrame;
    		}
    	};
    };
    MovieClip.prototype.easeX = function(t) {
    	this.onEnterFrame = function() {
    		this._x = t-(t-this._x)/1.2;
    		if (this._x>t-1 && this._x<t+1) {
    			delete this.onEnterFrame;
    		}
    	};
    };
    // creation of mp3Player class instance and junk
    songsArray = new Array();
    playerInterface = new Object();
    playerInterface.playButton = this.playButton;
    playerInterface.stopButton = this.stopButton;
    playerInterface.pauseButton = this.pauseButton;
    playerInterface.previousButton = this.previousButton;
    playerInterface.nextButton = this.nextButton;
    playerInterface.loadBar = this.loadbar;
    playerInterface.loadWidth = 165;
    playerInterface.progressIndicator = this.proIndic;
    playerInterface.statusIndicator = this.statusIndic;
    playerInterface.songInfo = this.songInfo;
    playerInterface.volumeBar = this.volumeBar;
    playerInterface.volumeNR = this.volumeNR;
    playerInterface.volumeIndicator = this.volumeIndic;
    playerInterface.volumeHeight = 60;
    //---------------------------------------------------
    
    XMLRetrieve = new XML();
    XMLRetrieve.ignoreWhite = true;
    XMLRetrieve.load("http://www.miosito.com/playlist.xml ");
    XMLRetrieve.onLoad = function() {
    	for (var j = 0; j<this.firstChild.childNodes.length; j++) {
    		/* Handle duration and convert to milliseconds */
    		dur = this.firstChild.childNodes[j].attributes.duration;
    		dblPnt = dur.indexOf(":");
    		mins = Number(dur.substr(0, dblPnt));
    		sec = Number(dur.substr(dblPnt+1, dur.length));
    		ms = ((mins*60)+sec)*1000;
    		/* Handle filesize and convert to bytes */
    		songsArray.push({title:this.firstChild.childNodes[j].attributes.title, artist:this.firstChild.childNodes[j].attributes.artist, url:this.firstChild.childNodes[j].firstChild.nodeValue, duration:ms, totalbytes:Number(this.firstChild.childNodes[j].attributes.filesize)});
    	}
    	player = new mp3Player(songsArray, playerInterface, 1);
    };
    devi solo cambiare il link in rosso e crearti il file xml da cui andare a leggere le canzoni

    Consulenza aziendale a 360° http://www.gruppodg.it http://www.gruppodg.it/3d
    Realizzazione siti internet, Siti Flash, Ricerca Location per bar negozi , esercizi commerciali, sviluppo pratiche e allestimento

  8. #8
    Utente di HTML.it L'avatar di ett
    Registrato dal
    Dec 2002
    Messaggi
    251
    Figurati , devo solo ringraziarti
    Il piccolo problema e' :
    Dove lo metto tutto il papiro ?

  9. #9
    Utente di HTML.it L'avatar di ett
    Registrato dal
    Dec 2002
    Messaggi
    251
    e come creo il file xml ?

  10. #10
    bhe il codice è davvero un papiro e putroppo non ho granchè di tempo per vederlo cmq il codice va sul primo frame

    poi dovresti cercare le varie istanze che saranno i tuoi pulsanti il volume e tutto il resto da applicare al player e xml lo crei anche da blocco note andrebbe visto solo cosa scrivere nei nodi

    se ho tempo ma dubito provo a darci uno sguardo
    Consulenza aziendale a 360° http://www.gruppodg.it http://www.gruppodg.it/3d
    Realizzazione siti internet, Siti Flash, Ricerca Location per bar negozi , esercizi commerciali, sviluppo pratiche e allestimento

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.