4D plugin to record and play audio on OS X 10.6 and later.
C++ 29.32%C 58.00%Objective-C 10.75%HTML 0.32%Objective-C++ 1.61%
4d-plugin-audio's Introduction
4d-plugin-audio
4D plugin to record and play audio on OS X 10.6 and later.
###Platform
carbon
cocoa
win32
win64
###Version
###Recording
//destination must be "aif"
$path:=System folder(Desktop)+"My Recording.aif"
//the default input device (see system preferences) is used
If (0=AUDIO Is recording ) //only 1 at a time
$success:=AUDIO Begin recording ($path)
Repeat
DELAY PROCESS(Current process;10)
Until (Caps lock down)
//the path is returned
SHOW ON DISK(AUDIO End recording )
End if
###Playing
$path:=System folder(Desktop)+"My Recording.aif"
$audio:=AUDIO Open file ($path)
C_TIME($time;$duration)
$time:=AUDIO Get time ($audio) //current time
$duration:=AUDIO Get duration ($audio) //total
AUDIO SET TIME ($audio;$time) //to start from middle
//the default output device (see system preferences) is used
AUDIO PLAY ($audio)
AUDIO PAUSE ($audio)
AUDIO RESUME ($audio)
While (1=AUDIO Is playing ($audio) & Not(Caps lock down)
DELAY PROCESS(Current process;10)
End while
AUDIO STOP ($audio)
AUDIO CLOSE ($audio)