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

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -