it is not possible to play a wav file from a sandbox without a DLL?
from help
For example, if audio file Demo.wav is located in terminal_data_directory\MQL5\Files folder, then PlaySound() call should be written in this way:
//--- play sound file Demo.wav from terminal_data_directory\MQL5\Files\ PlaySound("\\\Files\\\Demo.wav");
The problem is that the playsound engine itself is flawed. it doesn't combine the sounds, but stops playing the previous one as soon as a new command arrives.
There is a requirement in the market that the product should work out of the box and not depend on third party modules. but it is possible to make a radical move - to make a box solution on playsound crutch and if you have some module, for example, posted in kodobase, use a normal solution through the win engine. which I understand can also do text recognition.
I understandinstance_id is GR1bb3zVMs9fcNKL6pA9-5zj9ptWliCu6eh9oupUnpZB
While I'm reading the doc...
What exactly is your query failing? There are good examples in the documentation.
I don't have time now, and it's useless thing.
Regarding your link - if you can not use WebSocket - better not to use, you will save a lot of time (if you have no experience with it). There are other options out there besides WebSocket.
For example, if Demo.wav sound file is located in terminal_data_directory\MQL5\Files folder, PlaySound() call should be written in this way:
//--- play sound file Demo.wav from terminal_data_directory\MQL5\Files\ PlaySound("\\\Files\\\Demo.wav");
The problem is that the playsound engine itself is flawed. it doesn't combine the sounds, but stops playing the previous one as soon as a new command arrives.
the market requires that the product should work out of the box and not depend on third party modules. but it is possible to make a radical move and make a box solution on playsound crutch and if you have some module, for example in kodobase, use a normal solution through the wind engine. which I understand can do text recognition too.
that's my point exactly! )
Yes, 2 ways.
The 1st way is PlaySound and pauses based on pronunciation speed. But I encountered this and at the stage of calling the native Windows TTS features, when the second phrase gets into a busy stream, we get a runtime error. Therefore, there is a delay in the class based on the pronunciation speed of 100 characters per minute. In principle, we get out of this situation.
Method 2 - Generate test file by closed code and play it back by open code with enabled DLLs
Why write something unnecessarily in the folder? PlaySound can play from resources, see "Using Resources" in the link
P.S. I haven't tried it myself, but since it's written in the documentation, it must be possible.
Well, the computer wants a universal solution where we don't need to integrate sound resources into the Expert Advisor. He wants to design a system of interaction between the Expert Advisor and the server, in which the first creates a text file of words that NOW needs to be said by the user, and the server converts them to .wav and sends back to the Expert Advisor. Next, the Expert Advisor, unknowingly, writes the file in place of the previous file (with the previous voiceover from the server) and calls PlaySound to play the new voiceover.
Реter Konow: Well, TC wants a universal solution, where there's no need to integrate sound resources into Expert Advisor beforehand. He wants to design a system of interaction between the Expert Advisor and the server, in which the first creates a text file of words that NOW should be said by the user, and the server converts them to .wav and sends back to the Expert Advisor. Next, the Expert Advisor, unknowingly, writes the file in place of the previous file (with the previous voiceover from the server) and calls PlaySound to play the new voiceover.
Create a resource from the received data. And then play it with PlaySound. But I haven't found exactly such connection in examples (I'm not sure it will work). That's why I deleted previous message.
[in] Относительный путь к файлу, содержащему данные для ресурса. Если путь начинается с обратной косой черты "\" (пишется "\\"), то файл ищется относительно папки Если второй вариант функции вызывается для...
Create a resource from the received data. And then play it with PlaySound. But I didn't find exactly such a link in the examples (not sure if it will work). So I deleted previous message.
What exactly is your query not working? There are good examples in the documentation .
I don't have time to figure out the talker protocol right now, and it's useless.
Regarding your link - if you can not use WebSocket - better not to use, you will save a lot of time (if no experience with it). There are other options out there besides WebSocket.
here's what fails https://www.mql5.com/ru/forum/342293/page12#comment_16633648
File is created, but empty. Its name
is different from the file that is downloaded by curl command
It kind of hints that the code you wrote
//+------------------------------------------------------------------+//| WebRequest.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 |//+------------------------------------------------------------------+voidOnStart()
{
string cookie=NULL,headers;
char post[],result[];
char cost_char_data[];
string result_headers;
headers = headers + "-u apikey:GR1bb3zVMs9fcNKL6pA9-5zj9ptWliCu6eh9oupUnpZB";
headers = headers + " --header \"Content-Type: application/json\"";
headers = headers + " --header \"Accept: audio/wav\"";
headers = headers + " --data \"{\"text\":\"hello world\"}\"";
headers = headers + " --output hello_world.wav";
//output hello_world.wav ^string url="https://api.eu-gb.text-to-speech.watson.cloud.ibm.com";
//--- для работы с сервером необходимо добавить URL "https://finance.yahoo.com"//--- в список разрешенных URL (Главное меню->Сервис->Настройки, вкладка "Советники")://--- обнуляем код последней ошибкиResetLastError();
//--- загрузка html-страницы с Yahoo Financeint res = WebRequest("POST",url,headers,1000,cost_char_data,result,result_headers);
if(res==-1)
{
Print("Ошибка в WebRequest. Код ошибки =",GetLastError());
//--- возможно, URL отсутствует в списке, выводим сообщение о необходимости его добавленияMessageBox("Необходимо добавить адрес '"+url+"' в список разрешенных URL во вкладке 'Советники'","Ошибка",MB_ICONINFORMATION);
}
else
{
if(res==200)
{
//--- успешная загрузкаPrintFormat("Файл успешно загружен, размер %d байт.",ArraySize(result));
//PrintFormat("Заголовки сервера: %s",headers);//--- сохраняем данные в файлint filehandle=FileOpen("output hello_world.wav",FILE_WRITE|FILE_BIN);
if(filehandle!=INVALID_HANDLE)
{
//--- сохраняем содержимое массива result[] в файлFileWriteArray(filehandle,result,0,ArraySize(result));
//--- закрываем файлFileClose(filehandle);
}
elsePrint("Ошибка в FileOpen. Код ошибки =",GetLastError());
}
elsePrintFormat("Ошибка загрузки '%s', код %d",url,res);
}
}
//+------------------------------------------------------------------+
doesn't form WebRequest syntax correctly.
That is, it fails to make the WebRequest do what curl does
If the sound file can be played back from the Files folder, where it is pre-recorded by the EA, then the solution to the problem will be realistic if the resulting sound file is coherent.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
it is not possible to play a wav file from a sandbox without a DLL?
from help
For example, if audio file Demo.wav is located in terminal_data_directory\MQL5\Files folder, then PlaySound() call should be written in this way:
//--- play sound file Demo.wav from terminal_data_directory\MQL5\Files\
PlaySound("\\\Files\\\Demo.wav");
The problem is that the playsound engine itself is flawed. it doesn't combine the sounds, but stops playing the previous one as soon as a new command arrives.
There is a requirement in the market that the product should work out of the box and not depend on third party modules. but it is possible to make a radical move - to make a box solution on playsound crutch and if you have some module, for example, posted in kodobase, use a normal solution through the win engine. which I understand can also do text recognition.
I see you are an experienced person, can you help me write a socket reference example?
The documentation is herehttps://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-usingWebSocket
I understandinstance_id is GR1bb3zVMs9fcNKL6pA9-5zj9ptWliCu6eh9oupUnpZB
While I'm reading the doc...
What exactly is your query failing? There are good examples in the documentation.
I don't have time now, and it's useless thing.
Regarding your link - if you can not use WebSocket - better not to use, you will save a lot of time (if you have no experience with it). There are other options out there besides WebSocket.
from help
For example, if Demo.wav sound file is located in terminal_data_directory\MQL5\Files folder, PlaySound() call should be written in this way:
//--- play sound file Demo.wav from terminal_data_directory\MQL5\Files\
PlaySound("\\\Files\\\Demo.wav");
The problem is that the playsound engine itself is flawed. it doesn't combine the sounds, but stops playing the previous one as soon as a new command arrives.
the market requires that the product should work out of the box and not depend on third party modules. but it is possible to make a radical move and make a box solution on playsound crutch and if you have some module, for example in kodobase, use a normal solution through the wind engine. which I understand can do text recognition too.
that's my point exactly! )
Yes, 2 ways.
The 1st way is PlaySound and pauses based on pronunciation speed. But I encountered this and at the stage of calling the native Windows TTS features, when the second phrase gets into a busy stream, we get a runtime error. Therefore, there is a delay in the class based on the pronunciation speed of 100 characters per minute. In principle, we get out of this situation.
Method 2 - Generate test file by closed code and play it back by open code with enabled DLLs
Why write something unnecessarily in the folder? PlaySound can play from resources, see "Using Resources" in the link
P.S. I haven't tried it myself, but since it's written in the documentation, it must be possible.
Well, TC wants a universal solution, where there's no need to integrate sound resources into Expert Advisor beforehand. He wants to design a system of interaction between the Expert Advisor and the server, in which the first creates a text file of words that NOW should be said by the user, and the server converts them to .wav and sends back to the Expert Advisor. Next, the Expert Advisor, unknowingly, writes the file in place of the previous file (with the previous voiceover from the server) and calls PlaySound to play the new voiceover.
I meant using ResourceCreate
Create a resource from the received data. And then play it with PlaySound. But I haven't found exactly such connection in examples (I'm not sure it will work). That's why I deleted previous message.
I meant using ResourceCreate
Create a resource from the received data. And then play it with PlaySound. But I didn't find exactly such a link in the examples (not sure if it will work). So I deleted previous message.
What exactly is your query not working? There are good examples in the documentation .
I don't have time to figure out the talker protocol right now, and it's useless.
Regarding your link - if you can not use WebSocket - better not to use, you will save a lot of time (if no experience with it). There are other options out there besides WebSocket.
here's what fails https://www.mql5.com/ru/forum/342293/page12#comment_16633648
File is created, but empty. Its name
is different from the file that is downloaded by curl command
It kind of hints that the code you wrote
doesn't form WebRequest syntax correctly.
That is, it fails to make the WebRequest do what curl does
here's what doesn't work https://www.mql5.com/ru/forum/342293/page12#comment_16633648
.....I can look at it, but not before tomorrow evening. If you haven't worked it out yourself by then.
here's what's not working https://www.mql5.com/ru/forum/342293/page12#comment_16633648
The file is created, but it is empty. Its name
is different from the file downloaded by the curl command
This kind of hints that the code you wrote
doesn't form WebRequest syntax correctly.
I.e. you can't make WebRequest do what curl does
and you won't :-)
why do you pass curl command options in HTTP headers?
well, at least read some books, look through some examples... otherwise, we'll all really write you an article