c# - MP3 change bitrate -
i have pre recorded 5 mp3 files @ 320 kbps. in c# using code merge/join them in 1 mp3:
private void mergemp3(list<string> inputfiles, filestream output) { foreach (string file in inputfiles) { mp3filereader reader = new mp3filereader(file); if ((output.position == 0) && (reader.id3v2tag != null)) { output.write(reader.id3v2tag.rawdata, 0, reader.id3v2tag.rawdata.length); } mp3frame frame; { output.write(frame.rawdata, 0, frame.rawdata.length); } } }
the output mp3 file save on disk has bitrate 291 kbps. should have 320 kbps on output file?
edit 1:
the way call function above (mergemp3) main:
//paths files want merge list<string> paths = new list<string>(); paths.add(@"c:\users\user\desktop\1.mp3"); paths.add(@"c:\users\user\desktop\2.mp3"); paths.add(@"c:\users\user\desktop\3.mp3"); paths.add(@"c:\users\user\desktop\4.mp3"); paths.add(@"c:\users\user\desktop\5.mp3"); //merge mp3 filestream output = file.open(@"c:\users\user\desktop\alltogether.mp3", filemode.create); mergemp3(paths, output);
edit 2: using naudio.dll
Comments
Post a Comment