Search code examples
iphoneiosaudiostreamer

DigitalDJ / AudioStreamer not connect to streaming server


I downloaded the code DigitalDJ / AudioStreamer to use in a player I'm doing, here's the project that I downloaded: https://github.com/DigitalDJ/AudioStreamer

Have used this library before I decided to upgrade it supports multi-thread,

but when I change the address of the streaming server http:// thor.nickpack.com:9000 to the address of my server, it does not run the audio.

to replace the server path that is in a TextField in viewController to my path: http:// 184.154.37.132:7075 see my problem.

Another solution would be to modify the old player that supports multi thread, I've tried several codes and could not, that was when I found the DigitalDJ / AudioStreamer, but I came across the problem I mentioned above,

this is the link for a sample app that does not have multi thread: http://www.mediafire.com/?eb7a6a87e8tqcbc

if someone has a clue how to implement audio in backgorund or how to solve the problem of streaming server I am grateful.


Solution

  • after a long time and almost going crazy trying to solved the problem by commenting the code in this trexo AudioStreamer.m

    // hintForMIMEType
    //
    // Make a more informed guess on the file type based on the MIME type
    //
    // Parameters:
    //    mimeType - the MIME type
    //
    // returns a file type hint that can be passed to the AudioFileStream
    //
    /*
    + (AudioFileTypeID)hintForMIMEType:(NSString *)mimeType
    {
        AudioFileTypeID fileTypeHint = kAudioFileMP3Type;
        if ([mimeType isEqual:@"audio/mpeg"])
        {
            fileTypeHint = kAudioFileMP3Type;
        }
        else if ([mimeType isEqual:@"audio/x-wav"])
        {
            fileTypeHint = kAudioFileWAVEType;
        }
        else if ([mimeType isEqual:@"audio/x-aiff"])
        {
            fileTypeHint = kAudioFileAIFFType;
        }
        else if ([mimeType isEqual:@"audio/x-m4a"])
        {
            fileTypeHint = kAudioFileM4AType;
        }
            else if ([mimeType isEqual:@"audio/mp4"])
        {
            fileTypeHint = kAudioFileMPEG4Type;
        }
            else if ([mimeType isEqual:@"audio/x-caf"])
        {
            fileTypeHint = kAudioFileCAFType;
        }
            else if ([mimeType isEqual:@"audio/aac"] || [mimeType isEqual:@"audio/aacp"])
        {
            fileTypeHint = kAudioFileAAC_ADTSType;
        }
        return fileTypeHint;
     }*/
    

    with this code commented out the audio played without problems on my server