Author Topic: MasmBasic  (Read 278749 times)

Siekmanski

  • Member
  • *****
  • Posts: 2170
Re: MasmBasic
« Reply #510 on: May 04, 2020, 02:12:22 AM »
Maybe you have succes with: IID_ISpObjectTokenCategory EnumTokens ?
Creative coders use backward thinking techniques as a strategy.

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 10318
  • Assembler is fun ;-)
    • MasmBasic
Re: MasmBasic
« Reply #511 on: May 04, 2020, 07:45:03 AM »
Not yet. I guess it's useless anyways because I have only one voice installed. Extra voices cost real money.

There is a demo here. Try with the text below - amazing!

There are many reasons why experienced programmers choose to write assembler code, performance issues where speed matters, the architectural freedom to lay out code in any way you like, the capacity to do things that cannot be done in many compilers but the main reason is simply because you can. Many conjure up the image of cobbling together a few DOS interrupts in unintelligible notation to prop up the shortcomings of compilers yet a modern assembler like MASM has the range of a high level language and can be written that way for high level code while retaining all of its power at the lowest level.

With the introduction of the 32 bit Windows API functions, MASM had access at the same functions that compilers had from the operating system but without the clutter and assumption of many of the compilers available. When you write Windows API code in MASM you get perfectly clear minimal precision code that leverages the full power of the Windows operating system and you get it at the code size you write, not with a pile of unwanted extras dumped into your executable by a compiler.

MASM has never been for the faint of heart, it is an uncompromised tool that has never been softened into a user friendly toy and it required the development of expertise to use correctly but for the programmer who already has experience in low level C and similar code, MASM offers power and flexibility that the best of compilers cannot deliver and contrary to popular opinion it can be developed and written at about the same development time as C code.

Siekmanski

  • Member
  • *****
  • Posts: 2170
Re: MasmBasic
« Reply #512 on: May 04, 2020, 08:40:03 AM »
I heard the text from your example.  :cool:
Copied it in the link you posted, there are some High Quality ones.

I have 2 amazingly High Quality SAPI5 Dutch female voices. (paid 200 euros for the 2 voices, today you can get 1 for 40 euros. )
Unfortunately they will only install on Windows 32bit.  :sad:
Creative coders use backward thinking techniques as a strategy.

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 10318
  • Assembler is fun ;-)
    • MasmBasic
Re: MasmBasic
« Reply #513 on: May 04, 2020, 09:15:37 AM »
I have downloaded the SDK from http://download.microsoft.com/download/B/4/3/B4314928-7B71-4336-9DE7-6FA4CF00B7B3/SpeechSDK51.exe

Mary & Mike don't work, and "Sample TTS voice" works but says most of the time "bla" (really :tongue:)

Siekmanski

  • Member
  • *****
  • Posts: 2170
Creative coders use backward thinking techniques as a strategy.

TimoVJL

  • Member
  • ****
  • Posts: 525
Re: MasmBasic
« Reply #515 on: May 05, 2020, 01:07:50 AM »
A test program for SAPI 5.x
Code: [Select]
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <sapi.h>

#pragma comment(lib, "ole32.lib")

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow)
{
ISpVoice * pVoice = NULL;
CoInitialize(NULL);
HRESULT hr = CoCreateInstance(&CLSID_SpVoice, NULL, CLSCTX_ALL, &IID_ISpVoice, (void **)&pVoice);
if (SUCCEEDED(hr))
{
hr = pVoice->lpVtbl->Speak(pVoice, L"<voice optional='Gender=Male;'>Hello world", 0, NULL);
//hr = pVoice->lpVtbl->Speak(pVoice, L"<voice required='Gender = Male;'>Hello world", 0, NULL);
//if (hr) hr = pVoice->lpVtbl->Speak(pVoice, L"<voice required='Gender = Female;'>Hello world", 0, NULL);
pVoice->lpVtbl->Release(pVoice);
pVoice = NULL;
}
CoUninitialize();
return 0;
}
« Last Edit: May 05, 2020, 04:36:45 AM by TimoVJL »
May the source be with you

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 10318
  • Assembler is fun ;-)
    • MasmBasic
Re: MasmBasic
« Reply #516 on: May 05, 2020, 07:52:09 AM »
Very interesting, Timo - I didn't know that you can specify options with XML tags:
Code: [Select]
hr = pVoice->lpVtbl->Speak(pVoice, L"<voice optional='Gender=Male;'>Hello world, I am a man", 0, NULL);
if (1)
hr = pVoice->lpVtbl->Speak(pVoice, L"<voice required='Gender=Female;'>Hello world, I am a woman", 0, NULL);
With this modification, I hear both strings spoken by the same female voice when built as X64, but only "I am a woman" when built as x86  :sad:

With MasmBasic:

Say wChr$("<voice optional='Gender=lgbt;'>Good morning")


For Gender=, everything works fine except Gender=male, which is mute :rolleyes: