[Suggestion] About sounds

0 favourites
From the Asset Store
Grenade Sound Library contains: 135 sounds 50 grenade sounds and 85 surface sounds
  • How about Family for Sounds? It make easy setup ambiance, FX and other system sounds with easy.

    Another thing I'm missing a lot is a global volume.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • With global volume I assume you mean "master" volume? As in it affects both sounds and music?

    I actually thought about this a few days ago and came up with a solution.

    I'd have variables for "sound", "music" and "master". Sound and music goes from 0 to 100 while master goes from 0 to 1.

    Then when you set the volume for say sound you do this:

    "lerp(0,sound,master)" (you can add round(...) to the expression too if you want)

    Now the sound variable will scale according to the master variable.

  • I'm doing this way too, but it don't update the playing sounds, only new sounds.

  • But the volume not updating properly isn't what you were asking about.

    Tags is pretty much families for sounds. You can add more than one tag to a sound using '&'.

  • But the volume not updating properly isn't what you were asking about.

    Tags is pretty much families for sounds. You can add more than one tag to a sound using '&'.

    What I'm saying is that if you use, global, local or instance variables will not update the sound volume, it will only setup the volume for sounds triggered after the setup... You can call global volume as master volume, it's only a name, but the function I was asking for is that to update the sound volume of all sounds, running or not, the same for the family.

    With a specific family would be easier than setup using tags and &..&..&..&..&..&..& when you're dealing with thousand of sounds, also, easy to import or clear a sound on the list.

  • I just tested changing the volume of "sound" in my own project using the same method, and it works nicely. The sounds all played with the specified volume. I tried triggering the sounds after and before I lowered the volume. It worked as intended in both cases.

    I'd hazard a guess that it's your events that are at fault.

    I cannot see why you would need so many tags for any individual sound. At most I'd have a tag for what type of volume (sound/music) and enemy type (if I wanted to be specific).

    What are you doing that requires so many tags? And if you really need so many tags, wouldn't you just be replacing having a lot of tags with having a lot of families?

  • I jsut learned something new reading through this. Thanks InkBot, the variable idea for the sounds actually was cool. Im adding that to my game now.

  • I just tested changing the volume of "sound" in my own project using the same method, and it works nicely. The sounds all played with the specified volume. I tried triggering the sounds after and before I lowered the volume. It worked as intended in both cases.

    I'd hazard a guess that it's your events that are at fault.

    I cannot see why you would need so many tags for any individual sound. At most I'd have a tag for what type of volume (sound/music) and enemy type (if I wanted to be specific).

    What are you doing that requires so many tags? And if you really need so many tags, wouldn't you just be replacing having a lot of tags with having a lot of families?

    We are talking about different things for different purposes. Thanks anyway.

  • What do you mean by a family of sounds? I think you need to explain your idea in more detail because I can't think what you mean by that.

  • NotionGames - Cool. :)

    Ashley - Since the topic is about audio/sounds, there're two things that I'm wondering.

    First, when adding tags we can type '"music" & "title_loop"' in the Tags expression field, but when doing this I can't access either tag when trying to change the volume and such.

    Is this because we can really only have one tag for a sound, or is it a bug?

    Second, (this is kinda unrelated so little bit of thread hijack here) when looping music or switching between songs there's a notable gap when the music loops/switches.

    I'd like the loop/switch to be as seamless as possible, can this be improved somehow?

    I made a little test title screen for fun and in it I switch between one song and another, as well as loop the second song. It's all supposed to be seamless, but isn't due to the forementioned gaps. Link

  • The Audio object doesn't support multiple tags yet, it's been on my todo list a while but hopefully will come some time. FYI the expression "music" & "title_loop" is identical to "musictitle_loop" after concatenation, so will definitely be treated as a single tag.

    Whether or not audio loops seamlessly depends on the browser. I tried your example but I don't know how long I have to wait. AFAIK Chrome supports seamless loops, but Firefox and possibly other browsers don't yet.

  • The pre loop song is about 17 seconds and the looped song is 2 min and 4 seconds long.

    I mainly use Chrome and the gaps are there for me. In Firefox the gap is more noticeable than in Chrome. I also exported it with Awesomium. Awesomium switched from the first song to the second song seamlessly, but when it looped the second song there was a gap.

    Good to know that multiple tags are planned. Shoulda figured that the "&" would just put the tags together.

    Not sure if it's of any use for C2, but there's a new codec I heard about recently. It's called Opus and afaik it's built specifically for internet use in mind, and it's also been standardized.

    http://www.opus-codec.org/

  • We're watching the opus codec, but no browsers support it yet, and until *every* browser does then it will only further complicate things. We really want to avoid a third codec unless it can replace the existing two, and that is likely a couple years away. (Standardisation is very pre-emptive.)

    I've definitely had Chrome looping audio seamlessly - the rain demo loops the rain sound, which is seamless in Chrome (but not Firefox). Are you sure the audio file itself actually loops seamlessly?

  • What do you mean by a family of sounds? I think you need to explain your idea in more detail because I can't think what you mean by that.

    I was talking about make a type of Family for sounds, so, when you change any setting for that family, it affect all the sounds inside it, also, it's easy and intuitive to bring in/out any sound, instead of write manually each sound tag on the event system (preventing mistakes and misspellings).

    These last days I took to learn everything about sound in C2, reading any post and tutorial on the Scirra Community, the gap to loop a sound is the main issue. I was trying to increase the speed of a sound to simulate a engine using a single stroke sound, but give up it because of the gap issue.

    Now I'll re-do the sound events to search where is the lack making the sound volume don't update when updating the Master_Sound global variable.

  • Are you sure the audio file itself actually loops seamlessly?

    Completely, at least regarding the versions of the files that I myself have exported.

    I actually went and checked all versions of the files that I have, including the ones that C2 saves in the exported folders. I have the original files in mp3, wav, and ogg in a separate folder from where I import them to C2.

    The way I check if the files loop properly is I put them in Foobar and queue them up then listen for gaps when the file switches.

    I first checked the files that C2 produces from importing the wav version.

    When the player switches files the gap is there too. So I checked the original wav, the gap is there too.

    So I went on to check the ogg versions. They loop perfectly. No gap, no nothing. So I tried importing them directly into C2, skipping importing the wav version (losing the m4a's is not a big deal for me anyway). I tested it again in both preview and exported versions, the gap is there still. Lastly I just copied the files that I know loop perfecly directly into the media folder of the exported project. Still a gap. I also tested the exported project on my laptop, same thing there

    At first I thought it was due to how C2 re-encodes the files when you import them. But I checked the exported files from when I just imported the ogg's into C2, and they looped as intended. That the files C2 made from the imported wav didn't loop properly was half-expected, because wav has never been good with looping. I avoid using wav anywhere I can, if I can.

    Am I guessing right that when you checked my link you didn't notice any gaps?

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