AudioRecordApp lets you use the default audio recorder application to record audio. After initializing the object you should call Record to start recording. The RecordComplete event will be raised when record completes. Example: SubProcess_Globals DimaudioRecorderAsAudioRecordApp DimvideoRecorderAsVideoRecordApp EndSub
Initializes the object. EventName - Sets the subs that will handle the events. SampleRate - Sample rate in Hz. Common values: 44100, 22050 and 11025. Mono - True for mono false for stereo. Encoding - 8 for 8 bit or 16 for 16 bit. Only 16 bit is supported for now. VolumeChannel - The output channel. One of the VOLUME constants.
Similar to Initialize. Allows you to set the audio source. The values are listed here.
PlayerBufferSizeAsInt [read only]
Returns the player buffer size. This is the maximum size that can be written at once.
StartPlaying
Starts playing. You should call Write to write the PCM data while playing is in progress.
StartRecording
Starts recording. The RecordBuffer event will be raised during the record.
StopPlaying
Stops playing.
StopRecording
Stops recording.
VOLUME_ALARMAsInt
Alarms channel.
VOLUME_MUSICAsInt
Music channel.
VOLUME_NOTIFICATIONAsInt
Notifications channel.
VOLUME_RINGAsInt
Phone ring channel.
VOLUME_SYSTEMAsInt
System sounds channel.
VOLUME_VOICE_CALLAsInt
Voice calls channel.
Write (Data() AsByte) AsBoolean
Writes the data to the player queue. The array size must be smaller than PlayerBufferSize. Returns False if the internal queue is full. In that case the data was not written. Writing Null to the queue will stop the player when the message is processed and then raise the PlaybackComplete event.
Initializes the object with the given duration measured in milliseconds and the given frequency measured in Hertz. The music volume channel will be used.
Adds a segment to the queue. No more than 3 segments are allowed. SegmentNum - The segment identifier. LibNum - The index of the sound bank associated with this segment. Pass -1 if there is no sound bank. RepeatCount - Number of times the segment will be repeated. 0 means that it will be played once. Pass -1 to repeat indefinitely. Transpose - The pitch transition. Should be between -12 to 12. MuteArray - An array of booleans that sets the mute value of each track. The array length must be equal to MaxTracks value. UserId - An id given to this segment. When the current segment changes the CurrentUserIdChanged event is raised with this id (assuming that the id of the previous segment was different).
Release
Releases all resources allocated for the JetPlayer.
SetMute (MuteArray() AsBoolean, SyncAsBoolean)
Sets the tracks mute state. MuteArray - An array of booleans that sets the mute state of each track. The array length must be equal to MaxTracks value. Sync - If false the change will be applied as soon as possible, otherwise the change will be applied at the start of the next segment or next repeat.
MediaPlayerStream is similar to MediaPlayer. Unlike MediaPlayer which plays local files MediaPlayerStream plays audio streams which are available online. Another difference between the objects is that in this case the Load method is asynchronous. Only when the file is ready, the StreamReady event will be fired and you can start playing. According to the native documentation the online resource must support progressive download. Example: SubProcess_Globals DimmpAsMediaPlayerStream EndSub
SoundPool holds a collection of short sounds which can be played with low latency. Each sound has two Id values which you should work with. The first is the LoadId which is returned when loading the sound with Load. The second is the PlayId which is returned when you call Play. When working with SoundPool it is useful to watch the unfiltered LogCat for messages (for example when the sound is too long).
Initializes the SoundPool and sets the maximum number of simultaneous streams.
IsInitializedAsBoolean
Load (DirAsString, FileAsString) AsInt
Loads a sound file and returns the sound LoadId. Example: DimLoadIdAsInt LoadId = SP.Load(File.DirAssets, "sound.wav")
Pause (PlayIdAsInt)
Pauses the stream with the given PlayId.
Play (LoadIdAsInt, LeftVolumeAsFloat, RightVolumeAsFloat, PriorityAsInt, LoopAsInt, RateAsFloat) AsInt
Plays the sound with the matching LoadId and returns the PlayId. Returns 0 if there was an error. LoadId - The value returned when loading the file. LeftVolume / RightVolume - The volume value (0 - 1) Priority - A priority value which you assign to this sound. The higher the value the higher the priority. When the number of simultaneous streams is higher than the value set in Initialize the lowest priority stream will be stopped. Loop - Number of times to repeat. Pass -1 to repeat indefinitely. Rate - Playback rate (0 - 2).
Release
Releases all resources allocated to this object.
Resume (PlayIdAsInt)
Resumes the stream with the given PlayId.
SetRate (PlayIdAsInt, RateAsFloat)
Sets the rate of the stream with the given PlayId. Value is between 0 to 2.
VideoRecordApp lets you use the default video recorder application to record video. After initializing the object you should call Record to start recording. The RecordComplete event will be raised when record completes.
Calls the recording app. The RecordComplete event will be raised. Dir / FileName - Video output file. MaxLengthSeconds - Sets a flag that requests the video duration to be limited. Pass -1 for no limits. Uri - FileProvider output file URI.
VideoView is a view that allows you to play video media inside your application. The VideoView optionally shows a media controller when the user touches the view. The Completed event is raised when playback is completed. Simple example of using VideoView: SubGlobals DimvvAsVideoView EndSub SubActivity_Create(FirstTimeAsBoolean)
vv.Initialize("vv")
Activity.AddView(vv, 10dip, 10dip, 250dip, 250dip)
vv.LoadVideo(File.DirRootExternal, "somefile.mp4")
vv.Play EndSub Subvv_Complete Log("Playing completed")
EndSub This is an 'Activity Object', it cannot be declared under Sub Process_Globals.
Loads a video file and prepares it for playing. It is not possible to load files from the assets folder. Advanced: you can pass "http" to the Dir parameter and then a full URL (including http) to the FileName. In this case the online video will be streamed. Note that you need to add the INTERNET permission for this to work.
MediaControllerEnabledAsBoolean [write only]
Sets whether the media controller is enabled. It is enabled by default. Note that the media player gets attached to the VideoView parent.
Padding() AsInt
ParentAsObject [read only]
Pause
Pauses the playback.
Play
Starts or resumes playing.
PositionAsInt
Gets or sets the playing position (in milliseconds).