How to keep a background music or sound going continuously?

helpingtogrowhelpingtogrow Member, PRO Posts: 73

How do I keep a background music or sound going continuously?
I have one running but when a voice prompt come into play, the background
music cuts off. Would appreciate some help with this.
Thanks

Comments

  • AlchimiaStudiosAlchimiaStudios Member, PRO Posts: 1,067

    Music and sound should play separately.

    If you're only using the music behavior, that can only play one track at a time.

    The play sound behavior can play multiple and play over music as well. Try using that.

    Follow us: Twitter - Website

  • Simple Gamer ArtsSimple Gamer Arts Member Posts: 288

    would be amazing to keep the music going when scene changes, but I don't think that is possible.

  • MetalloMetallo Member, PRO Posts: 82

    @Simple Gamer Arts said:
    would be amazing to keep the music going when scene changes, but I don't think that is possible.

    What do you mean? In my game I have the same music going through the scenes no problems.

  • AlchimiaStudiosAlchimiaStudios Member, PRO Posts: 1,067

    @Metallo said:

    @Simple Gamer Arts said:
    would be amazing to keep the music going when scene changes, but I don't think that is possible.

    What do you mean? In my game I have the same music going through the scenes no problems.

    Yeah I think that's how it works by default, just don't use a pause behavior and it should keep going @Simple Gamer Arts

    Follow us: Twitter - Website

  • MetalloMetallo Member, PRO Posts: 82

    @AlchimiaStudios said:

    @Metallo said:

    @Simple Gamer Arts said:
    would be amazing to keep the music going when scene changes, but I don't think that is possible.

    What do you mean? In my game I have the same music going through the scenes no problems.

    Yeah I think that's how it works by default, just don't use a pause behavior and it should keep going @Simple Gamer Arts

    I also use a pause behaviour and the music keeps playing

  • bob loblawbob loblaw Member, PRO Posts: 517

    pretty sure music keeps playing until you play another one or you put a stop music behaviour in.

  • MetalloMetallo Member, PRO Posts: 82
    edited November 2018

    Here is a video just made of my game, the music is the one of the game, when the "settings" page appears it is a pause behaviour that recalls the scene settings....as you can notice the music keeps playing.

  • Simple Gamer ArtsSimple Gamer Arts Member Posts: 288
    edited November 2018

    What I meant was that when the scene is changed, the music restarts itself (at least that's what happens in my game). Yes, I have the "pause" as the level-selector-menu and the music is continuous there; no problem, but as soon as I touch (change) another level, music restarts.... which kind of makes sense though. cause new scene... new everything really. But, would be great to have the same song for like 10 levels straight without any disturbance.

  • Simple Gamer ArtsSimple Gamer Arts Member Posts: 288

    @Metallo will try your game out soon! looks awesome

  • MetalloMetallo Member, PRO Posts: 82
    edited November 2018

    @Simple Gamer Arts said:
    What I meant was that when the scene is changed, the music restarts itself (at least that's what happens in my game). Yes, I have the "pause" as the level-selector-menu and the music is continuous there; no problem, but as soon as I touch (change) another level, music restarts.... which kind of makes sense though. cause new scene... new everything really. But, would be great to have the same song for like 10 levels straight without any disturbance.

    This is exactly what I do in my game. In the video if you notice I go through different scenes and the music doesn’t change. The very first scene, then level menu scene and one of the levels scene. The music keeps playing throughout the game, constantly.

    Question: where did you put your playmusic behavior? In every scene?

  • MetalloMetallo Member, PRO Posts: 82

    @Simple Gamer Arts said:
    @Metallo will try your game out soon! looks awesome

    Thanks a lot:)

  • bob loblawbob loblaw Member, PRO Posts: 517

    @Simple Gamer Arts said:
    What I meant was that when the scene is changed, the music restarts itself (at least that's what happens in my game). Yes, I have the "pause" as the level-selector-menu and the music is continuous there; no problem, but as soon as I touch (change) another level, music restarts.... which kind of makes sense though. cause new scene... new everything really. But, would be great to have the same song for like 10 levels straight without any disturbance.

    have you tried the play music behaviour with 'resume current' selected from the music drop down menu?

  • Simple Gamer ArtsSimple Gamer Arts Member Posts: 288
    edited November 2018

    Hey guys @Metallo @bob loblaw , thank so much for support. I fixed it thanks to @bob loblaw tip about the "resume current" option on the PLAY MUSIC behaviour.

    @Metallo I have my PLAY MUSIC behaviour in the BackGround graphic actor, so what I did was create a "game tries attribute" which counts how many times i die or change scene; so Game Try: 1 plays the music, and from Game Try 2 and on, it resumes the music... works like a charm.

  • Simple Gamer ArtsSimple Gamer Arts Member Posts: 288

    @Metallo Yea, I totally noticed how your music plays straight through from the menu scene transitioning to the level 1 scene. It really makes such a difference this continuous play esthetic. Soon to play :)

  • MetalloMetallo Member, PRO Posts: 82

    Glad you were able to fix it :)

  • Tishara RTishara R Member, PRO Posts: 6

    hey! im trying to do the same thing where i have background music playing throughout. ive created an actor that will 'play sound' and placed it in my menu page. the only problem is that if i come back to the menu page, the music restarts AND layers over the previous one. like i want to be able to go from menu to instructions back to menu with the song playing continuously. any suggestions?

  • mikejamesfishermikejamesfisher Member, BASIC Posts: 83
    edited April 8

    You can use an attribute. For example, make an attribute Start Music. Put the “play Music” behavior inside a rule “when attribue Start Music =0, “play Music”. Just below the “play Music” behavior, change attribute Start Music to 1. You can then make another rule, when attribute start music is 1, Resume current music. Looped music should continue to play for eternity.

  • bob loblawbob loblaw Member, PRO Posts: 517

    @Tishara R said:
    hey! im trying to do the same thing where i have background music playing throughout. ive created an actor that will 'play sound' and placed it in my menu page. the only problem is that if i come back to the menu page, the music restarts AND layers over the previous one. like i want to be able to go from menu to instructions back to menu with the song playing continuously. any suggestions?

    i thought gs could only play one music source at any given time (compared to multiple sound fx).
    have you imported your music as music? and are you playing them as music, not sounds?

  • Tishara RTishara R Member, PRO Posts: 6
    edited April 10

    @bob loblaw said:

    @Tishara R said:
    hey! im trying to do the same thing where i have background music playing throughout. ive created an actor that will 'play sound' and placed it in my menu page. the only problem is that if i come back to the menu page, the music restarts AND layers over the previous one. like i want to be able to go from menu to instructions back to menu with the song playing continuously. any suggestions?

    i thought gs could only play one music source at any given time (compared to multiple sound fx).
    have you imported your music as music? and are you playing them as music, not sounds?

    so i realised that i was importing it as a sound and that was why i was running into an issue. ive imported it as music, but now its just not playing at all! :( tried the play music behaviour alone, tried it within a rule, im not sure why its not working. any idea what im missing?

  • mikejamesfishermikejamesfisher Member, BASIC Posts: 83

    Perhaps you have a change attribute music to zero behavior. Perhaps the music file didnt import correctly. Perhaps the rules have a logic problem. Does the music play when you press play in the sounds menu on bottom left?

  • bob loblawbob loblaw Member, PRO Posts: 517

    @Tishara R said:

    @bob loblaw said:

    @Tishara R said:
    hey! im trying to do the same thing where i have background music playing throughout. ive created an actor that will 'play sound' and placed it in my menu page. the only problem is that if i come back to the menu page, the music restarts AND layers over the previous one. like i want to be able to go from menu to instructions back to menu with the song playing continuously. any suggestions?

    i thought gs could only play one music source at any given time (compared to multiple sound fx).
    have you imported your music as music? and are you playing them as music, not sounds?

    so i realised that i was importing it as a sound and that was why i was running into an issue. ive imported it as music, but now its just not playing at all! :( tried the play music behaviour alone, tried it within a rule, im not sure why its not working. any idea what im missing?

    it sounds like you might have some conflicting logic in one or more of your actors, but i couldn’t say if that’s the case or where without seeing your rules and behaviours.
    my current project uses a setup like mike mentioned above, where main music plays through the intro, level select and options screens, but changes to game music in games (uses three settings to start main, continue, start game music). i’ll try slap a short demo together later if i get a chance.

Sign In or Register to comment.