Improving streaming in Tuniac

The Tuniac forum.
Post Reply
Harteex
Posts: 80
Joined: Tue Mar 30, 2010 7:23 pm

Improving streaming in Tuniac

Post by Harteex » Sun Jul 14, 2013 11:02 pm

I've been looking into improving streaming a bit in Tuniac, and as a first step I've looked at making streamed mp3s over http seekable.

Started out looking at TuniacHTTPFileIO, and found that adding seek support here would be quite straight forward. Basically:
Check if server supports partial retrieves, if it does set a flag, and then, when seeking, close and reopen the connection at the specified offset.
However, this file seems not to be used, as BASS also handles streaming...

BASS doesn't seem to support seeking when streaming unfortunally, except maybe if you set it to download the whole files, but that feels like a bit unneccessary bandwidth wise... I'll probably try to suggest seek support with BASS_STREAM_BLOCK to them like my attempt above.
Otherwise, maybe it's possible to implement a virtual file access and use TuniacHTTPFileIO somehow. Don't know BASS good enough yet, feel free to comment on this.

I'll also look into making it possible to get tag data from streamed files.

Feel free to give any suggestions or comments.. or just treat this post as a dev diary ;)

Brett
Site Admin
Posts: 250
Joined: Sun Mar 28, 2010 12:36 am

Re: Improving streaming in Tuniac

Post by Brett » Mon Jul 15, 2013 12:10 am

You are correct TuniacHTTPFileIO is not used at the moment, it was added by Tony so plugins could use it.

The FLAC decoder was using StandardFileIO which is interchangeable with MemoryFileIO
https://sourceforge.net/p/tuniac/code/8 ... AC_Plugin/

I think you would make BASS use BASS_StreamCreateFileUser() where you can use callbacks similar to how FLAC_plugin was doing it with the StandardFileIO.

ICY info and such is already read by BASS_Plugin.
Complete stream tag reading could be done.

Harteex
Posts: 80
Joined: Tue Mar 30, 2010 7:23 pm

Re: Improving streaming in Tuniac

Post by Harteex » Mon Sep 09, 2013 9:27 pm

I looked a bit at BASS and how to do this, but eventually figured that this wouldn't work well for the general case. For example in the case of VBR mp3s, you don't know exactly where to seek... too bad. Maybe some other approach, where it downloads the file anyway and some indication in the seek bar how much is loaded is better then. Or maybe I'll add support for some streaming protocol.

Unfortunally I got very busy with things again. Will still look into tag reading some time later.

Post Reply