This document describes how to the terminal's optional audio recorder, and how to control the recorder (or 'wave audio player') from your own application.
Note: Only a few terminals support this optional function
- see Feature Matrix : "Audio recorder") !
This feature must be unlocked (by the manufacturer, or via password) before using it permanently.
In some devices, the audio in- and output may work in 'demo mode' for a while when not unlocked.
See also:
There are several audio control settings in the device's system setup, and a few
commands to modify those settings 'on the fly' through the script language shown
below in a simplified diagram of the audio signal paths:
The "beeper" / "buzzer" shown in the upper part is a simple transducer that can only be
turned on/off via a simple transistor, but with variable frequencies and PWM duty cycles.
It is typically used to generate touchscreen "clicks", but can also be controlled via script
to generate simple warning tones. See script commands system.beep
and system.play_notes.
Because for some users of the MKT-View III, the loudness of the "beeper" was insufficient,
an optional signal path was added between the internal "beeper" and the more powerful "speaker".
Thus, depending on the "beeper to speaker" volume setting, the beeper volume may
appear to be controllable via command system.audio_vol
in fine increments, but in reality system.audio_vol only controls voltage delivered
to the audio PA (power amplifier for the internal loudspeaker).
The signal from the wave audio player always enters a digital/analog converter, before passing through
a gain control stage (controlled by system.audio_vol of the 'Speaker Volume' in the system setup).
The signal from the built-in microphone first passes another gain control stage (controlled by system.mic_vol
or "Microphone Volume" in the system setup) before it enters an analog/digital converter. The converter's output
can be sampled and recorded as a wave file (more on that later in this document), or be fed
like an 'analog input' to the Data Acquisition Unit (DAQ) for further processing.
The audio recorder control panel shows (from top to bottom, and left to right):
(screenshot of the AR control panel while recording)
The peak level indicator should be green to yellow while recording. Blue means "audio level too low", red means "audio level too high" .
The audio recorder can be opened through the terminal's system menu, but usually, you will provide an easy access to the recorder in your terminal application. For example, put a programmable button in your application to open the audio recorder (using the command audio.show(1) as explained in the next chapter).
Your application can also open the audio recorder automatically, for example after (or before) writing a CAN logfile, so the operator can save a short note about the test like "strange noise from the gearbox" . Using the same name as the CAN logfile (but a different extension) for the voice audio file makes it easy to associate the voice recording and the CAN signal recording later.
The following interpreter commands can be used to control the
audio recorder from your UPT application:
audio.show(1)
audio.show(0)
audio.play("filename.wav")
audio.play
audio.record("filename.wav")
audio.record
audio.stop
The following interpreter
functions can be used to query the status of the audio recorder
in your application:
audio.playing
audio.recording
audio.fname
audio.visible
audio.vpeak
At the time of this writing (2022), the audio recorder only supported uncompressed wave files with 8 or 16 bits per sample, monophone, and 8000, 11025, or 16000 samples per second. The file header consists of a standard "RIFF WAVE" header, including format chunk and sound data chunk, but nothing else. Only a few devices with a dedicated audio codec (hardware) support recording higher at sampling rates and/or more bits per sample.
While recording, the sampling rate is set to 11025 samples / second . A one-minute wave file will be approximately 645 KByte long . About 6 hours of "voice" can be recorded on a 256 MByte memory card. Writing or reading MP3 audio files impossible for several reasons. So don't make your recordings longer than necessary.
For replay, sampling rates can be at least 8000, 11025, or 16000 samples / second.
If an audio file shall be played from the memory card in the
terminal, it must be located in the memory card's root directory.
Alternatively (for some devices), audio files may also be saved in a special
onboard FLASH device. You can use the
File Transfer Utility to load
files into that FLASH area.
If an audio file shall be played in the simulator (i.e. for testing, in the
programming tool), the wave file must be located in the 'Audio File'
directory, which can be specified on the tool's 'Settings' tab on the panel
titled 'Directories'.
The simulator will play back recorded audio files using the default soundcard.
The installation package contains a few, small audio samples in the default 'audio' subdirectory, and a simple test application ("audio_t.cvt") which plays these samples when pressing a certain key.
Screenshot from application 'audio_t.cvt'.
Guess what/where to press to play which audio file !
File: ..?..\uptwin1\help\audio_01.htm
Author: W.Büscher, MKT Systemtechnik
Last modified: 2022-04-05 (ISO8601, YYYY-MM-DD)