FAB - TELETEXT & SUBTITLING SYSTEMS

↑↑Support Pages for FAB Products↑FAB Subtitler LIVE

Interfacing with the speech interface

The speech interface which is integrated in FAB Subtitler LIVE was initially designed to work correctly with Dragon NaturallySpeaking speech recognition software. Other speech recognition programs may also work correctly with FAB Subtitler LIVE as long as they support dictating directly into any Windows application and they send the recognized text using the Windows message EM_REPLACESEL.

When the speech recognition software does not send the text using the message EM_REPLACESEL then dictating into the speech interface will probably still work. The only functionality that will probably not work correctly is always appending the recognized text at the end. This is a functionality that can be enabled in options for the speech interface.

Technical details

The speech recognition software send the recognized text to the speech Interface in FAB Subtitler LIVE by sending window messages which are then handled by the Subtitler's editor window. The speech recognition software usually obtains the currently focused edit window to which it sends messages with the recognized text. The speech interface's edit window class is 'Edit_' and is the same as the standard windows control class Edit for the Edit Control. The speech recognition software should send the text using the EM_REPLACESEL window message.

When the speech recognition software works as described above this will enable text editing in the FAB speech interface while the recognized text is always appended at the end of the text. If the speech recognition software sends the recognized text in any other way and does not use the EM_REPLACESEL message, then the recognized text will probably be inserted at the cursor position.

Example of the code sending the text to the FAB Subtitler LIVE speech interface:

  // find the editor control
  editWnd := GetFocus;
  if editWnd = 0 then
  begin
    editWnd := GetForegroundWindow;
    if editWnd <> 0 then
    begin
      threadId := GetWindowThreadProcessId(editWnd, processId);
      if AttachThreadInput(GetCurrentThreadId, threadId, True) then
      begin
        editWnd := GetFocus;
        AttachThreadInput(GetCurrentThreadId, threadId, False);
      end;
    end;
  end;
  
  // check if it's an Edit control
  GetClassName(editWnd, wndClass);
  isEdit := (wndClass = 'Edit_') or (wndClass = 'Edit');
  
  // send the message with text
  if isEdit then
  begin
    SendMessage(editWnd, EM_REPLACESEL, 0, PWideChar('Hello.'));
    SendMessage(editWnd, EM_REPLACESEL, 0, PWideChar(' How are you doing?'));
  end
  else
  begin
    // alternate method of sending text eg. WM_CHAR for sending each character at a time 
  end;

Special commands

The text received by the speech interface can contain special commands.

COMMAND Description
{SEND} Transmits all the text that was received previously
{NL} Adds a line break
{1} Changes the text color for the following text to color 1
{2} Changes the text color for the following text to color 2
{3} Changes the text color for the following text to color 3
{4} Changes the text color for the following text to color 4
{5} Changes the text color for the following text to color 5
{6} Changes the text color for the following text to color 6
{7} Changes the text color for the following text to color 7
{8} Changes the text color for the following text to color 8
Home | The Company | Teletext | Subtitling | Support | Download | Where to buy
Copyright © F.A. Bernhardt GmbH