Closed AdorableParker closed 2 years ago
The problem has been solved, the code is modified as follows:
fun ogg2amr() {
val cacheFile = File("speak.ogg")
val target = File("input.amr")
val audio = AudioAttributes()
audio.setCodec("libopencore_amrnb")
audio.setChannels(1);
audio.setSamplingRate(8000)
val attrs = EncodingAttributes()
attrs.setOutputFormat("amr")
attrs.setAudioAttributes(audio)
Encoder().encode(MultimediaObject(cacheFile), target, attrs)
}
I am trying to convert an audio file in
ogg
format toamr
, but when i do it prompts meException in thread "main" ws.schild.jave.EncoderException: Exit code of ffmpeg encoding run is 1
This is what I did: