• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: afplay
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: afplay


  • Subject: Re: afplay
  • From: KOENIG Yvan <email@hidden>
  • Date: Fri, 03 Jun 2011 12:22:47 +0200

It's true but the afplay help doesn't define the range to use for the parameter "volume".
Luther assumed that it was a floating in the range 0…1
but it appears that it's an integer in the range 0…255

Yvan KOENIG (VALLAURIS, France) vendredi 3 juin 2011 12:22:19


Le 3 juin 2011 à 12:12, Bart Bunting a écrit :

>
> Hi,
>
>> From the NSSound docs it appears that the volume is a float between 0
> and 1.
>
> This works for me, as in -v 0 is silent, -v 1.0 is loud and -v 0.5 is in
> between.
>
> HTH
>
> Bart
>
>
>
> On Fri, 03 Jun 2011 05:00:33 -0400, "S. J. Cunningham" <email@hidden> wrote:
>>
>> On Jun 2, 2011, at 4:23 PM, Luther Fuller wrote:
>>
>>> I'm using this in a script ...
>>>
>>> 	set sndpid to do shell script "afplay -v 0.4 " & sndPath & " &> /dev/null & echo $!"
>>>
>>> Notice the number '0.4' after the '-v'. This number is supposed to set the playback volume. (At least, that's what the -help reveals.) However, changing the value of this number does absolutely nothing at all.
>>>
>>> Does anyone have any experience with afplay?
>>> And what's the problem with '-v'?
>>
>> I don't have experience with afplay but I have a script to play an mp3 file every morning using quicktime that takes _two_ volume settings to work, viz:
>>
>> ...
>> property sysVolMax : 100
>> property qtVolMax : 256
>> -- Set System Volume to Max
>> set saveSysVol to output volume of (get volume settings)
>> set volume output volume sysVolMax
>> ...
>> tell application "QuickTime Player 7"
>> ...
>> 	set sound volume of document 1 to qtVolMax
>> ...
>> end tell
>>
>> Notice that the max system volume is 100 while the max QT volume is 256.  I wrote this script some time ago, so I don't remember the details of how I figured out the volume settings or why  I had to set both but I remember it was a pain.  Never the less it works and wakes me up every morning :-)
>>
>> Hope that helps. _______________________________________________
>> 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
> _______________________________________________
> 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
>


 _______________________________________________
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

References: 
 >afplay (From: Luther Fuller <email@hidden>)
 >Re: afplay (From: "S. J. Cunningham" <email@hidden>)
 >Re: afplay (From: Bart Bunting <email@hidden>)

  • Prev by Date: Re: afplay
  • Next by Date: Re: afplay
  • Previous by thread: Re: afplay
  • Next by thread: Talking to apps running under different users' accounts on same machine?
  • Index(es):
    • Date
    • Thread