-4

is their any thing I should consider while I am writing my program to get the write content of mp3 file and write to anenter code hereother file ? because am getting Error!

this is my code in c

FILE *fout;
fout = fopen("step.MP3","rb");
while (!feof(fout))
{
    fread(data,counter + 1,1,fout);
}
fclose(fout);


FILE  *fo;
fo = fopen("step.MP3", "wb");
fwrite(test,1,fileSize,fo);
fclose(fo);
Neil
  • 11,059
  • 3
  • 31
  • 56
  • https://stackoverflow.com/help/mcve https://stackoverflow.com/help/how-to-ask and here's something that is able to solve your problem http://lame.sourceforge.net/index.php – sknt Apr 25 '17 at 11:28
  • `while (!feof(fout))`? No, just no. See [Why is “while ( !feof (file) )” always wrong?](http://stackoverflow.com/questions/5431941/why-is-while-feof-file-always-wrong) – Andrew Henle Apr 25 '17 at 12:49

1 Answers1

0

I would consider using an mp3 library to accomplish your task. something like lame or Bass. If you really want to do it yourself, read up on the mp3 file format: http://www.mp3-converter.com/mp3codec/mp3_anatomy.htm

Neil
  • 11,059
  • 3
  • 31
  • 56