media player - Set Bitrate for the stream audio in android -
i have simple android app, thar stream online radio, ok, client want app has 2 options, 128 kbp/s , 38 kbp/s. how can set bitrate mediaplayer class in asdroid?
this pla action:
public void actionplay(view view) { mediaplayer = new mediaplayer(); try { mediaplayer.setaudiostreamtype(audiomanager.stream_music); mediaplayer.setdatasource(url); mediaplayer.prepare(); // might take long! (for buffering, etc) mediaplayer.start(); } catch (illegalargumentexception e) { e.printstacktrace(); } catch (securityexception e) { e.printstacktrace(); } catch (illegalstateexception e) { e.printstacktrace(); } catch (ioexception e) { e.printstacktrace(); } }
if refer documentation using prepareasync()
better streams. if use prepare()
, block until enough data buffered.
mediaplayer.prepareasync();
refer here.
setting bit rate there no mention of in official documentation.
perhaps need go ndk realize , require lots of work..
Comments
Post a Comment