tumtumtum / StreamingKit

A fast and extensible gapless AudioPlayer/AudioStreamer for OSX and iOS (iPhone, iPad)
Other
2.43k stars 525 forks source link

File Type Hint #106

Open Friend-LGA opened 10 years ago

Friend-LGA commented 10 years ago

Then I change method:

+(AudioFileTypeID) audioFileTypeHintFromFileExtension:(NSString*)fileExtension
{
...
    if (!number)
    {
        return 0;
    }
...
}

to

+(AudioFileTypeID) audioFileTypeHintFromFileExtension:(NSString*)fileExtension
{
...
    if (!number)
    {
        return kAudioFileMP3Type;
    }
...
}

some more stations became playable.

Friend-LGA commented 10 years ago

But this solution doesn't solve all problems. We need to make possible to identify file type even when we don't know MIME type. Like it working in FreeStreamer.

I will try to make it, if i can - wait for pull request.

tumtumtum commented 10 years ago

It's better to have the mime type or file extension. Why do you not have the MIME type?

Friend-LGA commented 10 years ago

I think it's because some streams have ShoutCast protocol. And its doesn't include MIME type in response, we need to make some more work to get MIME type from ShoutCast.

I already write my class to identify content type of stream independently from protocol. But I done it using objective-c NSURLConnection I'm not familiar with C++, maybe you can translate it? https://github.com/Friend-LGA/AudioStreamContentTypeGetter