adma, problem is: ReadLine read to buffer line break character. So such line can't be used by e.g. EmitSound.
TrimString can't remove line breaks. It is intended for white space character only.
Non-binary functions should not return such character at all. For that kind of stuff Read() function is intended.
Second problem: why ASCII code of individual character of string have such strange code number.
51 - is a correct code of "3" character (last character of "valentine/file.mp3" string). 13168 - don't know, what is it.
UPD. I simplified code in 1-st post to reflect the problem as simple as possible.
I found this walkaround in "sm downloader
len = strlen(buffer);
if (buffer[len-1] == '\n')
buffer[--len] = '\0';
But, actually I don't need such check. It is a bug in ReadLine() function.
sm v.1.10.6361 is also affected.