Open zumbasana opened 3 years ago
AS2 code from first frame of game (this is a 1-frame game):
//stop(); preloader_mc.bar_mc._xscale = 0; // play_btn.onRollOver = function(){ this.gotoAndPlay("over"); } play_btn.onRollOut = function(){ this.gotoAndPlay("up"); } play_btn.onRelease = function(){ this.gotoAndPlay("down"); _root.play(); } replay_btn.onRollOver = function(){ this.gotoAndPlay("over"); } replay_btn.onRollOut = function(){ this.gotoAndPlay("up"); } replay_btn.onRelease = function(){ this.gotoAndPlay("down"); _root.game_mc.loadMovie("VolumeGame2021.swf"); this._visible = false; /sound1.start(0,0); sound2.start((sound1.position/1000),0); sound3.start((sound1.position/1000),0); sound4.start((sound1.position/1000),0); sound1.setVolume(volume1); sound2.setVolume(volume2); sound3.setVolume(volume3); sound4.setVolume(volume4); play_btn._visible = false; replay_btn._visible = false;/ } play_btn._visible = false; replay_btn._visible = false; // var test1:Boolean = false; var test2:Boolean = false; var test3:Boolean = false; var test4:Boolean = false; // var sound1:Sound = new Sound(); sound1.loadSound("volume_winds.mp3", false); var sound2:Sound = new Sound(); sound2.loadSound("volume_brass.mp3", false); var sound3:Sound = new Sound(); sound3.loadSound("volume_percussion.mp3", false); var sound4:Sound = new Sound(); sound4.loadSound("volume_strings.mp3", false); //
// sound1.onLoad = function() { test1 = true; trace("Sound1 ready ..."); message_txt.text ="Sound1 ready ..."; }; sound2.onLoad = function() { test2 = true; trace("Sound2 ready ..."); message_txt.text ="Sound2 ready ..."; }; sound3.onLoad = function() { test3 = true; trace("Sound3 ready ..."); message_txt.text ="Sound3 ready ..."; }; sound4.onLoad = function() { test4 = true; trace("Sound4 ready ..."); message_txt.text ="Sound4 ready ..."; }; // slave1_mc.onEnterFrame = function() { preloader_mc.message_txt.text = ("Loading:"+Math.floor((sound1.getBytesLoaded()+sound2.getBytesLoaded()+sound3.getBytesLoaded()+sound4.getBytesLoaded() )/(sound1.getBytesTotal()+sound2.getBytesTotal()+sound3.getBytesTotal()+sound4.getBytesTotal())100)+"%"); preloader_mc.bar_mc._xscale = ((sound1.getBytesLoaded()+sound2.getBytesLoaded()+sound3.getBytesLoaded()+sound4.getBytesLoaded() )/(sound1.getBytesTotal()+sound2.getBytesTotal()+sound3.getBytesTotal()+sound4.getBytesTotal())100); if (test1 == true && test2 == true && test3 == true && test4 == true) { sound1.start(0,0); sound2.start((sound1.position/1000),0); sound3.start((sound1.position/1000),0); sound4.start((sound1.position/1000),0); sound1.setVolume(80); sound2.setVolume(80); sound3.setVolume(80); sound4.setVolume(80); trace("playing ..."); preloader_mc._visible = false; slave1_mc.onEnterFrame = undefined; } }; // slide1_mc.onPress = function(){ this.startDrag(false,this._x, 520, this._x, 615); windIcon_mc.gotoAndStop("down"); conductor_mc.gotoAndStop("winds"); } slide1_mc.onRelease = function(){ stopDrag(); windIcon_mc.gotoAndStop("up"); } slide1_mc.onReleaseOutside = function(){ stopDrag(); windIcon_mc.gotoAndStop("up"); } slide2_mc.onPress = function(){ this.startDrag(false,this._x, 520, this._x, 615); brassIcon_mc.gotoAndStop("down"); conductor_mc.gotoAndStop("brass"); } slide2_mc.onRelease = function(){ stopDrag(); brassIcon_mc.gotoAndStop("up"); } slide2_mc.onReleaseOutside = function(){ stopDrag(); brassIcon_mc.gotoAndStop("up"); } slide3_mc.onPress = function(){ this.startDrag(false,this._x, 520, this._x, 615); percIcon_mc.gotoAndStop("down"); conductor_mc.gotoAndStop("perc"); } slide3_mc.onRelease = function(){ stopDrag(); percIcon_mc.gotoAndStop("up"); } slide3_mc.onReleaseOutside = function(){ stopDrag(); percIcon_mc.gotoAndStop("up"); } slide4_mc.onPress = function(){ this.startDrag(false,this._x, 520, this._x, 615); stringIcon_mc.gotoAndStop("down"); conductor_mc.gotoAndStop("strings"); } slide4_mc.onRelease = function(){ stopDrag(); stringIcon_mc.gotoAndStop("up"); } slide4_mc.onReleaseOutside = function(){ stopDrag(); stringIcon_mc.gotoAndStop("up"); } // var slide1Y = 520; var difference1 = 0; var volume1 = 100; var volume1a = 100; // slave2_mc.onEnterFrame = function(){ difference1 = (slide1Y - slide1_mc._y); volume1 += (difference1); winds_mc._alpha = volume1; sound1.setVolume(volume1); slide1Y = slide1_mc._y; difference1 = 0; volume1a = Math.floor(volume1); } // var slide2Y = 520; var difference2 = 0; var volume2 = 100; var volume2a = 100; // slave3_mc.onEnterFrame = function(){ difference2 = (slide2Y - slide2_mc._y); volume2 += (difference2); brass_mc._alpha = volume2; sound2.setVolume(volume2); slide2Y = slide2_mc._y; difference2 = 0; volume2a = Math.floor(volume2); } // var slide3Y = 520; var difference3 = 0; var volume3 = 100; var volume3a = 100; // slave4_mc.onEnterFrame = function(){ difference3 = (slide3Y - slide3_mc._y); volume3 += (difference3); percussion_mc._alpha = volume3; sound3.setVolume(volume3); slide3Y = slide3_mc._y; difference3 = 0; volume3a = Math.floor(volume3); } // var slide4Y = 520; var difference4 = 0; var volume4 = 100; volume4a = 100; // slave5_mc.onEnterFrame = function(){ difference4 = (slide4Y - slide4_mc._y); volume4 += (difference4); strings_mc._alpha = volume4; sound4.setVolume(volume4); slide4Y = slide4_mc._y; difference4 = 0; volume4a = Math.floor(volume4); } sound1.onSoundComplete = function(){ play_btn._visible = true; replay_btn._visible = true;
} stop();
Ann Zumwinkle
@zumbasana, many thanks for reporting the issue.
sound.position()
has been reported as not implemented already in issue #340 and PR #4273 will implement it.
Just in case it helps.
Thank you very much Ousia/Herschel for bumping this issue up, and I'm available to assist with testing anytime!
Hello @Herschel and team! Thanks much for working on audio-mixer issues in the new Pull Request here: https://github.com/ruffle-rs/ruffle/pull/5231 which seems related to our audio sound.position issue. Quick update from me: I installed the most recent Ruffle download: view-source:https://goclassical.org/ruffle/ruffle.js but our volume game still hangs up when getting to sound.position: https://goclassical.org/kids/opera/volume.htm another of our games relies on sound.position heavily and no sound plays at all: https://goclassical.org/kids/brahms/brahms-game Thank you for any advice!
Hi @Herschel and team, This might also help; here is code from another game module of ours, Brahms in Vienna, that also utilizes audio sound .mp3 imports.
GAME ONLINE: https://goclassical.org/kids/brahms/brahms-game
and .swf and .fla attached. base-AZ2021.zip
-- NOT WORKING in HTML page with today's recent version of Ruffle on server (link above) -- WORKS when "test movie" exported from Flash Professional 8.
Thanks guys very much!
Adding here for reference: https://github.com/ruffle-rs/ruffle/pull/5482#issuecomment-944993256
Think this is waiting on Sound.loadSound
(non-streaming version).
Ref #273.
Since #6738 was merged the sound is now working. Strangely, only the leftmost volume slider seems to be working though - the others have no effect. And the "Again" and "Next" buttons aren't working.
There's still some sound lag, but all the sliders work now.
@Lord-McSweeney I don't think so. Open the webpage with a Flash-enabled browser and drag the 3 sliders on the right all the way down, leaving only the leftmost slider turned up. Hear how different that sounds? Now try the same thing in Ruffle. It has no effect, even with the latest Ruffle version.
Hello to the Ruffle team, Adrian17 on discord asked me to post our issues here. We are happy to post our AS2 code, .swfs, and test!
GAME ONLINE: game: https://goclassical.org/kids/opera/volume.htm And .swf and .fla and .swd attached. VolumeGame2021.zip
PROBLEM: No Audio and game doesn't display 4 little volume slider controls below conductor and game does not move forward to play. The .swd debugger says the .mp3s loaded... -- WORKS when "test movie" from Macromeda Flash Professional 8 authoring app. -- NOT WORKING when playing same exported .sfw on desktop (runs Macromedia Flash Player 8). -- NOT WORKING in html page with Ruffle on server: https://goclassical.org/kids/opera/volume.htm
EXPECTED BEHAVIOR: there's 4 little volume slider controls below conductor, setting volume for the 4 imported .mp3s: they should display and allow user to drag up-and-down, setting volume. At end of mp3s, triggers 2 buttons (repeat and continue) to display.
ISSUE: Adrian17 wrote on Discord #help: " I think we have volume control working, but not the more advanced sound features (like sound.position)" I can confirm that yes this game does use sound1.position, sound2.position, etc.
Thank you!