Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: boathouse2112 on September 25, 2012, 06:03:41 pm

Title: MP3's from flash drive
Post by: boathouse2112 on September 25, 2012, 06:03:41 pm
We can already play MP3's as shown here: http://www.ticalc.org/archives/files/fileinfo/354/35424.html (http://www.ticalc.org/archives/files/fileinfo/354/35424.html)
And we can already download from flash drives as shown here: http://www.ticalc.org/archives/news/articles/13/139/139572.html (http://www.ticalc.org/archives/news/articles/13/139/139572.html)

So why not combine the 2? You would have a program that downloads "chunks" of data from the drive, plays them, and then deletes them. This would obviously have problems, the first coming to mind is speed, but does this seem like a possiblity?
Title: Re: MP3's from flash drive
Post by: shmibs on September 25, 2012, 06:28:45 pm
mp3s use complex compression algorithms to reduce file sizes, so an on-calc player for them isn't feasible, let alone one that reads usb and playss at the same time. you could write an application to read and play simpler files, maybe something that reuses code directly from usb8x when it's on the calculator, but it would be difficult, time consuming, and, with the proclivity of smaller, cheaper devices with larger internal storage space and the ability to decode better compression formats, ultimately pointless.
it would be cool, though :P
Title: Re: MP3's from flash drive
Post by: DJ Omnimaga on September 25, 2012, 06:46:58 pm
I remember SirCmpwn did this before, but unfortunately he deleted his Youtube video showcasing it (and there wasn't any download link)
Title: Re: MP3's from flash drive
Post by: Sorunome on September 25, 2012, 07:25:52 pm
It would be pretty cool if that would be possible. Maybe the song could be loaded into a different format before the calc starts reading&playing it?
Title: Re: MP3's from flash drive
Post by: Happybobjr on September 25, 2012, 07:53:08 pm
I remember SirCmpwn did this before, but unfortunately he deleted his Youtube video showcasing it (and there wasn't any download link)
Yeah :/
Sir was good at what he did and everything, but that made him power hungry. (or at least that's what it looked like to me)
I wish he would have been a better friend around here.
Title: Re: MP3's from flash drive
Post by: boathouse2112 on September 25, 2012, 09:45:46 pm
damn it. I swore there was a video of it. I just assumed the first links i got were the right ones without looking into it much.
Title: Re: MP3's from flash drive
Post by: DJ Omnimaga on September 25, 2012, 11:34:05 pm
It was probably his vid. After the bans he took anything he had calc-related down from Youtube D:
Title: Re: MP3's from flash drive
Post by: thepenguin77 on September 26, 2012, 12:14:56 am
We can already play MP3's as shown here: http://www.ticalc.org/archives/files/fileinfo/354/35424.html (http://www.ticalc.org/archives/files/fileinfo/354/35424.html)
And we can already download from flash drives as shown here: http://www.ticalc.org/archives/news/articles/13/139/139572.html (http://www.ticalc.org/archives/news/articles/13/139/139572.html)

So why not combine the 2? You would have a program that downloads "chunks" of data from the drive, plays them, and then deletes them. This would obviously have problems, the first coming to mind is speed, but does this seem like a possiblity?

Well, first of all, I'd like to point out that the "MP3's" you are talking about are similar to MIDI files. (Old cell phone ringtones).


The 84+ has been able to play music for quite some time now. It started real Real Sound (the video is gone) which could only work on the calculators with the extra ram. Then I made TruSound (youtube) (http://www.youtube.com/watch?v=5CEN-omB1Aw) which allowed the newer calculators to play sounds as well.

Now, both of these programs played .WAV files. If you know much about song formats, you know that .WAV files can be around 5x as big as MP3 files. The reason for this is that MP3 files are compressed to a smaller size. Like shmibs said, this compression algorithm is very complex and some computers running windows 2000 cannot even play them properly without skipping. What makes .WAV files convenient is that they are already in the format that is required to play sound while MP3 is not.

The obvious solution to the MP3 problem would be to decode the files ahead of time, but the 84+ only has 48KB or 128KB of ram (HW differences) and at 128Kbps, that means you'll get either 3 seconds or 8 seconds of song before the program would have to decode the next section which could take another 3 to 8 seconds. (TruSound uses a little compression, but it only cuts off around 20% of the file size)


Anyways, that's why MP3 doesn't work. As far as the USB half of it, I didn't think it was possible, but SirCmpwn proved us wrong. The trouble with sound over USB is that you have to try to get the USB port to cooperate with you fast enough to keep up with the song. Not only that, but you have to manage your cpu time because playing sound requires around 60% of the processor time when optimally configured and USB is a finicky thing that doesn't like to be interrupted.

Now, I say SirCmpwn proved us wrong, but like everyone has said, he never actually released his program. So while his youtube video made the music sound nice, I would honestly bet that it was a little scratchy. But, to be fair, he did manage to play recognizable music from a flash drive.


Finally, since you seem to be excited about playing songs on your calculator, I'll have to point you to another one of my projects, TruVid. (youtube) (http://www.youtube.com/watch?v=lD9mtNy2cd8)
Title: Re: MP3's from flash drive
Post by: TIfanx1999 on September 26, 2012, 05:09:42 am
The program linked to in the first post is a BASIC program, and it isn't using MP3's.

I'm pretty sure I've seen video being played from usb before, so I don't know why music would be much different (it's all data that has to be decoded afterall). IIRC the video I saw was a TI-85 using USB8x.

Here's what I found with a bit of looking: http://www.ticalc.org/archives/news/articles/13/130/130297.html . I seem to remember there being a video of it being rigged on a TI-85 as well (and more recent), but I can't seem to find it.
Title: Re: MP3's from flash drive
Post by: Axeisareligion on January 18, 2014, 02:59:02 pm
Is it very hard to just constantly download data from a USB to the calculator ARC or RAM and delete every byte when it has been played and could the same ever be possible for video? Because that would mean that the amount of data you can use becomes unlimited :w00t: :banghead:
Title: Re: MP3's from flash drive
Post by: calcdude84se on January 18, 2014, 08:51:15 pm
Holy necropost, Batman! (Generally speaking, try to avoid posting to old topics. Create a new one)
Is it very hard to just constantly download data from a USB to the calculator ARC or RAM and delete every byte when it has been played and could the same ever be possible for video?
That requires you to read from USB pretty much continuously. However, because of the need to play sound, you can't just always be reading data. Also, video is possible, though not very good. http://www.engadget.com/2005/08/17/the-ti-84-gets-down-with-usb-peripherals/ (http://www.engadget.com/2005/08/17/the-ti-84-gets-down-with-usb-peripherals/). From thepenguin77:
Quote from: thepenguin77
The trouble with sound over USB is that you have to try to get the USB port to cooperate with you fast enough to keep up with the song. Not only that, but you have to manage your cpu time because playing sound requires around 60% of the processor time when optimally configured and USB is a finicky thing that doesn't like to be interrupted.

Quote
Because that would mean that the amount of data you can use becomes unlimited :w00t: :banghead:
That's one of the motivations for a flash drive, yep :). Once again, though, the main challenge with video and audio is the speed.