Re: sound input level
Re: sound input level
- Subject: Re: sound input level
- From: Takaaki Naganoya <email@hidden>
- Date: Fri, 06 Feb 2004 17:19:01 +0900
On 04.1.27 5:34 AM, "roy whelden" <email@hidden> wrote:
>
Can someone tell me how to use applescript to read the current sound
>
input level? Is there some UNIX command which will do this and return a
>
value via a 'do shell script' command?
Use "ioreg" command like this.
But "set volume" command on Panther has a bug; can not set maximum volume by
"set volume 7".
--aquire audio out/in level as number
on getAudioLevel()
set prepList to {{"left_out", 3, 3}, {"right_out", 4, 3}, {"left_input",
8, 2}, {"right_input", 9, 2}}
set a to do shell script "ioreg -l | grep IOAudioControlValue"
set aList to paragraphs of a
set outList to {}
repeat with i in prepList
set itemNo to item 2 of i
set itemGet to item 3 of i
set targetData to item itemNo of aList
set tagList to characters of targetData
set wholeCount to length of tagList
if item (wholeCount - itemGet) of tagList = "=" then
set itemGet to itemGet - 1
end if
set getData to items (wholeCount - itemGet) thru wholeCount of
tagList
set getData to getData as text
set the end of outList to {item 1 of i, getData}
end repeat
return outList
end getAudioLevel
---
--
Takaaki Naganoya
Director
Newt On Division/EIG K.K.
http://eig.jp/kotodama/
ichat: email@hidden
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.