By Simon Franglen @Simon_Franglen
Can you play sounds through Soundflow - through the Mac OS when on the screen or via the tablet if on a surface. We want haptic response etc…
Linked from:
- Christian Scheuer @chrscheuer2021-05-19 21:31:13.294Z
Yea I believe you can use afplay. @JesperA you do this right?
Jesper Ankarfeldt @JesperA2021-05-21 08:03:43.396Z
Correct. afplay works great for a lot of things. But in this case @Simon_Franglen
osascript -e "beep"
might be better.In script:
sf.system.exec({ commandLine: "osascript -e 'beep'", }); sf.system.exec({ commandLine: "afplay /System/Library/Sounds/Funk.aiff", });
Andrew Scheps @Andrew_Scheps
FWIW for some reason
osascript
doesn't work from SoundFlow in Ventura...afplay
with a path does.Maybe a Security thing
- SIn reply toSimon_Franglen⬆:Simon Franglen @Simon_Franglen
BTW - Found this on afplay commands:
https://ss64.com/osx/afplay.html
afplay Audio File Play. Syntax afplay [option...] audio_file Options: (may appear before or after arguments) -v VOLUME --volume VOLUME Set the volume for playback of the file Apple does not define a value range for this, but it appears to accept 0=silent, 1=normal (default) and then up to 255=Very loud. The scale is logarithmic and in addition to (not a replacement for) other volume control(s). -h --help Print help. --leaks Run leaks analysis. -t TIME --time TIME Play for TIME seconds >0 and < duration of audio_file. -r RATE --rate RATE Play at playback RATE. practical limits are about 0.4 (slower) to 3.0 (faster). -q QUALITY --rQuality QUALITY Set the quality used for rate-scaled playback (default is 0 - low quality, 1 - high quality). -d --debug Debug print output. Play can be cancelled with Ctrl-C Examples Play music.wav for 5 seconds: $ afplay music.wav -t 5 Play jolene.mp3: $ afplay jolene.mp3 Play jolene.mp3 at half speed: $ afplay jolene.mp3 -r 0.5
Christian Scheuer @chrscheuer2021-05-21 11:33:03.634Z
Nice, thanks for sharing!