I have a server that sends data through a socket, data is a wav file. I can easily write data to disk and then play it back in WMP, but I don’t know how I can play it when I read it from the socket. Is it possible?
Bonus question: how can I do this if the stream was in mp3 or in another format?
This is for windows in native C ++.
Since you said WMP, I assume the question relates to trying to play a wav file on a Windows machine. If not, this answer does not matter.
, , . , Windows. , . "" , , . , . ,
. .
, . , DirectSound waveOut. : - . , - , 2 , .
FMOD. FAQ:
. FMOD . :
, . API- waveOutXXXX ( Windows 95) , . API ++, #. , , .
If your stream is a format other than WAV files (such as MP3 or WMA), you will have to perform an additional step to decode the data in WAV format and play it using the waveOutXXXX API. Finding a good MP3 decoding component is harder than you expected - I think this is due to the Fraunhofer licensing situation (you have to pay them if you use any kind of MP3 code).
I would find a finished product to do this if you do not want training.
Source: https://habr.com/ru/post/1697490/More articles:NPE в JBossWS на JBoss 4.2.2 с включенным jmxremote - javawrong telneting feedback key - solarisWhat is the best way to create a text file on a .net website? - .netHow to force two browser windows to use the same "session"? - browserStarteam 2005 COM API - starteamnHibernate не извлекает вручную измененные данные - nhibernateLinux domain management solution? - linuxDecoding letters ('a' .. 'z') from a sequence of bits without waste - language-agnostichttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1697494/how-long-would-it-take-to-setup-a-new-ci-repository&usg=ALkJrhiahE8rc5_HhOfG0MDMzS_TkW-j0QImpersonate a user in Asp.Net - asp.netAll Articles