Updated copyright message.
[meviz.git] / src / main / java / eu / svjatoslav / meviz / encoder / converters / AvconvAudio.java
1 /*
2  * Meviz - Various tools collection to work with multimedia.
3  * Copyright (C) 2012 -- 2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of version 2 of the GNU General Public License
7  * as published by the Free Software Foundation.
8  */
9
10 package eu.svjatoslav.meviz.encoder.converters;
11
12 import eu.svjatoslav.meviz.encoder.EncodingOptions;
13
14 import java.io.File;
15 import java.util.List;
16
17 public class AvconvAudio extends AbstractConverter {
18
19     private static final String[] SUPPORTED_FORMATS = new String[]{"ogg", "wav", "mp3", "m4a", "flac"};
20
21     @Override
22     public String getCommand(final File inputFile, final File targetFile,
23                              final EncodingOptions options, String targetFormat) {
24
25         final String codecParams = "-b:a 192k";
26
27         return "avconv -i \"" + inputFile.getAbsolutePath() + "\" "
28                 + codecParams + " \"" + targetFile.getAbsolutePath() + "\"";
29     }
30
31     @Override
32     public List<String> getSourceFileExtensions() {
33         return toList(SUPPORTED_FORMATS);
34     }
35
36     @Override
37     public List<String> getTargetFileExtensions() {
38         return toList(SUPPORTED_FORMATS);
39     }
40
41     @Override
42     public boolean isTerminalMandatory() {
43         return false;
44     }
45
46 }