and again dll and market - page 7

 
Maxim Kuznetsov:

You type "text to speech" into a search engine and the first links lead to these services and Rest-API.

You will understand the protocols, but WebRequest and JSon will tell you about them as problems arise.

After a long search I found a free but limited service with 10,000 characters per month and, lo and behold, it makes a wav file that the terminal is supposed to play. But it plays Alerts.

I'm pulling a WAV file from it with a curl command.

curl -X POST -u "apikey:GR1bb3zVMs9fcNKL6pA9-5zads3j9ptWliCu6eh9oupUnpZB9pt" ^
--header "Content-Type: application/json" ^
--header "Accept: audio/wav" ^
--data "{\"text\":\"hello world\"}" ^
--output hello_world.wav ^
"https://api.eu-gb.text-to-speech.watson.cloud.ibm.com/instances/9886a3ce-5734-455f-8f78-7a56381da86/v1/synthesize"

Now I can't figure out how to convert this syntax to the WebRequest format

 
Artyom Trishkin:

Are you aware of the resource rules about double accounts?

I don't, but of course I'm prepared to abide by the rules and will sacrifice another account in favour of the one I'm writing from.

How do I do that?

 

\Sounds\

There's so many commands and melodies and sounds you can cram into that folder that you'll get tired of listening to.

Snapshotmusic

record the command, edit the file.

like here or there's a lot of software

Snapshot envelope

//+------------------------------------------------------------------+
//|                                                       Sounds.mq5 |
//|                        Copyright 2020, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2020, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//---
   PlaySound("alert.wav");
   Sleep(1*1000);
   PlaySound("request.wav");
   Sleep(1*1000);
   PlaySound("email.wav");
  }
//+------------------------------------------------------------------+
 
Nikolai Karetnikov:

after a long search, I found a free but limited service with 10,000 characters per month and, oh, my goodness, it makes a wav file which the terminal is supposed to play. But it plays Alerts.

I'm pulling a WAV file from it with a curl command.

Now I can't figure out how to bring this syntax to the format WebRequest

It'll play any song, you just have to put a file in it.

Here's the script. I'm embarrassed to show you how complicated it is.

Files:
Sounds.mq5  1 kb
 
Alexsandr San:

It plays any song, you just have to put a file in it.

Here's the script. I'm embarrassed to show you how complicated it is.

That's expert level programming! )

The trick is that conversion from mp3 to wav will take time, even if the conversion itself could be initiated without using DLL (we, as experts, try to take all factors into account) ))))

But again, Watson from IBM offers to download wav files at once and that's fine. Just have to figure out howthe curl command format

curl -X POST -u "apikey:GR1bb3zVMs9fcNKL6pA9-5zads3j9ptWliCu6eh9oupUnpZB9pt" ^
--header "Content-Type: application/json" ^
--header "Accept: audio/wav" ^
--data "{\"text\":\"hello world\"}" ^
--output hello_world.wav ^
"https://api.eu-gb.text-to-speech.watson.cloud.ibm.com/instances/9886a3ce-5734-455f-8f78-7a56381da86/v1/synthesize"

bring it into WebRequest format.

This is where a script would really help ;)

Документация по MQL5: Сетевые функции / WebRequest
Документация по MQL5: Сетевые функции / WebRequest
  • www.mql5.com
Для использования функции WebRequest() следует добавить адреса серверов в список разрешенных URL во вкладке "Советники" окна "Настройки". Порт сервера выбирается автоматически на основе указанного протокола - 80 для "http://" и 443 для "https://". Функция WebRequest() является синхронной, это означает, что она приостанавливает выполнение...
 
Nikolai Karetnikov:

Now that's expert level programming! )

The trick is that conversion from mp3 to wav will take time, even if the conversion itself could be initiated without using DLL (we, as experts, try to take all factors into account) )))).

But again, Watson from IBM offers to download wav files at once and that's fine. Just have to figure out howthe curl command format

bring it into WebRequest format.

That's where the script would really help ;)

Do you receive voice messages from this address or what?

Snapshotreg

 

it gives out an error

Snapshot2

Photo by

--------------------------------

I think I need to enter my username and password !

Files:
 
Alexsandr San:

error


key expired, apparently.

The attached .bat file will work correctly



If anything, the ^ sign is only needed in the DOS window to correctly assemble the file lines into a single line sent to the server


Files:
voice.bat.txt  1 kb
 
Nikolai Karetnikov:

the key has apparently expired.

The attached .bat file will work correctly



If anything, the ^ sign is only needed in the dos window to correctly assemble the file lines into a single line sent to the server


Yes! Got the file.

here's

Snapshot3

------------------------------------

but the same way you can get a virus!?

Files:
hello_world.zip  34 kb
 

I've made a point of not using .dlls orWebRequest

After checking it out, restored the operating system in 10 minutes

with this program.

Snapshot.PNG

Reason: