ios - Stream audio from HTTP Link -


i need stream audio 1 url. url have link http , port connect. have link similar this: "http://linkofsite.com:1234" want play stream audio avplayer, audiotoolbox or other native ios framework.

thanks helps.

    nsurl *url = [nsurl urlwithstring:[nsstring stringwithformat:@"%@",url]];       nsdata *sounddata = [nsdata datawithcontentsofurl:url]      nserror *error;     avaudioplayer *audioplayer = [[avaudioplayer alloc] initwithdata:sounddata error:null];     if (error) {         nslog(@"error in audioplayer: %@", [error localizeddescription]);     } else {          [audioplayer preparetoplay];     }     [audioplayer play]; 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -