2

I converted a wma file simply by doing something like this...

ffmpeg -i song.wma -f mp3 song.mp3

I can then play the mp3 file in Windows Media player, so it looks like the conversion worked.

However, if I try to open the file in TagLib, I get an error "MPEG audio header not found" on the following line...

TagLib.File tf = TagLib.File.Create("song.mp3");

I've tried this on a few wma files, so it's not just that one that's at fault.

Anyone have any idea what I did wrong? I find the docs for ffmpeg pretty overwhelming, and as a complete ignoramus in the field of audio encoding, I haven't a clue what most of it means. Could be I'm missing something in the conversion, although that wouldn't explain why WMP can play it but TagLib can't open it.

Bond
  • 16,071
  • 6
  • 30
  • 53
Avrohom Yisroel
  • 8,555
  • 8
  • 50
  • 106
  • Please show the complete console output from your `ffmpeg` command. Does an output from `lame` work? `ffmpeg -i input.wma -f wav - | lame - output.mp3` – llogan Jul 05 '15 at 17:30
  • How do I show the output? This little box will only allow a few hundred characters, and the output is more than that. Also, I'm not sure how to run lame, as I don't have it as a standalone executable (as far as I know). I thought it was wrapped up in ffmpeg. Sorry to be dumb, but as I said, I'm a rank beginner in this stuff! Thanks for the help. – Avrohom Yisroel Jul 05 '15 at 17:44
  • @LordNeckbeard Windows 7 Pro x64 SP1 – Avrohom Yisroel Jul 05 '15 at 18:18
  • @LordNeckbeard Copying the command prompt output isn't a problem, I just piped it into a text file. The problem is that the silly little comments on this site don't allow much text, and don't allow any line breaks, so I can't paste it all in. – Avrohom Yisroel Jul 06 '15 at 14:33
  • Why was my question downvoted? Seemed like a reasonable enough question to me? Please can whoever downvoted it explain what I did wrong. – Avrohom Yisroel Jul 06 '15 at 14:42
  • I meant that you should update your question with the requested info; not attempt to cram it all in small comments. – llogan Jul 06 '15 at 17:26
  • @LordNeckbeard Ah, good idea, didn't think of that. Was that the reason for the downvote, or was that someone else? – Avrohom Yisroel Jul 07 '15 at 14:50
  • I didn't downvote your question. – llogan Jul 07 '15 at 16:17
  • @LordNeckbeard Thanks for the clarification. I wonder who did and why? Seems like a reasonable enough question to me. – Avrohom Yisroel Jul 08 '15 at 16:47
  • Probably because you did not provide enough information such as the complete `ffmpeg` console output. – llogan Jul 08 '15 at 18:45

1 Answers1

0

Whilst not strictly an answer to my original question, I managed to get another way of doing what I wanted.

Please see Corey's answer to my question here, in which he shows how to use his NAudio package to convert the file in code. This is a better approach anyway, as it doesn't rely on running external programs, which was causing its own problems. The converted file produced by his package ran through TagLib without any issues.

Community
  • 1
  • 1
Avrohom Yisroel
  • 8,555
  • 8
  • 50
  • 106