visual c++ - Storing audio file into an array/stringstream C++ -


i send contents of audio file system on network using socket. both systems run on windows operating system. there tutorial on way store audio contents c++ array or stringstream datatype, easier send different node.

i want know how extract data bytes audio file.

the easiest thing send data in chunks of bytes. if starting audio file, open other binary file file = fopen(filename, "rb"); (where filename name of audio file). enter loop read chunks of bytes until reach end of file. use bytes_read = fread(buffer, sizeof(char), read_size, file); buffer should char array of @ least size read_size, be, say, 1024. after each fread, can make network send call. alternately, read whole file first , send chunk chunk. call. either way, when reach end of file, send sort of signal have reached end. receiving system should take these chunks , call fwrite create new audio file. can either append each chunk comes in or buffer until reach end , write out.


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -