An application to control volume?

Discussion in 'Mac Apps and Mac App Store' started by TigerPRO, Mar 18, 2004.

  1. TigerPRO macrumors 6502

    Joined:
    Mar 27, 2003
    Location:
    Wisconsin
    #1
    If anyone has heard of any application, script, or plugin that can fade out the volume of my computer at a specified moment for specified duration, could you let me know? I'm running some should effects on our PowerBook, and I'm playing them as AIFFs in Quicktime. I need to have a way of automatically and smoothly fading the volume down. Seems like simple task, but I haven't been able to find anything like it. I know I can manually drag the volume slider, but that's cumbersome and inaccurate. I need a worry-free way of doing this. Have any of you come across something I could use? Thanks.
     
  2. bousozoku Moderator emeritus

    Joined:
    Jun 25, 2002
    Location:
    Gone but not forgotten.
    #2
    I'm definitely not certain what you want, but I wrote the follwing AppleScript:

    Code:
    repeat with volumeLevel from 7 to 0 by -1
    	set volume volumeLevel
    end repeat
    repeat with volumeLevel from 0 to 7 by 1
    	set volume volumeLevel
    end repeat
    
     
  3. TigerPRO thread starter macrumors 6502

    Joined:
    Mar 27, 2003
    Location:
    Wisconsin
    #3
    Thanks! This almost exactly what I need. I was thinking AppleScript could do the job, but I don't know how to program in it YET.

    How would that code look if you wanted it to fade from the CURRENT volume. Is there a way to set the fade out from where the volume is currently set? I noticed that it jumps up to 7 before going down. And finally, is there any way to put a time delay between each volume level decrease, so it doesn't go down as fast?
     
  4. bousozoku Moderator emeritus

    Joined:
    Jun 25, 2002
    Location:
    Gone but not forgotten.
    #4
    I'm sure there is some way to get the current volume. I can't find any reference to it, though.

    To slow the change in volume, add

    delay x

    to a separate line prior to the line with set volume, where x is the number of seconds to wait.
     
  5. TigerPRO thread starter macrumors 6502

    Joined:
    Mar 27, 2003
    Location:
    Wisconsin
    #5
    Great, it's working perfectly now. But I think I'll have to search for a different solution. Because you can hear the volume steps very predominately. So the fade it not smooth at all. But it can't be helped when you only have a scale from 1 to 7. Oh well. Thanks for your help though.
     
  6. HexMonkey Administrator

    HexMonkey

    Staff Member

    Joined:
    Feb 5, 2004
    Location:
    New Zealand
    #6
    Since you're playing them in Quicktime, use this code. The advantage to this is that it has a scale of 0 to 256, much more accurate than the 0 to 7 scale of the system sound.

    Code:
    tell application "QuickTime Player"
    	set delayTime to 0
    	set soundChangeAmount to 1
    	
    	set currVolume to sound volume of front movie
    	repeat with volumeLevel from currVolume to 0 by -soundChangeAmount
    		set sound volume of front movie to volumeLevel
    		delay delayTime
    	end repeat
    end tell
    Change delayTime and soundChangeAmount as appropriate. This script applies to the front player, but can be modifed for others. Eg, if you have multiple sounds playing at the same volume that you want to fade out, you can change 'set sound volume of front movie to volumeLevel' to 'set sound volume of every movie to volumeLevel'. If you want to change to volume of a player with a specific name, change both occurances of 'front movie' to 'movie "[Sound name]"'.
     
  7. TigerPRO thread starter macrumors 6502

    Joined:
    Mar 27, 2003
    Location:
    Wisconsin
    #7
    Beautiful! Thank you very much, this will do the trick perfectly!
     

Share This Page