This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
built_in:audiorecorder [2015/01/07 09:33] octazid [Methods] |
built_in:audiorecorder [2018/05/21 07:56] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== AudioRecorder control ====== | ====== AudioRecorder control ====== | ||
- | ===== Create | + | The AudioRecorder object can be used to listen for sound and record it to a file. |
+ | ==== Create ==== | ||
Create an AudioRecorder object using the CreateAudioRecorder function of the app object: | Create an AudioRecorder object using the CreateAudioRecorder function of the app object: | ||
< | < | ||
You can use the SetFile function of the AudioRecorder object to set the file to save recorded audio. | You can use the SetFile function of the AudioRecorder object to set the file to save recorded audio. | ||
+ | < | ||
- | ===== Methods | + | The Start method tells it to start recording: |
+ | < | ||
+ | |||
+ | And the Stop method is for when you have finished recording: | ||
+ | < | ||
+ | |||
+ | |||
+ | |||
+ | ==== Methods ==== | ||
Some controls use the same methods.\\ | Some controls use the same methods.\\ | ||
For examples of the **[[same methods]]** look here. | For examples of the **[[same methods]]** look here. | ||
- | ^Method ^Description ^ | + | ^ Method |
- | |AudioRecorder.Destroy() | | | + | | AudioRecorder.GetRMS() |
- | |AudioRecorder.GetAbsHeight() | | | + | | AudioRecorder.GetType() |
- | |AudioRecorder.GetAbsWidth() | | | + | | AudioRecorder.Pause() |
- | |AudioRecorder.GetHeight() | | | + | | AudioRecorder.SetFile( p1 ) | Use the SetFile method to tell the object where to store the sound |
- | |AudioRecorder.GetPosition() | | | + | | AudioRecorder.Start( p1 ) | The Start method tells it to start recording |
- | |AudioRecorder.GetRMS() | | | + | | AudioRecorder.Stop() |
- | |AudioRecorder.GetType() | | | + | |
- | |AudioRecorder.GetVisibility() | | | + | ==== Example ==== |
- | |AudioRecorder.GetWidth() | | | + | <code javascript> |
- | |AudioRecorder.Pause() | | | + | function OnStart() |
- | |AudioRecorder.Release() | | | + | { |
- | |AudioRecorder.SetBackColor( p1 ) | | | + | rec = app.CreateAudioRecorder(); |
- | |AudioRecorder.SetBackGradient( p1, | + | rec.SetFile( "/ |
- | |AudioRecorder.SetBackGradientRadial( p1, | + | rec.Start(); |
- | |AudioRecorder.SetBackground( p1,p2 ) | | | + | app.ShowPopup(" |
- | |AudioRecorder.SetFile( p1 ) | | | + | |
- | |AudioRecorder.SetMargins( left, | + | } |
- | |AudioRecorder.SetPadding( p1, | + | |
- | |AudioRecorder.SetPosition( p1,p2,p3,p4 ) | | | + | |
- | |AudioRecorder.SetScale( x,y ) | | | + | |
- | |AudioRecorder.SetSize( p1,p2 ) | | | + | |
- | |AudioRecorder.SetVisibility( p1 ) | | | + | |
- | |AudioRecorder.Start( p1 ) | | | + | |
- | |AudioRecorder.Stop() | | | + | |
+ | function stopit() | ||
+ | { | ||
+ | app.ShowPopup(" | ||
+ | rec.Stop(); | ||
+ | } | ||
+ | </ |