Le 03/03/2013 à 17:24, Robert Poland < email@hidden> a écrit : Thanks Luther,
if I run;
set soundPath to (path to documents folder as string) & "clutter:Sounds:mantel.aiff" as alias do shell script "afplay " & soundPath & " &> /dev/null & echo $!" -- start the music
I get a console "60641" and no sound.
When we speak to shell we can't use alias but POSIX path.
(path to documents folder as string) & "clutter:Sounds:mantel.aiff" set soundPath to quoted form of POSIX path of result do shell script "afplay " & soundPath & " &> /dev/null & echo $!" -- start the music
I made tests with a stripped version :
(path to documents folder as string) & "clutter:Sounds:mantel.aiff" set soundPath to quoted form of POSIX path of result do shell script "afplay " & soundPath
afplay is supposed to be able to play any audio file that QuickTime supports (including mp3, aiff, wav, etc.).
I ran a short script to learn the available options :
do shell script "afplay -h" (* error "Usage: 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" number 1 *)
Yvan KOENIG (VALLAURIS, France) dimanche 3 mars 2013 17:44:48
|