• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Music not looping in game, F mod issues

23
Posts
9
Years
    • Seen Dec 18, 2018
    So, i thought i was finished with my pokemon game, i went over for a check and a really weird thing is happening. In the rpgmaker editor (where you work on the game) the music loops fine. But when you launch the game as a stand alone project the music dose not loop but repeats (this includes the included music). Also the SE also repeat. As in the victory music just loops instead of playing once.
    The only really big change is i addded is pokemon elite battle add on.


    ----- Update -----
    So i figured out its something to do with F mod. For some reason it will repeat all sound files including sfx except the new songs i added to fmod. What i want is for Fmod to recognize only the audio files that i included (which it is) and all other songs to just be left alone and to loop properly instead of repeating from the start every single time. Ill leave my script below Any ideas why?

    --script
    #===
    #Audio (FmodEx)
    # A rewrite of Audio module to integrate FmodEx
    #---
    #© 2015 - Nuri Yuri (塗 ゆり)
    #© 2015 - GiraPrimal : Concept of LOOP_TABLE
    #---
    #Script written by the menbers of the Community Script Project
    #===
    module Audio
    LOOP_TABLE = [

    # [ "Audio/xxx/File_name", begin, end ]
    # Add here
    [ "Audio/BGM/champ2", 48567,89624 ],
    [ "Audio/BGM/Zinnia2.ogg", 13806,174578],
    [ "Audio/BGM/Youaremyhope", 42324,233692],
    [ "Audio/BGM/test", 500,1000 ]

    # Note : Renember to add a comma after each ]
    # (except for the last line and the below ]).
    ]

    #---
    #>Puts the file names in lowercase to improve the search
    #---
    LOOP_TABLE.each do |i| i[0].downcase! end

    unless @bgm_play #>To avoid the RGSSReset problem
    #===
    #>Load and initialize FmodEx
    #===
    Kernel.load_module("RGSS FmodEx.dll","Init_FmodEx")
    ::FmodEx.init(32)
    #---
    #>Indication of the default lib'
    #---
    @library = ::FmodEx
    #---
    #>Saving the RGSS functions
    #---
    @bgm_play = method(:bgm_play)
    @bgm_fade = method(:bgm_fade)
    @bgm_stop = method(:bgm_stop)
    @bgs_play = method(:bgs_play)
    @bgs_fade = method(:bgs_fade)
    @bgs_stop = method(:bgs_stop)
    @me_play = method(:me_play)
    @me_fade = method(:me_fade)
    @me_stop = method(:me_stop)
    @se_play = method(:se_play)
    @se_stop = method(:se_stop)
    #---
    #>Volumes definition
    #---
    @master_volume = 100
    @sfx_volume = 100
    #===
    #>Extensions supported by FmodEx
    #===
    EXT = ['.ogg', '.mp3', '.wav', '.mid', '.aac', '.wma', '.it', '.xm', '.mod', '.s3m', '.midi']
    #===
    #>Creation/definition of the functions
    #===
    module_function
    def bgm_play(file_name, volume = 100, pitch = 100)
    volume = volume * @master_volume / 100
    return @bgm_play.call(file_name, volume, pitch) if(@library != ::FmodEx)
    filename = check_file(file_name)
    bgm = ::FmodEx.bgm_play(filename, volume, pitch)
    loop_audio(bgm, file_name)
    end
    def bgm_fade(time)
    return @bgm_fade.call(time) if(@library != ::FmodEx)
    ::FmodEx.bgm_fade(time)
    end
    def bgm_stop
    return @bgm_stop.call if(@library != ::FmodEx)
    ::FmodEx.bgm_stop
    end
    def bgs_play(file_name, volume = 100, pitch = 100)
    volume = volume * @sfx_volume / 100
    return @bgs_play.call(file_name, volume, pitch) if(@library != ::FmodEx)
    filename = check_file(file_name)
    bgs = ::FmodEx.bgs_play(filename, volume, pitch)
    loop_audio(bgs, file_name)
    end
    def bgs_fade(time)
    return @bgs_fade.call(time) if(@library != ::FmodEx)
    ::FmodEx.bgs_fade(time)
    end
    def bgs_stop
    return @bgs_stop.call if(@library != ::FmodEx)
    ::FmodEx.bgs_stop
    end
    def me_play(file_name, volume = 100, pitch = 100)
    volume = volume * @master_volume / 100
    return @me_play.call(file_name, volume, pitch) if(@library != ::FmodEx)
    file_name = check_file(file_name)
    ::FmodEx.me_play(file_name, volume, pitch)
    end
    def me_fade(time)
    return @me_fade.call(time) if(@library != ::FmodEx)
    ::FmodEx.me_fade(time)
    end
    def me_stop
    return @me_stop.call if(@library != ::FmodEx)
    ::FmodEx.me_stop
    end
    def se_play(file_name, volume = 100, pitch = 100)
    volume = volume * @sfx_volume / 100
    return @se_play.call(file_name, volume, pitch) if(@library != ::FmodEx)
    file_name = check_file(file_name)
    ::FmodEx.se_play(file_name, volume, pitch)
    end
    def se_stop
    return @se_stop.call if(@library != ::FmodEx)
    ::FmodEx.se_stop
    end
    #===
    #>check_file
    # Check the presence of the file and return the filename
    # /!\ Doesn't correct the mistake
    #====
    def check_file(file_name)
    return file_name if File.exist?(file_name)
    EXT.each do |ext|
    filename = file_name+ext
    return filename if File.exist?(filename)
    end
    return file_name
    end
    #===
    #>loop_audio
    # Function that automatically call the set_loop_points
    #===
    def loop_audio(sound, file_name)
    filename = file_name.downcase
    LOOP_TABLE.each do |i|
    if(i[0] == filename)
    return sound.set_loop_points(i[1], i[2])
    end
    end
    end
    end
    end
     
    Last edited:
    23
    Posts
    9
    Years
    • Seen Dec 18, 2018
    So i fixed the attacking issue (i think) but for the music it's all audio sounds. All packaged essentials music and SFX and so forth don't loop properly and i have no idea what happened.

    So I had f mod in my script, and that was causing the music loop issue... who knew?
     
    Last edited by a moderator:
    23
    Posts
    9
    Years
    • Seen Dec 18, 2018
    The issue is that F Mod is implementing every audio file with it so all audio files will repeat (start from beginning to end) instead of looping properly (looping from middle of song to end, where the loop is) and i'm not sure why that is happening.

    Edit: I'm still having problems with fmod. For whatever reason all audio that i do not put into the f mod script will be repeated, not looped. I've checked the scripts, replaced them and then tried them again and i'm still getting this issue. I thought it might be because of an older version of essentials but i upgraded to 15.1 and am still having the same issues, i'm not sure whats going on.
    I have all the f mod files on the root of my folder.
    The scripts look fine, i thought it might be because of the lines i added (putting in new music into essentials and using f mod to loop it properly) but when i removed that it still has that issue.
    When i test the music through rpg maker ex music test page it's fine, also when i removed the f mod script the repeating went away but then i'm unable to loop the new music i've imported into essentials.
    Any ideas?

    Thanks
    -Hoboayoyo
     
    Last edited by a moderator:
    Back
    Top