-
1. Re: How can I stop an audio?
Alex Kruger Aug 3, 2013 12:28 PM (in response to Eulalie87)You can see the buzz js library here: http://buzz.jaysalvat.com
The library have been very usefull for me,
Alex
-
2. Re: How can I stop an audio?
resdesign Aug 3, 2013 1:03 PM (in response to Alex Kruger)If you are using buzz, you can use stop(); to stop a sound.
I posted some info on this thread:
-
3. Re: How can I stop an audio?
Eulalie87 Aug 27, 2013 2:11 AM (in response to resdesign)Yes I try to use it but every time I come back on the homepage, The audio starts again. I can't find the solution.
-
4. Re: How can I stop an audio?
SEIF BH Aug 27, 2013 3:50 AM (in response to Eulalie87)EC.Sound.Stop("NameElement");
-
5. Re: How can I stop an audio?
Eulalie87 Aug 27, 2013 4:41 AM (in response to SEIF BH)It is not working. I must not write the code in the right place.
yepnope({nope:['buzz.js',],complete:init});
function init(){myfile=new buzz.sound("testpaul",{formats:["mp3","ogg","wav"],loop:'true'}) ;
myfile.play();
}
EC.Sound.Stop("testpaul");
-
6. Re: How can I stop an audio?
SEIF BH Aug 27, 2013 6:09 AM (in response to Eulalie87)if you need onther thing contact me
-
7. Re: How can I stop an audio?
Eulalie87 Aug 27, 2013 6:29 AM (in response to SEIF BH)Yes please!! I am lost. I try many things to stop the audio. But I can't find. Is it possible to launch only once an audio?
I write this code :
yepnope({nope:['buzz.js',],complete:init});
function init(){myfile=new buzz.sound("testpaul",{formats:["mp3","ogg","wav"],loop:'true'}) ;
myfile.play();
}
The audio starts but I can't stop it when I come back to the homepage.
Please! help me! I am desperate
Thanks
-
8. Re: How can I stop an audio?
SEIF BH Aug 27, 2013 6:52 AM (in response to Eulalie87)No work with this function :
try {
yepnope({
load: "http://simonwidjaja.github.com/EdgeCommons/live/EdgeCommons-0.6.0.js",
callback: function() {
// Load sound manifest (e.g. in creationComplete)
var assetsPath = "sounds/";
EC.Sound.setup(
[
{src: assetsPath + "est.mp3|" + assetsPath + "est.ogg", id: 'est'},
{src: assetsPath + "sound.mp3|" + assetsPath + "sound.ogg", id: 'sound'},
],
function(){ EC.info("Sound setup finished", "Sound with Edge Commons"); }
);
}
});
}
catch(error) {
console.error("sw", error);
}
c=1;
_________
and this is function to 1 button play and stop sound :
if ( c == 1 ){
EC.Sound.stop("namesound");
// play the timeline from the given position (ms or label)
c = 2 ;
}
else
{
// play the timeline from the given position (ms or label)
EC.Sound.play("namesound");
c = 1
}
SEIF
-
9. Re: How can I stop an audio?
Eulalie87 Aug 27, 2013 7:03 AM (in response to SEIF BH)Should I paste all this code on the stage? Sorry I am really bad!!!
-
10. Re: How can I stop an audio?
SEIF BH Aug 27, 2013 7:07 AM (in response to Eulalie87)No probleme , No problem Create a folder in your file , and Renamet it 'Sounds' And past this ...
Past this in CreationCompete
___________________________
try {
yepnope({
load: "http://simonwidjaja.github.com/EdgeCommons/live/EdgeCommons-0.6.0.js",
callback: function() {
// Load sound manifest (e.g. in creationComplete)
var assetsPath = "sounds/";
EC.Sound.setup(
[
{src: assetsPath + "est.mp3|" + assetsPath + "est.ogg", id: 'est'},
{src: assetsPath + "sound.mp3|" + assetsPath + "sound.ogg", id: 'sound'},
],
function(){ EC.info("Sound setup finished", "Sound with Edge Commons"); }
);
}
});
}
catch(error) {
console.error("sw", error);
}
c = 1;
_______________________
and past this in CompostionReady :
i=0;
sym.$('btn').click(function(){
i++;
sym.play("p" + i);
});
sym.$('btnStop').click(function(){
EC.Sound.stop("est");
});
_______________________
and this in action to picture sound or what you want ....
if ( c == 1 ){
EC.Sound.stop("est");
// play the timeline from the given position (ms or label)
sym.play("tr");
c = 2 ;
}
else
{
// play the timeline from the given position (ms or label)
sym.play("tr1");
EC.Sound.play("est");
c = 1
}
-
11. Re: How can I stop an audio?
resdesign Aug 27, 2013 7:08 AM (in response to Eulalie87)Here is a sample:
-
12. Re: How can I stop an audio?
resdesign Aug 27, 2013 7:23 AM (in response to SEIF BH)You probably need to put your starting sound at the right place because if the timeline goes back to your play code it will start again.
-
13. Re: How can I stop an audio?
SEIF BH Aug 27, 2013 7:34 AM (in response to resdesign)this is helpful ?
-
14. Re: How can I stop an audio?
Eulalie87 Aug 27, 2013 7:48 AM (in response to SEIF BH)Yes. Thanks. I try out.
-
15. Re: How can I stop an audio?
SEIF BH Aug 27, 2013 7:49 AM (in response to Eulalie87)Put Yes in the down of page(if this helpful )
-
16. Re: How can I stop an audio?
Eulalie87 Aug 27, 2013 8:01 AM (in response to resdesign)I think so but I want the audio starts at the beginning. Can I do something without create a button stop?
-
17. Re: How can I stop an audio?
resdesign Aug 27, 2013 8:34 AM (in response to Eulalie87)You need to add a flag that will tell you where the playhead is and then set the flg to true or false.
If you want you can PM me your project and I will look at it.
-
18. Re: How can I stop an audio?
SEIF BH Aug 27, 2013 11:30 AM (in response to Eulalie87)yes this simple
make this in compositionready :
EC.Sound.play("namesound");
-
19. Re: How can I stop an audio?
resdesign Aug 28, 2013 8:57 AM (in response to resdesign)I think the only way you could do this is by using a session and have a flag so that when the user comes back to the page in that session, the sound does not play.
But let me play with it some more so I can see if this can be done directly in edge.
-
20. Re: How can I stop an audio?
resdesign Aug 28, 2013 9:52 AM (in response to Eulalie87)You need to use webstorage and then set it up so that it will store the conditions - if it has not played, allow autoplay and if it has already played once set the audio to autoplay false.
see webstorage doc here:
http://www.w3schools.com/html/html5_webstorage.asp
He audio would have to be placed in the html file not in Edge.
Marie
-
21. Re: How can I stop an audio?
heathrowe Aug 28, 2013 11:30 AM (in response to resdesign)This sessionStorage example may be a better fit:
/////////////////creationComplete////////////////////////
if(!window.sessionStorage || (window.sessionStorage && !window.sessionStorage.getItem("seenanimation"))) {
EC.Sound.play("namesound");
if(window.sessionStorage) window.sessionStorage.setItem("seenanimation",1);
} else {
EC.Sound.stop("namesound");
}
//////////////////////////////////////
Darrell
-
22. Re: How can I stop an audio?
resdesign Aug 28, 2013 11:35 AM (in response to heathrowe)Awesome Darrell! That's basically what I was aiming at. Your solution beats mine!!!
They are using buzz.js but they can do the same thing.
-
23. Re: How can I stop an audio?
heathrowe Aug 28, 2013 11:47 AM (in response to resdesign)No sweat,
I just grabbed one of the examples from previous thread - also just realized that the getitem reference will need to be adjusted accordingly.
D



