Re: Play sounds via script
Re: Play sounds via script
- Subject: Re: Play sounds via script
- From: Robert Poland <email@hidden>
- Date: Sun, 03 Mar 2013 17:04:56 -0700
Chris,
Below is the latest version.
My purpose for the -v option is for the mantel.aiff to sound the hour at a constant level regardless of the system sound level. Appears that it is not a linear function.
set middleVolume to 40 -- nominal 27" iMac setting
set mantelSound to alias ((path to documents folder as text) & "clutter:Sounds:mantel.aiff")
set mantelSound to quoted form of POSIX path of mantelSound
set nominalValue to middleVolume
tell (get volume settings)
-- set {outputVolume, b, c, d} to {output volume, input volume, alert volume, output muted}
set outputVolume to {output volume}
end tell --> {40, 50, 100, false}
set outputVolume to outputVolume as integer
set scaleValue to nominalValue / outputVolume -- percent of current output of nominal level
# the "-v" option scales the current ouput level
set cmd to "afplay -v " & scaleValue & " " & mantelSound
do shell script cmd
On Mar 3, 2013, at 3:11 PM, Christopher Stone <email@hidden> wrote:
> On Mar 03, 2013, at 12:26, Luther Fuller <email@hidden> wrote:
>> Yes, there is a -v option, but …… it does not work.
>>
>> Seems that this option still does not work. @#$%!
> ______________________________________________________________________
>
> It works fine here.
>
> afplay -v 0.1 ~/"Documents/Library Storage/Sound Library/Sounds from the Internet/all_systems_functioning.wav"
>
> afplay -v 100 ~/"Documents/Library Storage/Sound Library/Sounds from the Internet/all_systems_functioning.wav"
>
> --
> Best Regards,
> Chris
Robert Poland - Fort Collins, CO
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden