Robot audio system utilize several auditory modules, depends on control system configuration. According to this the robot.audio structure can be diefferent. Following modules can be used Player/UPlayerNextUKinect (SDK)USpeech, URecog, UMP3, UTextTool.

Main audio functions
   // run this function if you are using robot.audio.recognition or robot.audio.detector for poling data.
robot.audio.Run,
   // stop audio data poling
robot.audio.Stop;
Sound player and music player

This part of robot.audio structure utilize UPlayer module.

   // Play a sound (you can run this function in background)
   // If you are using UPlayer only PCM (wav) files can be play
robot.audio.player.Play("sound.wav"); 
   // stop the sound
robot.audio.player.Stop();
   // returns true if playing
robot.audio.player.isPlaying;

If you are enable UPlayerNext module above mentioned functions will be extended, ex. sound effects and in the robot audio structure, music player will be also available.

   // Enabling UPlayerNext as a player you can also play MP3, MP2, MP1, OGG, WAV, AIFF
   // or broadcast radio streams
robot.audio.player|musicPlayer.Play("path or URL");
   // load file or stream without playing, use Start function to play loaded file or stream
robot.audio.player|musicPlayer.Load("path or URL");
   // stop playing sound
robot.audio.player|musicPlayer.Stop();
   // stop and clear all playback sounds
robot.audio.player|musicPlayer.ClearAll();
   // pause playback a file or stream
robot.audio.player|musicPlayer.Pause();
   // starts (or resumes) playback a file or stream
robot.audio.player|musicPlayer.Start();

Additional audio players functions, that allows to control volume, tempo and reverse mode,...

   // use tempo mode, ATTENTION must be set on true before load file
robot.audio.player|musicPlayer.tempoEnable;
   // use reverse mode, ATTENTION must be set on true before load file
robot.audio.player|musicPlayer.reverseEnable;
   // playing flag, true if active
robot.audio.player|musicPlayer.isPlaying;
   // get or set current playback position
robot.audio.player|musicPlayer.position;
   // get current playback lenght
robot.audio.player|musicPlayer.lenght;
   // get or set master volume
robot.audio.player|musicPlayer.masterVolume;
   // get or set playback volume
robot.audio.player|musicPlayer.volume;
   // get VU metter value
robot.audio.player|musicPlayer.vumeter;
   // get the current CPU usage of all UPlayerNext modules
robot.audio.player|musicPlayer.cpu;
   // ATTENTION: tempoEnable or reverseEnable must be set on true before playing sound
   // use Anti-Alias Filter in tempo mode
robot.audio.player|musicPlayer.SetAntiAliasFilter(bool);
   // play sound in reverse mode (true - playing in reverse)
robot.audio.player|musicPlayer.SetReverse(bool);
   // tempo value [-95%..0..+5000%] percents
robot.audio.player|musicPlayer.tempoTempo;
   // pitch (key) [-60....0....+60] semitones
robot.audio.player|musicPlayer.tempoPitch;
   // samplerate in Hz (Internally calculated by the same percents as tempo )
robot.audio.player|musicPlayer.tempoRate;

Effects functions available with sound and music players. See UPlayerNext module documentation for more informations about effect settings and examples.

   // ATTENTION: once set effect will be added to all new playback. 
   // To remove use Remove...() functions.
   // set gain in dB [-15dB...0...+15dB], for now only three frequences 
   // 125Hz, 1kHz, 8kHz), it can be expanded in sources>
robot.audio.player|musicPlayer.SetEqualizer(Bass, Mid, Treble)
   // remove equalizer
robot.audio.player|musicPlayer.RemoveEqualizer();
   // DryMix - Dry (unaffected) signal mix [-2....+2]
   // WetMix - Wet (affected) signal mix [-2....+2]
   // Feedback - Output signal to feed back into input [-1....+1]
   // Rate - Rate of sweep in cycles persecond [0<...<10]
   // Range - Sweep range inoctaves [0<...<10]
   // Freq - Base frequency of sweep range [0<..1000]
   // add phaser effect
robot.audio.player|musicPlayer.SetPhaser(WetMix, DryMix, Feedback, Rate, Range, Freq);
   // remove phaser
robot.audio.player|musicPlayer.RemovePhaser();
   // DryMix - Dry (unaffected) signal mix [-2....+2]
   // WetMix - Wet (affected) signal mix [-2....+2]
   // Feedback - Output signal to feed back into input [-1....+1]
   // Rate - Rate of sweep in cycles per second [0<...<10]
   // Range - Sweep range in octaves [0<...<10]
   // Freq - Base frequency of sweep range [0<..1000]
   // add auto wah effect
robot.audio.player|musicPlayer.SetAutoWah(WetMix, DryMix, Feedback, Rate, Range, Freq);
   // remove auto wah
robot.audio.player|musicPlayer.RemoveAutoWah();
   // Target - Target volume level [0<....1] linear
   // Quiet - Quiet volume level [0.....1] linear
   // Rate - Amplification adjustment rate [0.....1] linear
   // Gain - Amplification level [0..1..n] linear
   // Delay - Delay in seconds before increasing level [0.....n] linear
   // add dynamic amplification effect
robot.audio.player|musicPlayer.SetDamp(Target, Quiet, Rate, Gain, Delay);
robot.audio.player|musicPlayer.RemoveDamp();
   // DryMix - Dry (unaffected) signal mix [-2....+2]
   // WetMix - Wet (affected) signal mix [-2....+2]
   // Feedback - Output signal to feed back into input [-1....+1]
   // MinSweep - Minimum delay in ms [0<..6000]
   // MaxSweep - Maximum delay in ms [0<..6000]
   // Rate - Rate in ms/s [0<..1000]
   // add chorus/flanger effect
robot.audio.player|musicPlayer.SetChorus(DryMix, WetMix, Feedback, MinSweep, MaxSweep, Rate);
robot.audio.player|musicPlayer.RemoveChorus();   
   // Drive - Distortion drive [0....5]
   // DryMix - Dry (unaffected) signal mix [-5..+5]
   // WetMix - Wet (affected) signal mix [-5..+5]
   // Feedback - Output signal to feed back into input [-1..+1]
   // Volume - Distortion volume [0...+2]
   // add distorion function
robot.audio.player|musicPlayer.SetDistortion(Drive, DryMix, WetMix, Feedback, Volume);
robot.audio.player|musicPlayer.RemoveDistortion();
   // DryMix - Dry (unaffected) signal mix [-2..+2]
   // WetMix - Wet (affected) signal mix [-2..+2]
   // Feedback - Output signal to feed back into input [-1..+1]
   // Delay - Delay in seconds [0<...n]
robot.audio.player|musicPlayer.SetEcho(DryMix, WetMix, Feedback, Delay);
robot.audio.player|musicPlayer.RemoveEcho();
   // remove all effects
robot.audio.player|musicPlayer.RemoveAllEffects();

URL slots are available only with music player part of robot audio structure

   // You can use these slots when you are playing broadcast stream
   // broadcast information about stream
robot.audio.musicPlayer.urlInfo;
   // broadcast station name (received from icy - "I Can Yell")
robot.audio.musicPlayer.urlName;
   // bitrate information about stream (received from icy)
robot.audio.musicPlayer.urlBitrate;
   // genre information about stream (received from icy)
robot.audio.musicPlayer.urlGenre;
   // information about current playing song (updatated every new song)
robot.audio.musicPlayer.urlTag;

ID3 tags are available only with music player part of robot audio structure.

   // availablity depends on the file content.
   // song title, artist name, album name, year, comment
robot.audio.musicPlayer.title;
robot.audio.musicPlayer.artist;
robot.audio.musicPlayer.album;
robot.audio.musicPlayer.year;
robot.audio.musicPlayer.comment;

BPM measure functions are also available with music player structure part only.

   // enable BPM detection
robot.audio.musicPlayer.bpmEnable
  // get current BPM
