playAudio() -- place this Line To call the handler to Play An Audio File.
on playAudio()
set audioFile to path to resource "Sound File.aiff"
set theFile to POSIX path of audioFile
do shell script "afplay -q 1 -t 25 " & " " & quoted form of theFile
end playAudio
-- Command Line OPTIONS For Playing Audio Files
(*
afplay [option...] audio_file
Options: (may appear before or after arguments)
{-v | --volume} VOLUME
set the volume for playback of the file
{-h | --help}
print help
{ --leaks}
run leaks analysis
{-t | --time} TIME
play for TIME seconds
{-r | --rate} RATE
play at playback rate
{-q | --rQuality} QUALITY
set the quality used for rate-scaled playback (default is 0 - low quality, 1 - high quality)
{-d | --debug}
debug print output
*)
あなたは本当に何をしたいですか? – vadian
"Sound File.aiff"がアプリケーションバンドルのResourceフォルダにあると仮定すると、2行のコードが実際にサウンドを再生します。あなたは「これは本当に私が望むものではない」と言った。あなたが何を望んでいるかを言わずに! – user3439894
うーん、私はスクリプトにバンドルされた音を再生するものが必要ですが、私はあまりにも愚かです:( –