I'm trying to convert a MIDI file to a WAV file, on OS X.
So far, I have this:
fluidsynth -F output_sound soundfont.sf2 note.mid
This creates an output_sound file, however, that file is not WAV, it seems to be in sint16 format given that I get this output:
~ $ fluidsynth -O help
FluidSynth version 1.1.6
Copyright (C) 2000-2012 Peter Hanappe and others.
Distributed under the LGPL license.
SoundFont(R) is a registered trademark of E-mu Systems, Inc.
-O options (audio file format):
's16'
Is there an easy way to convert the output_sound to a WAV file in Terminal (or in any scriptable fashion)?
There is a simpler way than using SoX: when FluidSynth is installed with libsndfile support, it outputs WAV by default. This is how Homebrew installs FluidSynth by default:
$ brew install fluid-synth
...
$ fluidsynth -T help
FluidSynth runtime version 2.0.8
Copyright (C) 2000-2019 Peter Hanappe and others.
Distributed under the LGPL license.
SoundFont(R) is a registered trademark of E-mu Systems, Inc.
-T options (audio file type):
'aiff','au','auto','avr','caf','flac','htk','iff','mat','mpc','oga','paf','pvf','raw','rf64','sd2','sds','sf','voc','w64','wav','wve','xi'
auto: Determine type from file name extension, defaults to "wav"
I found the easiest solution to be timidity:
timidity input.mid -Ow -o out.wav
If you use homebrew it's also trivial to install:
brew install timidity
Thanks to CL.'s comment I came up with this:
sox -t raw -r 44100 -e signed -b 16 -c 1 raw_audio audio.wav
Related
Timidity version is TiMidity++-2.14.0, and here is my install commond:
./configure && make && make install
Then I run the commond
timidity song.mid -Ow -o | ffmpeg -i - -acodec libmp3lame -ab 64k song.mp3
and it returns error:
/usr/local/share/timidity/timidity.cfg: No such file or directory timidity: Can't read any configuration file. Please check /usr/local/share/timidity/timidity.cfg
"find / -name timidity.cfg", but there is no such file.
I am confused about the error.
Thanks for your reply in advance.
The documentation says:
TiMidity++ uses Either GUS/patch, or SoundFont (,or both) as the voice data to play. You must get a SoundFont or GUS/patch files, and make the configuration file. You must make the configuration file (*.cfg). By default, timidity.cfg is /usr/local/share/timidity/timidity.cfg.
Also see the Arch documentation.
I'm trying to increase the volume of my input .wav file by means of the output_volume option within the avconv command. I would like to increase the volume by 6 dBs similarly as demonstrated in the man page.
I have my command in a script format
for i in *.wav; do avconv -i "$i" output_volume=volume=6dB:precision=fixed "$i{%.*}".mp3;done
But I receive the following error. I see many search results pertaining to FFmpeg but I not helpful towards avconv
Unable to find a suitable output format for 'output_volume=volume=6dB:precision=
fixed'
The general sytanx from the man page is:
avconv [global options] [[infile options][ā-iā infile]]... {[outfile options] outfile}...
I having trouble interpreting the documentation..
Try something like this:
for i in *.wav; do
avconv -i "$i" -af volume=6dB:precision=fixed "$i{%.*}".mp3
done
I'm trying to set up a service that will output .ismv files for smooth streaming.
Currently I'm using the following command to start the transcode:
ffmpeg.exe -i <infile> -movflags frag_keyframe -f ismv <outfile>
As I understand it I don't need to add isml to the movflags because I don't want to stream it but the actual output file.
According to the documentation I already should use the empty_moov and separate_moof flags because I'm using the ismv format. This however does not generate the .ism and .ismc file.
There is a part about smoothstreaming, but if I use -f smoothstreaming ffmpeg won't run.
I did find a win32 binary for ismindex which should generate the manifest files, but when I run it I don't get any useful output.
What are the correct parameters for ffmpeg so that it creates all the files at the same time?
ismindex [-split] [-ismf] [-n basename] [-path-prefix prefix] [-ismc-prefix prefix] [-output dir] file1 [file2] ...
To generate the manifest files you would do:
ismindex -n <basename> input.ismv
The smoothstreaming muxer accepts a directory as output.
ffmpeg [...] -f smoothstreaming <dir>
Is there a way to get any media file (.avi, .mp4, .mp3, etc.) length using Mac's Terminal?
I there is a need to install a package or a library can you please specify which, and how to install them?
Mac built in:
mdls *.mp4
Tested in MacOSX 10.6.8
You can use ffmpeg or ffprobe to get the duration. You can install ffmpeg easily using Homebrew:
brew install ffmpeg
And then you can get the duration using this command:
ffmpeg -i input 2>&1 | grep "Duration"| cut -d ' ' -f 4 | sed s/,//
See the answers here for more details: How to get length of video file from console?
On my Mac, tar defaults to BSD tar.
$ tar --version
bsdtar 2.8.3 - libarchive 2.8.3
There is a GNU tar that I can invoke with gnutar.
$ gnutar --version
tar (GNU tar) 1.17
Copyright (C) 2007 Free Software Foundation, Inc.
...
With Ant Tar task, how do I configure it to use the GNU tar?
As #Raghuram wrote, modern versions of Ant do not use an external tar program; instead, they have their own pure-Java implementation. However, you can produce behavior similar to GNU tar by using the longfile="gnu" attribute. From the manual:
If the loss of path or file information is not acceptable, and it rarely is, longfile may be set to the value gnu. The tar task will then produce a GNU tar file which can have arbitrary length paths. Note however, that the resulting archive will only be able to be untarred with GNU tar.
ant tar task does not use the system tar command. Thus the question of configuring an alternate tar implementation does not arise.