Click here to Skip to main content
15,892,737 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Now Set there are two mp3 files,such as a.mp3,b.mp3.I want to merge a.mp3 and b.mp3 to c.mp3.what can I do?
Posted

See here[^], you will need to understand the format of MP3 files before you can do what you want.
 
Share this answer
 
v2
by the way you can merge the files directly without taking care
about header, cause most of mp3 player fix the header errors.

but it is much more better to deal with header and format as Richard MacCutchan said.

how ever here is a code which merger them directly.


C#
byte[] a = File.ReadAllBytes(txt_a_path.Text);
byte[] b = File.ReadAllBytes(txt_b_path.Text);
byte[] c = new byte[a.Length + b.Length];
a.CopyTo(c, 0);
b.CopyTo(c, a.Length);
File.WriteAllBytes(txt_c_path.Text, c);


and this is the sln link:
http://imljh.ucoz.com/code/Merge_mp3_no_header_care.zip
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900