Most examples are using port 2680 for a websocket connection, or 2681 for a secure (wss://) connection. If this port is blocked by your firewall, you will not be able to open the examples.
Hello world
First hello world application.
Open Hello world in new tab
include Application.con
include RLabel.con
class HelloForm extends RForm {
HelloForm(Parent) {
super(Parent);
var labelHello = new RLabel(this);
labelHello.Caption = "Hello world!";
labelHello.Show();
}
}
class Main {
Main() {
try {
var Application=new CApplication(new HelloForm(null));
Application.Init();
Application.Run();
Application.Done();
} catch (var Exception) {
echo "Didn't catch $Exception";
}
}
}
Voice over IP example
A simple VoIP application using Opus codec.
Open Voice over IP example in new tabWebsite screenshot example
Save a webpages as a JPG image.
Open Website screenshot example in new tab
import standard.graph.wk
[...]
public do_screenshot(Sender, EventData) {
var buffer=WKImg(editAddress.Text, ["screenWidth" => "1280", "fmt" => "jpeg"]);
}
[...]
GyroGears CRM example
A CRM application generated by GyroGears. Use demo as the username and password.
Open GyroGears CRM example in new tabKitchen sink application
An example using multiple UI objects and APIs. The source code is available in the application itself.
Open Kitchen sink application in new tabLatency compensation example
An example showing how Concept Server and Concept Client deal with latency (code available in the app).
Open Latency compensation example in new tabDTMF Example
A small example illustrating the DTMFDecoder class functionality.
Open DTMF Example in new tab
include UI.con
include RAudioStream.con
include DTMFDetector.con
define APPLICATION_FORM_TYPE MainForm
class MainForm extends form1 {
var audio;
var decoder;
public function MainForm(Owner, Lang S) {
super(Owner, S);
audio = new RAudioStreamer(this);
audio.Compression = false;
audio.Channels = 1;
audio.SampleRate = 8000;
audio.OnBuffer = function(Sender, EventData) {
decoder.AddBuffer(EventData);
var b = decoder.Buttons;
if ((b) && (b != label1.Caption))
label1.Caption = b;
};
decoder=new DTMFDetector();
audio.Record();
}
}
Speech recognition
A speech recognition example, based on CMU Sphinx.
Open Speech recognition in new tab
include UI.con
include RAudioStreamer.con
import standard.lib.sphinx
define APPLICATION_FORM_TYPE MainForm
class MainForm extends form1 {
var audio_in;
var voice;
public function MainForm(Owner, Lang S) {
super(Owner, S);
var conf = VRConfInit([
"-hmm" => "./en-us/en-us",
"-lm" => "./en-us/en-us.lm.dmp",
"-dict" => "./en-us/cmudict-en-us.dict",
"-logfn" => "/dev/null"
]);
voice = VRInit(conf);
audio_in = new RAudioStreamer(this);
audio_in.SampleRate = 16000;
audio_in.Channels = 1;
audio_in.FrameSize = 640;
audio_in.Compression = false;
this.AddTimer(this.Reset, 10000);
if (voice)
VRStart(voice);
audio_in.OnBuffer = function(Sender, var EventData) {
try {
if (voice) {
VRAddBuffer(voice, EventData);
var res = VRResult(voice); // optional parameter: , var score
if ((res) && (label1.Caption != res))
label1.Caption = res;
}
} catch (var exc) {
this.Stop();
}
};
audio_in.Record();
}
Reset(Sender, EventData) {
if (voice) {
VREnd(voice);
VRStart(voice);
this.AddTimer(Reset, 10000);
}
}
}
GyroGears CRM example (with profiler)
A CRM application generated by GyroGears. Use demo as the username and password. Press the profiler button (upper right) for the profiler window.
Open GyroGears CRM example (with profiler) in new tabClient-side speech recognition (HTML5)
A client-side speech recognition example, using HTML speech and TTS. This example supports both english and romanian. Please not that not all browsers implement speech recognition and tts. It should work for sure in a recent version of Chrome and Safari.
Open Client-side speech recognition (HTML5) in new tab
include Application.con
include RForm.con
include RLabel.con
include RSpeechRecognition.con
class MyForm extends RForm {
var label;
MyForm(parent) {
super(parent);
label = new RLabel(this);
label.Font.Size = 48;
label.Caption = "Go ahead, speak (in english)\nIf you want to speak in Romanian, say \"I want to speak Romanian\"";
label.Height = 160;
label.UseMarkup = true;
label.Show();
var speech = new RSpeechRecognition(this);
speech.OnEnd = function(self, EventData) {
self.Lang = "ro-RO";
self.Start();
};
speech.OnResult = function(self, EventData) {
if (EventData[0] != "*") {
if (ToLower(trim(EventData)) == "i want to speak romanian") {
label.Caption = "Ok, vorbeste in limba romana";
self.Stop();
} else {
SendMessage("", MSG_CLIENT_QUERY, "tts", "I've heared \"$EventData\"!");
label.Caption = "I've heared " + EventData + "";
}
} else
label.Caption = ++EventData;
};
speech.Start();
}
}
class Main {
function Main() {
try {
var Application=new CApplication(new MyForm(NULL));
Application.Run();
Application.Done();
} catch (var Exception) {
echo Exception;
}
}
}