Changing the pitch/speed of music?

0 favourites
  • 5 posts
From the Asset Store
6 looping tracks to use in your games and projects. These tracks are in the style of the 1960s detective movie genre.
  • When I lower the "playback rate" of a sound, it slows it down, affecting both pitch and speed.

    When I do the same for music, however, it only affects the speed, which is unwanted in my case.

    How can I make it so that music is affected the same way as sounds are?

  • Hey Dalal,

    Two possible approaches come to mind.

    Import the music as a sound

    You can import the music into the sound folder, and play it as if it were a sound, which would cause it to behave like a sound file for playback rate purposes. This also means the music would not be streamed though, so the end user would have to wait for the song to fully download before the game would start. If the song is short that shouldn't be that much of a problem, and if your distributing to desktop it's really not a problem. This is probably worth trying at least, to see if it adds an unacceptably long wait to the loading time of the game. My guess is that it won't change the loading time very much, as long as it's not a 10 minute song.

    Multiple files for each music variation

    If the music only ever has to play at the original rate and one other rate, (e.g. for a MarioKart normal-lap vs final-lap type of situation) then you could actually save a second copy of the music at the alternate rate, and include both copies in your game, switching to the alternate as needed.

    Obviously this method is not so good if you want a smooth transition of the playback rate, or a bunch of different playback rates.

  • fisholith,

    Thanks! I think your suggestion to move them to the Sounds folder works best for me. I tried it out and it does do what I want, but I'm just a bit concerned.

    Aside from the difference in streaming, are there any other playback differences with sounds and music? I'm assuming it's just a psychological effect (i.e paranoia), but the music sounds a bit different when played as a sound. Please quell my worries and tell me I'm hearing things

  • I don't know of any differences off hand.

    When you import a sound file into Construct2, at the bottom of the import window there is an "OGG/AAC encoding quality" option box. If, this time around, you used a different setting for the quality, you might be hearing a difference from that. If so, you can delete the music files out of C2's Sound or Music folder and re import with higher quality settings. For music I usually use the max audio quality 192-kbps unless I know for a fact that it will cause a problem.

    I did a blind test, playing a song either by C2's music system or the audio system at random, and I could not hear any difference, or predict which was which at all.

    I used 192-kbps for the import quality. I wrote the song I used to do the test, so hopefully if there was going to be a difference I would have noticed. Then again, if I can't find a difference when specifically looking for one, even if there is a difference in there somewhere, it's not likely to be that noticeable.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Ah, well I simply dragged the file from the music folder to the sound folder, so no re-encoding there. The difference I heard was not a quality difference per say, it just felt as though it was stuttering, and my imagination threw together some wild ideas on how sounds are synced to the framerate, while music is not

    But listening to it today with a fresh mind, I think it's all good. Thanks for the advice and reassurance

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)