robot.audio.musicPlayer.bpmBPM
   // beat trigger getting BPM value after period of time in seconds
robot.audio.musicPlayer.bpmPosition

Recorder

 This part of robot.audio structure utilize UPlayerNext or UKinect (SDK) module.

   // start recording
   // input - number of system audio input, like PC microphone, robot microphone, 
   //        Kinect microphone array,... 
   //        This option is available only with UPlayerNext module! 
   //        If you choose UKinect this option will be ignored
   //        and as an input will be chosen Kinect microphones array.
robot.audio.recorder.Start(input, "fileName.wav");
robot.audio.recorder.Stop();

These functions below are available only with enabled UPlayerNext module as a recorder

   // set choosen input record level in percentage
robot.audio.recorder.SetLevel(input, level);
   // get choosen input record level in percentage
robot.audio.recorder.GetLevel(input);
   // list all input devices names
robot.audio.recorder.inputDevices;

Converter

Audio converter will be available if you enable UMP3 module in the robot configuration.

   // convert from PCM (wav) to MP3 recorded fileconvert function,
   // samplerate - 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000 [Hz],
   // bitrate - 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, 192, 224, 256, 320 [kbits/s].
robot.audio.converter.Convert("file_in.wav", "file_out.mp3", samplerate, bitrate); 

 Detector

This part of robot.audio structure utilize UKinect (SDK) module. 

   // get sound beam angle [-50..50]
robot.audio.detector.beamAngle;
   // get sound source angle [-50..50]
robot.audio.detector.sourceAngle;
   // get sound source detector confidence [0..1]
robot.audio.detector.sourceConfidence

Speech synthesis

These functions will be available if you enable USpeech module in the robot configuration. More informations about visem notification mechanism you can find in the USpeech module documentation. You should also choose set of available speech voices before robot startup.

   // say a string with given voice number
   // set voices in the robot configuration from all available voices in the system
robot.audio.speech.Say("Text", voice);
   // get all available voices in the system
robot.audio.speech.availableVoices();
   // returns true if speaking
robot.audio.speech.isSpeaking;
   // set speech voice from available voices, see robot configuration
robot.audio.speech.voiceNo;
   // set speech volume [0..100]
robot.audio.speech.volume;
   // set speech rate [-1-..10]
robot.audio.speech.rate;
   // set speech pitch [-10..10]
robot.audio.speech.pitch;
   // module set this flag if new viseme occur
robot.audio.speech.visemeTrig;
   // current viseme ID
robot.audio.speech.visemeId; 
   // next viseme ID
robot.audio.speech.nextVisemeId; 
   // current viseme time execution [ms]
robot.audio.speech.visemeTime; 

Speech recognition

Speech recognition part of robot audio system will be available if you enable URecog or UKinect (SDK) module in the robot configuration. Moreover some additional funtions for speech recognition appear if you enable UTextTool module. Remember that you have to also configure audio input and recognition language before system startup. For grammar creating rules read URecog documentation.

   // pause recognition engine, true - paused, false - resume
robot.audio.recognition.pause;
   // recognition result
robot.audio.recognition.result;
   // recognition result tag
robot.audio.recognition.resultTag;
   // recognition engine status flag
robot.audio.recognition.isListening;
   // get all available recognizers in the system
robot.audio.recognition.availableRecognizers;
   // get all available audio inputs available ONLY WITH URecog module
robot.audio.recognition.availableInputs;
   // add dynamicaly sentance to recognition
robot.audio.recognition.AddPhrase("rule","phrase");
   // clear all grammar rules
robot.audio.recognition.ResetGrammar();
   // load a new grammar xml file
robot.audio.recognition.LoadGrammar("filename.grxml");
   // add list of phrases to recognize and recognizer language, ex "en-US", 
   // see grammar file creating documentation
robot.audio.recognition.SetGrammar(["phrase1","phrase2",...],"lang");

 

 

EMYS and FLASH are Open Source and distributed according to the GPL v2.0 © Rev. 0.8.0, 27.04.2016

FLASH Documentation