This is my second post today, but it's completely different from the last, so I thought it was worth it.
I finally got audio working. Well, at least close. Here's the complete code. As you can see, it references our book.html, and then sets the audio source to a URL. While I haven't fully tested it with the CSP, it should work, or at least be close to working.
But finishing this resulted in a large problem, and that's that LibriVox API doesn't give a direct MP3 link. That means that we can't stream the file. Even worse, it's likely that we'll have to either download each book individually (most books are 1+ GB from my testing), or download ALL the books and host them somewhere as MP3 files. A third option would be to get URLs from LibriVox's site, but they're not constant - they're hosted in random URLs such as this link and this link (notice the large difference in the beginning of the URL). As a result, it's going to be really tough to get each book to load easily.
So, it's going to take a ton of work to finish this last part. We'll have to figure out which option is best! It's going to be massive if we go the MP3 route, according to here there's 8,533 items in the collection, and things are being added constantly. Given that the average filesize is 1GB each, that's over 8.5 terabytes of data.
You have a tendency, not surprising given your youth, to jump to conclusions. When you mentioned to me in class that you were "almost finished with the app", I had to caution you that you were no where near finished, and told you about the adage that the first 90% of the task takes 10% of the time, while the last 10% takes 90%, I wasn't kidding. On the other hand, your conclusion here that this is "going to take a ton of work to finish" may likewise not be entirely accurate.
ReplyDeleteTo be of real value to project on which you will work in the future, you need to learn how to make use of existing resources to get the job done in the most efficient way you can. My brother, who has worked as a software developer for more than 25 years, often tells me that one of his most impressions when he went from college to the work world was the fundamental change in paradigm for what he was expected to do. "No one ever asked me to complete a task on my own without consulting the work of others." In fact, what is sometimes considered "cheating" in an academic environment you will quickly be fired for *not doing* in the real world of productive software development - making use of the resources already available to you.
I've been trying to get Alex to look at the existing LibriVox app for a week now. Since he seems unwilling to follow through, I'll charge you with doing that now. I'll also bring you a phone with the app pre installed so you can look at it (I emailed you about this yesterday).
On the website for our Advanced Topics in IT course, I mention that this course more than anything else is about "learning to learn" and highlight the following process:
Investigation <---> Reflection <---> Experimentation
(Look it up) (Think about it) (Try it out)
Learning to balance these three processes simultaneously is a big part of the art of becoming productive in your craft.
What you need to do next week is focus on the "Investigation" task. I would like to see posts mentioning the following:
1. What do you observe about the workings of the existing Android Librivox app?
2. What information can be gained from online sources, including:
a. http://wiki.librivox.org/index.php/How_To_Get_LibriVox_Audio_Files
b. http://www.bookdesign.biz/home
3. What other resources are available for handling audio within FXOS?
It does not appear that the the BookDesign apps are free software, which makes your challenge more difficult than it would otherwise be (it would be so nice if you could leverage the existing apps to look for solutions to problems you are encountering in writing yours). Of course this makes your contribution all the more valuable, since others will be able to use it in the future to work on similar projects.
You should definitely reach out to Kumar right away to begin asking him to point you in the direction of other community reasources.