Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Two questions on audio

edited November 2016 in Help! with 2.0
Using sugarcube 2.11.0

Firstly, I'm trying to get the volume of my ambient 'outside' noise in my game to very quiet (0.1) when the player climbs in a car, but it's not working. Here's the code:
\ <<if $hasGas and $hasPlug>>[[Two wires|village]]<<audio "out_side" volume 0.1>><<audio "car_start" volume 100 fadeoverto 8 0.0>><<timed 8s>><</timed>><</link>> hang from the broken plastic under the steering wheel.<<set $searchedCar to true>>
Secondly, to cut down on file size my audio clips are fairly short (the outside noise is about 10 seconds long and on a loop). Is there anyway to prevent the sudden 'off/on' noise you hear when changing rooms or when the track ends and begins its next loop?

Comments

  • edited November 2016
    NB: I was mistaken when I said the audio begins a new loop with each new passage. It doesn't, but I would like to stop the 'clip break' between the loop ending and starting.
  • If you can find no other fix, you might be able to mask it by fading in and out.
  • edited November 2016
    Yes, I did consider this, but thought it might highlight even more the fact that the clip is looped.

    I suppose it has to be better than the little 'pop' noise that's heard during the transition. I'll give it a try.

    No, that only accentuates the transition as I feared. I don't think this can be done, as the looping is being controlled by Twine. I can do a seamless loop in Audacity using crossfade, but that won't help here.
  • Three things I noticed about your example:

    1. The "car_start" audio macro has a volume of 100 but the documentation lists the possible range of 0 -> 1

    2. Your timed macro has no contents.

    3. You have a <</link>> without a corresponding <<link>>, this would cause the code to be invalid.

  • edited November 2016
    1. So 1.0 is max and the increments are 0.0, 0.1, 0.2, 0.3 and so on?

    2. The timed macro is there because I don't want the next passage to kick in immediately, because there's a short audio clip of a car pulling away which wouldn't make sense if it played while the next passage description was displayed. Should the entire code be enclosed in the timed macro or something, because as I say it works as desired.

    3. The closing link is an error I hadn't noticed until now. It's left over from when I was using a link to move the player, before I'd learned of the location method.

    Oddly the passage works as desired and throws up no errors.

    [edit] Okay, I've fixed the issue on the volume for the 'outside' audio not lowering as the player climbs in the car. Turns out I did need to be using <<link>> instead of text\link afterall.

    This is what I have now and it all works perfectly::
    \ <<if $hasGas and $hasPlug>><<link "Two wires">><<audio "out_side" volume 0.1>><<audio "car_start" volume 1.0 fadeoverto 8 0.0>><<timed 8s>><<goto "village">><</timed>><</link>> hang from the broken plastic under the steering wheel.
    
  • Jud_Casper wrote: »
    1. So 1.0 is max and the increments are 0.0, 0.1, 0.2, 0.3 and so on?
    The volume value is a floating point number in the range 01, where 0 is no volume and 1 is full volume. In other words, its minimum is 0.0, which you may simplify to 0, its maximum is 1.0, which you may simplify to 1, and any value between those two is fair game—e.g. 0.1, 0.2, 0.25, 0.3, 0.5, 0.75, 0.8, etc.
Sign In or Register to comment.