How to use infinit live streams with JAVE library? (Java, ffmpeg)
Posted
by Ole Jak
on Stack Overflow
See other posts from Stack Overflow
or by Ole Jak
Published on 2010-03-28T18:51:10Z
Indexed on
2010/03/28
18:53 UTC
Read the original article
Hit count: 357
So I want to use JAVE to save mp3 radio stream to my File system. I have this code for file saving but what shall I do to save a stream (stop on timer for ex)
File source = new File("source.wav");
File target = new File("target.mp3");
AudioAttributes audio = new AudioAttributes();
audio.setCodec("libmp3lame");
audio.setBitRate(new Integer(128000));
audio.setChannels(new Integer(2));
audio.setSamplingRate(new Integer(44100));
EncodingAttributes attrs = new EncodingAttributes();
attrs.setFormat("mp3");
attrs.setAudioAttributes(audio);
Encoder encoder = new Encoder();
encoder.encode(source, target, attrs);
© Stack Overflow or respective owner