How to get stream of mp3 file and play

Discussion in 'iOS Programming' started by mathan, Jul 21, 2008.

  1. macrumors newbie

    Joined:
    Jul 21, 2008
    #1
    Hi all,

    I want to get a stream of mp3 file [Ex: www.abc.com/audiofile.mp3].
    my code snippet:

    NSMutableURLRequest *urlRequest = [[[NSMutableURLRequest alloc] init] autorelease];
    [urlRequest setHTTPShouldHandleCookies:YES];

    [urlRequest setURL:[NSURL URLWithString:mad:"http://www.abc.com/audiofile.mp3"]];
    [urlRequest setHTTPMethod:mad:"POST"];
    [urlRequest setHTTPBody:postData];

    NSData *requestedData = [NSURLConnection sendSynchronousRequest:urlRequest returningResponse:&urlResponse error:&theError];

    and I am trying to feed the response data to AudioFileStreamParseBytes

    Is It the right method ?

    Canany one suggest the proper way and any sample codes.I am very new to this area.......
     

Share This Page