Audio Lag Fix

Discussion in 'JS Plugin Releases (RMMV)' started by Fornoreason1000, Jan 2, 2017.

  1. Linard

    Linard Veteran Veteran

    Messages:
    202
    Likes Received:
    17
    First Language:
    Filipino
    Primarily Uses:
    RMMV
    Hello @Fornoreason1000, I tried to used your plugin and it helps to remove the sound delay when i deployed in android app. But the problem is, I have an error that says


    function Html5Audio() {
    throw new Error('This is a static class');
    }




    that's what the error throws. 


    The event that i set is:

    [​IMG]



    I'm not sure if line 134 of your plugin is what the error throws.


    I tried to remove your plugin and it works but there's a sound delay :( . I don't want to remove it because it removes the delay when deploying on android.


    I Hope that it will be fixed hehehe. Thank you so much in advance :)


    EDIT: I didn't encounter any error when i tried a playtest. In my case the error prompt only on android application.


    EDIT: line 136 sorry.
     
    Last edited by a moderator: Jan 19, 2017
    #21
  2. TheTitan99

    TheTitan99 Veteran Veteran

    Messages:
    166
    Likes Received:
    65
    First Language:
    English
    Primarily Uses:
    RMMV
    So far, it seems to be working for me. Haven't done a ton of testing, though.

    I have a question, though. What are the terms of use on this? Commercial? Non-Commercial? Do we need your permission or is it alright simply to credit you?
     
    #22
  3. Fornoreason1000

    Fornoreason1000 Black Sheep Veteran

    Messages:
    200
    Likes Received:
    92
    Location:
    Anor Londo
    First Language:
    English
    Primarily Uses:
    RMMV
    you don't need to , because the two scripts are compatible with each other. what you were experiencing was a bug caused by the pitch modifier in my script. the bug does not occur anywhere else because it was necessary to supply a pitch value, but in Izzys Vehicle Radio, they're was no need. the pitch would default to undefined or 0 , and the sound would play at a really really slow and undetectable rate.

    I will update my script in a hour or so


    I haven't built an Android in RPGmaker mainly to the Hideous and Hacky process it entails. but I know Web Audio is not well supported on Android which is why RPGmakerMV implemented a HTML5 version.


    The script only modifies the WebAudio implementation if you look at that line i assume it is "return HTML5Audio;"? that line calls the default HTML5 done by RPGmakerMV.
    My Suggestion is to turn this script off then see if it does it. the HTML5 version shouldn't have the Lag issue anyway so this script probably will not do anything for you. If there is Lag when using HTML, I'll see if i can cook something up. I do find it strange that you can even get that error



    The Idea i had when making this script is to make a community available plugin fix that solve this irritable immersion breaking bug so that users who have purchased RPGmaker can use iot to make a professional quality game. The "Terms of Use" is pretty much open source. You can use it for Non-Commerical, Commercial, Educational etc. You do not need my permission to use this script in a Commerical RPGMakerMV game. It is Ok to Simply Credit me .
     
    Last edited: Feb 11, 2017
    #23
    TheTitan99 likes this.
  4. moldy

    moldy Veteran Veteran

    Messages:
    191
    Likes Received:
    29
    First Language:
    English
    Ah that makes sense. Thanks for getting back to me :)
     
    #24
  5. Linard

    Linard Veteran Veteran

    Messages:
    202
    Likes Received:
    17
    First Language:
    Filipino
    Primarily Uses:
    RMMV
    Thank you for your reply :)

    It's my fault. Sorry, As i've checked, the audio file is the problem and It has no file size.
     
    #25
  6. TheTitan99

    TheTitan99 Veteran Veteran

    Messages:
    166
    Likes Received:
    65
    First Language:
    English
    Primarily Uses:
    RMMV
    This really has helped my project a lot! I'd be all for every type of sound playing in this way! Thank you for this, really have to say.

    However... I have two things I want to mention, the first being a bug, the second being a request/question.

    First, the bug: BGM doesn't play when you deploy a game, and encrypt the audio files. SE play, because those are running off of the older way of loading sounds. I've seen this issue in other plugins (like Galenmereth's Preload Manager for example can't run anything encrypted, images or audio). Encrypted files can be read... somehow, as the default code manages to read them, but this plugin doesn't seem to be able to yet.

    Secondly: you mention being able to loop audio through notepad documents, since the old loop method doesn't work any more? How would I do this? Or, is there a link to somewhere else that I could see how to do this?
     
    #26
    Fornoreason1000 likes this.
  7. moldy

    moldy Veteran Veteran

    Messages:
    191
    Likes Received:
    29
    First Language:
    English
    Sorry to bother you with another compatibility request, but could you add in a patch for the Codec System plugin? BGM seems to stop after any codec call. D:
     
    #27
  8. Poupouille

    Poupouille Veteran Veteran

    Messages:
    162
    Likes Received:
    26
    First Language:
    Russian, french
    Primarily Uses:
    RMMV
    Hello, I always have a sound delay with some BGM musics. But my music file weighs 8.6MB. It's too much for your plugin or not?
    What is the maximum weight you recommend?
     
    #28
  9. Fornoreason1000

    Fornoreason1000 Black Sheep Veteran

    Messages:
    200
    Likes Received:
    92
    Location:
    Anor Londo
    First Language:
    English
    Primarily Uses:
    RMMV
    file size shouldn't be a problem. my 10minute test was around 11.5MB and it had no effect. Th plugin works by loading only some of the data for the sound directly from the HDD (Hard drive / Server) instead of loading all of it into memory (RAM) and decoding it all. That said , the is no real virtual limit on file size, only the quality.

    If you experience lag with this plugin. let me know via PM or this thread. if you experience stuttering between maps, see the known issues section of the plugin. I recommend you check that section anyway.
     
    #29
  10. Poupouille

    Poupouille Veteran Veteran

    Messages:
    162
    Likes Received:
    26
    First Language:
    Russian, french
    Primarily Uses:
    RMMV
    With your plugin, I always have a lag, but I notice a slight improvement (1 or 2 seconds). It's not between a map. ;)
    I took my musics from YouTube and I converted in .ogg 320kbps with http://www.onlinevideoconverter.com/fr/mp3-converter
    Should I give you more information? And if yes, how?^^
     
    #30
  11. Fornoreason1000

    Fornoreason1000 Black Sheep Veteran

    Messages:
    200
    Likes Received:
    92
    Location:
    Anor Londo
    First Language:
    English
    Primarily Uses:
    RMMV
    320kps is a very high bit rate. in fact anything above that and its potentially just a waste. I'm going to assume you had permission to record the audio of those YouTubers and not planning on releasing commercial products with them.

    Now, I tired with a 500kbs and can't produce the lag. if you press F8 when it lags do any errors message show up? (RED) if so, could you make a screenshot of it. Are you testing this on an Android or PC?
     
    #31
  12. Poupouille

    Poupouille Veteran Veteran

    Messages:
    162
    Likes Received:
    26
    First Language:
    Russian, french
    Primarily Uses:
    RMMV
    Of course, it's non-commercial. ;)
    Which rate do you recommend?
    [​IMG]
    I am on Mac.
     
    Last edited: Mar 4, 2017
    #32
  13. Fornoreason1000

    Fornoreason1000 Black Sheep Veteran

    Messages:
    200
    Likes Received:
    92
    Location:
    Anor Londo
    First Language:
    English
    Primarily Uses:
    RMMV
    I recommend 196kbs, although , that will scarcely affect the issue here, if its lagging heaps on 320kps and it still will on 196kps. now when you run your game, how long does the console sit on "stream is null, waiting"? is it instantaneous or does it hang there? if not there does it hang on one message at all before reaching "connecting nodes"?

    And your Audio you got from YouTube, did you check that it has no silence at the start? (Audacity is a free Audio editor if you need one).
     
    #33
  14. Poupouille

    Poupouille Veteran Veteran

    Messages:
    162
    Likes Received:
    26
    First Language:
    Russian, french
    Primarily Uses:
    RMMV
    When my character walks on the event with the music, "Stream is null, waiting" appears immediately, but the music appears 2 seconds later.
    all messages are displayed at one time, as a block. There is no hang on.

    My english isn't very good, and I am not an expert about technique. I hope I have understood and answered your questions.
    [​IMG]
     
    #34
  15. orlando

    orlando Veteran Veteran

    Messages:
    177
    Likes Received:
    84
    The javascript file itself has no license info. A "Free GPL or GNU license" doesn't exist. Do you mean the GNU GPL v1/2/3? Which one specifically? Please note also that GPLv1/2/3 cannot be used by 99% of RPG Maker MV users because it would require them to license their entire game under the GPL which they aren't allowed to do if it has stock assets (and which would require everyone to fully open-source every game they ever make with RPG Maker MV which can be hardly an intended outcome).

    I recommend switching to a more suitable license like zlib or MIT.
     
    #35
    Fornoreason1000 likes this.
  16. leffy

    leffy Villager Member

    Messages:
    5
    Likes Received:
    0
    First Language:
    English
    Primarily Uses:
    RMMV
    Hey, hopefully this is the plugin I've been looking for.
    Problem is, when I go to playtest my game with your plugin on, it comes up with an error saying-

    "Reference Error
    Decrypter is not defined"

    Any idea how I can fix this?
     
    #36
  17. y0da

    y0da Villager Member

    Messages:
    21
    Likes Received:
    1
    Thank you so much. It works fine on my game.
    My main issue was on the title screen.
     
    #37
  18. Fornoreason1000

    Fornoreason1000 Black Sheep Veteran

    Messages:
    200
    Likes Received:
    92
    Location:
    Anor Londo
    First Language:
    English
    Primarily Uses:
    RMMV
    Yes, check your RPGmaker MV version, if possible update it to 1.4
    Also check that your core scripts are at 1.4, because I've personally had issue of them not updating to 1.4.
     
    Last edited: Apr 15, 2017
    #38
  19. TheTitan99

    TheTitan99 Veteran Veteran

    Messages:
    166
    Likes Received:
    65
    First Language:
    English
    Primarily Uses:
    RMMV
    So, not sure what's causing it, but upon changing from V 068 to 0.71, the game keeps crashing from both combat and pausing. To the best of my knowledge, my game is MV version 1.4.0. When I enter combat, the game crashes, and displays this:

    TypeError: Cannot read property 'name' of null
    at Function.AudioManager.saveBgs (/C:/Users/Brian/Documents/Games/NameOfMyGame/js/plugins/DSE-AUDIOLAG-FIX.js:296)
    at Function.BattleManager.saveBgmAndBgs (rpg_managers.js:2007)
    at Scene_Map.launchBattle (rpg_scenes.js:636)
    at Scene_Map.stop (rpg_scenes.js:440)
    at Function.SceneManager.goto (rpg_managers.js:1879)
    at Function.SceneManager.push (rpg_managers.js:1885)
    at Game_Interpreter.command301 (rpg_objects.js:10118)
    at Game_Interpreter.executeCommand (rpg_objects.js:8922)
    at Game_Interpreter.update (rpg_objects.js:8830)
    at Game_Map.updateInterpreter (rpg_objects.js:6107)
    at Game_Map.update (rpg_objects.js:6014)
    at Scene_Map.updateMain (rpg_scenes.js:420)
    at Scene_Map.updateMainMultiply (rpg_scenes.js:412)

    And when pausing the game/loading the team menu, this error happens:

    Error: Failed to execute 'createMediaElementSource' on 'AudioContext': HTMLMediaElement already connected previously to a different MediaElementSourceNode.
    at Error (native)
    at DSEIV.AudioBuffer.createSourceNode (file:///C:/Users/Brian/Documents/Games/NameOfMyGame/js/plugins/DSE-AUDIOLAG-FIX.js:1082:36)
    at DSEIV.AudioBuffer.createNodes (file:///C:/Users/Brian/Documents/Games/NameOfMyGame/js/plugins/DSE-AUDIOLAG-FIX.js:1070:10)
    at DSEIV.AudioBuffer.startPlayingWebAudio (file:///C:/Users/Brian/Documents/Games/NameOfMyGame/js/plugins/DSE-AUDIOLAG-FIX.js:901:10)
    at DSEIV.AudioBuffer.play (file:///C:/Users/Brian/Documents/Games/NameOfMyGame/js/plugins/DSE-AUDIOLAG-FIX.js:859:18)
    at Function.AudioManager.playStaticSe (file:///C:/Users/Brian/Documents/Games/NameOfMyGame/js/plugins/DSE-AUDIOLAG-FIX.js:472:18)
    at Function.SoundManager.playSystemSound (file:///C:/Users/Brian/Documents/Games/NameOfMyGame/js/rpg_managers.js:1346:22)
    at Function.SoundManager.playOk (file:///C:/Users/Brian/Documents/Games/NameOfMyGame/js/rpg_managers.js:1355:10)
    at Scene_Map.callMenu (file:///C:/Users/Brian/Documents/Games/NameOfMyGame/js/rpg_scenes.js:599:18)
    at Scene_Map.updateCallMenu (file:///C:/Users/Brian/Documents/Games/NameOfMyGame/js/rpg_scenes.js:583:18)rpg_managers.js:1756 SceneManager.catchException

    All other plugins are turned off when testing, the main RPG js files are untouched from the 1.4.0 update. When I turn this plugin off, combat and pausing work fine. In addition, reverting it back to V 0.68 makes combat and pausing work.

    If you have any other questions, I'll be glad to provide as much information as I can!
     
    #39
  20. Poupouille

    Poupouille Veteran Veteran

    Messages:
    162
    Likes Received:
    26
    First Language:
    Russian, french
    Primarily Uses:
    RMMV
    Hello,

    I have this message if the plugin is turn on.
    This is when I click on an event to take an object.
    [​IMG]
     
    #40

Share This Page