News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

MasmBasic

Started by jj2007, May 23, 2012, 10:16:07 PM

Previous topic - Next topic

Siekmanski

Couldn't read MasmBasic.inc ( I haven't installed MasmBasic )
Creative coders use backward thinking techniques as a strategy.

Siekmanski

I had a plan ( never came so far to try it ) to write something with SAPI to copy speech to memory as a wav file.
I'm not sure anymore, think it should be possible with SAPI...
Creative coders use backward thinking techniques as a strategy.

TimoVJL

https://docs.microsoft.com/en-us/previous-versions/windows/desktop/ms719484(v%3Dvs.85)
https://docs.microsoft.com/en-us/previous-versions/windows/desktop/ms722562(v%3Dvs.85)
https://stackoverflow.com/questions/20498004/how-to-save-sapi-text-to-speech-to-an-audio-file-in-vbscript
May the source be with you

Siekmanski

Quote from: TimoVJL on May 03, 2020, 05:24:05 PM
https://docs.microsoft.com/en-us/previous-versions/windows/desktop/ms719484(v%3Dvs.85)
https://docs.microsoft.com/en-us/previous-versions/windows/desktop/ms722562(v%3Dvs.85)
https://stackoverflow.com/questions/20498004/how-to-save-sapi-text-to-speech-to-an-audio-file-in-vbscript

Thanks!  :thumbsup:
Creative coders use backward thinking techniques as a strategy.

jj2007

Quote from: jj2007 on May 02, 2020, 09:29:58 PMObviously, you need the last MB installation to extract the macro from the inc file, otherwise Extract$(..) will only return a question mark.
Quote from: Siekmanski on May 02, 2020, 11:01:00 PM
Couldn't read MasmBasic.inc ( I haven't installed MasmBasic )

No problem, Marinus - you just wanted to demonstrate that you would never, ever install MasmBasic. That's fine for me :tongue:

Has anybody at least tried to use SpCreateBestObject?

Siekmanski

 :tongue:
What SAPI 5 version do you have?
I have 5.1.
I could find SpCreateBestObject in the Help file but not in the includes. ( could be I'm missing some files )
Is it a helper function from a lib?
I can't remember if there was also a lib included in the SAPI5.1 SDK.
Why not enumerate all the voices yourself and pick the one you want to use, or is there more to the SpCreateBestObject?
Creative coders use backward thinking techniques as a strategy.

jj2007

I have 5.3, which should have it: https://docs.microsoft.com/en-us/previous-versions/windows/desktop/ms717500(v%3Dvs.85)

invoke LoadLibrary, Chr$("C:\Windows\System32\Speech\Common\sapi.dll")
fdeb 4, "LL", eax
.if eax
push eax
invoke GetProcAddress, eax, Chr$("SpCreateBestObject")
fdeb 4, "GPA", eax
call FreeLibrary
Inkey
Exit
.endif


NOT FOUND.

Siekmanski

Just had a look in the Windows v7.1 SDK,
There I found the sapi.lib and the sapi51 and sapi53 includes, no SpCreateBestObject ( also not in the sapi.lib )  :sad:
Creative coders use backward thinking techniques as a strategy.

jj2007

C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include\sphelper.h
template<class T>
HRESULT SpCreateBestObject(
    const WCHAR * pszCategoryId,
    const WCHAR * pszReqAttribs,
    const WCHAR * pszOptAttribs,
    T ** ppObject,
    IUnknown * pUnkOuter = NULL,
    DWORD dwClsCtxt = CLSCTX_ALL)
{
    HRESULT hr;

Siekmanski

Looks like a function.
Do you have the Sapi5.3 SDK installed? Maybe there is a lib....
Creative coders use backward thinking techniques as a strategy.

jj2007

I have over 3GB of Visual Studio 14.0 hanging around in C:\Program Files (x86)\Microsoft Visual Studio 14.0 - no SpHelper found in 7789 folders, but 224 lib files. None of them has SpCreate*

I wonder if it's Windows CE only: https://docs.microsoft.com/en-us/previous-versions/ms937518(v%3Dmsdn.10)

https://docs.microsoft.com/en-us/previous-versions/windows/desktop/ms717321(v%3Dvs.85)
QuoteMicrosoft Speech API 5.3

Helper Functions
Helper functions are available as a convenience to programming. Since many of the procedures use the same few methods or calls in the same sequence each time, these functions are available to consolidate those standard sequences. In all cases, the functions represent nothing more than the individual steps combined into one call; no additional features have been added or removed. Programmers are free to either use these functions or include the original lines of code. The function name attempts to clearly identify the purpose of the function itself.

The following helper functions are used with SAPI 5.

Token Helpers
SpCreateBestObject
SpCreateDefaultObjectFromCategoryId
SpCreateNewToken (by category ID)
SpCreateNewToken (by token ID)
SpCreateNewTokenEx (by category ID)
SpCreateNewTokenEx (by token ID)
SpCreateObjectFromSubToken
SpCreateObjectFromToken
SpCreateObjectFromTokenId
SpCreatePhoneConverter
SpEnumTokens
SpFindBestToken
SpGetCategoryFromId
SpGetDefaultTokenFromCategoryId
SpGetDefaultTokenIdFromCategoryId
SpGetDescription
SpGetSubTokenFromToken
SpGetTokenFromId
SpGetUserDefaultUILanguage
SpSetCommonTokenData
SpSetDefaultTokenForCategoryId
SpSetDefaultTokenIdForCategoryId
SpSetDescription

Siekmanski

I have searched on my computer, found nothing.
Creative coders use backward thinking techniques as a strategy.

Siekmanski

Maybe you have succes with: IID_ISpObjectTokenCategory EnumTokens ?
Creative coders use backward thinking techniques as a strategy.

jj2007

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

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.