Re: mplayer2 does not play MIDI files.
On Fri, Jan 04, 2013 at 10:17:16AM +0100, Raffaele Morelli wrote:
> 2013/1/4 Sthu Deus <sthu.deus@gmail.com>
>
> > Good time of the day.
> >
> >
> > $ mplayer 1.mid
> > MPlayer2 UNKNOWN (C) 2000-2012 MPlayer Team
> > mplayer: could not connect to socket
> > mplayer: No such file or directory
> > Failed to open LIRC support. You will not be able to use your remote
> > control.
> >
> > Playing 1.mid.
> > Failed to recognize file format.
> >
> > Exiting... (End of file)
> >
> > How do I fix it on Wheezy?!
>
>
> It won't fix at all because mplayer doesn't play midi files...
>
You can use timidity for midi files. I wrote this a while back to
convert a bunch of midi files to ogg. Beware -- it deletes the midi
files after conversion.
#!/bin/bash
for file in *.mid; do
WAVFILE=$(basename $file mid)wav
OGGFILE=$(basename $file mid)ogg
timidity $file -Ow -o $WAVFILE && rm $file
ffmpeg -i $WAVFILE -acodec vorbis $OGGFILE && rm $WAVFILE
done
I'm sure there are better ways of doing it. Also, note that it uses
ffmpeg. That has been replaced in Debian with something else. ffmpeg is
still available in the 3rd-party deb-multimedia repo, but I think you might
as well use oggenc instead of ffmpeg anyway.
-Rob
Reply to: