[Q]How to rip streaming music radio app - Java for Android App Development

I have an Online Radio App and would like to add some sort of recording feature on it. I have done quite a bit of research and found one solution and from what I understand maybe the only solution is to rip it byte by byte. I have also tried to use the built in android recording method but it only records from the mic and I do not know or cannot figure out how to record from an external source such as a url like http://92.68.34.221:7000. Currently I am using the default Android media player method to play the url and its working flawlessly problem is I would like to set up the recording feature as a service to where when a the button is clicked run the service start recording and when it is clicked again terminate the service and save the file in a folder called online radio. Button might end up being a ToggleButton. I would really appreciate it if anyone could help me out and steer me in the right direction. Thanks in Advance

Saving a stream to file is quite easy, but if you want to define the exact start and end point of saving/recording by a button click it gets difficult.
You'll have to change your implementation a lot. Your android mediaplayer class handles everything for you, it opens the stream, fills a buffer and starts playing when the buffer is full. The mediaplayer doesn't offer any access to the bytes that it received.
Next problem: If you click on the button to start recording, the bytes you are listening to, have been in the (internal) buffer for an unknown amount of time. So you can't just open another connection to the stream url to start saving the bytes.
I would try it this way:
Implement these three parts in three different threads.
1. Use android.media.MediaExtractor to open the stream and implement a ringbuffer to store the extracted bytes
2. Use android.media.MediaCodec to decode your stream to pcm.
3. And use android.media.AudioTrack to play the pcm stream
Choose the size of the ringbuffer as large as the buffer of the AudioTrack. (Size in seconds, not in bytes!)
When the user clicks on the record button, you can read the data out of the ringbuffer, (encode them back to mp3 or something else) and save them to a file.
Not very easy for a beginner, but its a way you can do it.

Related

Audible Format Conversion Guide (Say NO! to Mono)

How to convert Audible Format 4 (.aa) to .mp3
Let me be clear, this is not a piracy technique, this is a way to use content you already purchased on Windows Mobile based phones/devices in the way you want to use it.
Do Not Steal Software or Content – it’s theft stupid.
This guide will NOT CONTAIN ANY LINKS
Audible “Support” claims that only format 2, and 3 work on Windows Mobile 5/6 Devices, keep in mind that this is because they lock down their format to their player. Format 2, and 3 are low quality MONO audio formats. Format 4 which is the closest to .mp3 and happens to be stereo is not supported…. That really sucks, nothing like listening to 24 hours of mono audio. I pay for their “service” which entitles me to 1 credit every 30 days, in my case 1 audio book. Who cares what device I play it on Audible, my media card is agnostic and does not have hardware limitations. DRM in general really honks me off, so with that in mind I went all google nuts and put together a way that works for me from a few different sources. A small guide on how to do this below:
Step 1 – Gather Resources
You will need to get the following software/stuff to make this work
1. Current paid for Audible Account
2. AudibleManager Software
3. AudibleMediaPlayerFilter.exe (Used to be available from Audible, but sadly they don’t offer it anymore)
4. Goldwave 5.0.6 (Pay, buy it, it is very good)
5. Lame .mp3 encoder (Free)
6. mp3split (Open Source)
7. A beefy Storage Card (8gb MicroSD in my case)
Step 2 – Uninstall/Install/Select/Convert/Split
1. This assumes that you have already downloaded your audio book/books and that you have installed AudibleManager. If you have not done so, install AudibleManager and download your media. Make sure it is format 4.
2. Shut Down AudibleManager
3. Move your freshly downloaded book to a different directory than the current directory I suggest C:\Audiobooks. In Vista the files will be located in C:\Username\My Douments\Audible\Downloads or something close to that. In XP they will be in C:\Documents And Settings\Username\My Documents\Audible\Downloads.
4. Important – UNINSTALL AUDIBLEMANAGER
5. Install AudibleMediaPlayerFilter.exe, in both Vista and XP you will receive 1 or more .dll errors. No worries here, just Google the .dll files you need, they are freely available. Put them in C:\Windows\System32. Then re-install again and repeat until you have no more errors.
6. Install Goldwave, it will complain that there is no encoder present for mp3, that’s ok, just install it. Now go to the program directory that contains Goldwave, it’s in C:\Program Files\Goldwave. Copy the Lame Encoder files to the Goldwave directory. Now go back to your desktop and run the install again, don’t worry just run it, it will not complain about the encoder this time, if it does, try a different directory inside Goldwave.
7. That was the hard part, fire up Gold Wave. It is a really great piece of software, problem is the newest version no longer supports this feature, so you have to use an older version. I would suggest that you register it, I did. I now use it for all my conversion needs.
8. Go to settings and configure your default audio format, don’t get too crazy here Chief, these files are going to be huge, so set a reasonable bit-rate. The quality of format 4 is not that great to begin with. I use a variable bit rate up to 192kbps. That gives me a file size of around 900mb’s per 8 hours of audio.
9. Select Batch from the toolbar\menu, then add the files you downloaded, remember they are in C:\Audiobooks or wherever you put them.
10. Wait a minute home-skillet, there are no files in that directory, change the selection to “all files” and there you go all your files should be there ready for you to select.
11. At this point it will ask you to enter your Audible account information, once it “authorizes” you can proceed.
12. Once you have selected the files, go ahead and start the processing, it will take quite a while to finish. 8 hours of audio takes about 3 minutes for it to initially read and about 25 minutes for it to convert to .mp3. I have a Quad Core (Q6600) with 4gb of ram and the software will use about 1.5gb of memory and all 4 cores. I also did this same process on a Core2 Duo (2.13Ghz) machine with 2gb of ram, it took the same amount of time.
13. Ok, processing is done, install mp3split. I suggest you split the files into 30min segments, it’s pretty straight forward, if you need help there are tons people using this program, just go to Sourceforge and look around.
14. That’s it you are done, you just have to move the files to your device of choice. FYI it will take forever if you are going to do this via Activesync (40-50min). I suggest a card reader.
It seems more complicated than it really is, once you have it up and running it’s pretty painless, just takes a while
Other Method -- The Analog Hole
*Disclaimer* this takes forever, it’s one to one, so 8 hours of audio will take 8 hours to record, plus conversion time.
Programs like Tunebite don’t do anything special that you can’t emulate with open source software like Audacity. It is very much like the olden days of yore where you had to tape stuff off the radio.
1. Download and install Audacity, Lame Mp3 Encoder, AudibleManager and your Audiobooks.
2. Start Audacity, for source select “what you hear” then hit the record button.
3. Start AudibleManager, and play your Audiobook.
4. Go back to Audacity and check your levels, make sure you are not clipping. If the audio goes into the red too often your recording will sound like doggie poop. You may have to start over a few times to get it right.
5. I suggest you unplug your speakers and go take a nap, play some 360, whatever, just make sure you come back by the end of the book.
6. Save the file you recorded as a .mp3 file, wait for it to finish (it will take a while), then split the files if you so desire.
7. Transfer the files to your device.
Pro’s
*The files you end up with are DRM Free and can be played back on anything capable playing .mp3 files.
*You don’t have to use .mp3 if you don’t want to, you could use ogg for example.
*You can pick any splitting point you like to save space on your device.
*You don’t have to use their player, which saves memory.
Con’s
*The difference in file size between .aa and .mp3 is significant, .aa is around 100mb for 8 hrs of audio, while the mp3’s are about 700-900mb. Hopefully Audible will change their mind and add format 4 to Windows Mobile devices, until then this is what I have to do to listen to stereo audio books on my AT$T Tilt.
*It takes some mucking around with .dll files, google, and reading skills, I know some people want an all inclusive piece of software that does this.
You loose the book art and the book-marking feature of the Audible Player. (use your favorite media application to add any art you want)
Bonus Tip#1 – Install software like File Renamer and cut down the filename length and remove your username from the file name, it will make it much easier to read on your device.
Bonus Tip#2 – Use different media players for different things, I use HTC Audio Manager for audio books and S2P for regular .mp3 files.
Bonus Tip#3 – Put your music in a different folder than your audio books, it helps keep everything organized.
Bonus Tip#4 – Keep your purchases DRM FREE, use Amazon for music instead of iTunes. Support the EFF, and don’t steal music/content/software.
This is in no way my work, just a compilation of other techniques I found using Google. Wait, what’s a Google? Seriously, how did you get here without using Google? I know Live Search and Yahoo are very “neat” looking, but for serious searching please use Google.
what a great help
I got to say i was kinda hesitant but made a stab at it anyway. I have the tilt also bought bluetooth headset for audio books. Went to audible paid subscription set it up downloaded it and F#[email protected][email protected] only receive book in mono. Listening to an eight hour book on headset with one speaker working is a joke. I followed your instructions all the way to the lame encoder. got a little lost just converted file to wma which i hope will work on mobile 6 i have a 8g card so if i have a problem i will split it with suggested software. Just want to take the time to thank you for the thoughtful insight on this subject. What a joke having paid for the audio book and have to listen to it in mono. The instructions were extremely easy to follow and well thought out. Except the part of mp3 encoder from lame to goldwave cant get it to work but nonetheless a great help to me and i am writing just to say thanks...............keep up the good work.............
Or you can just wait for the next Audilble Player to come out... which will have BT stereo and level 4. The closed beta is being worked on already.
I am plannng on a quick rewrite of the guide soon, I can,t wait till Audible releases a new player. I love the service, but I really hate the current player.
Well it's been years. I think this post should be deleted as the information is pretty much irrelevant. I hope it helped someone in it's day.
Thanks!
itrooper
aa to mp3
personally I think, that TuneConverter is a better software for this purpose. First of all it converts without quality loss, it supports all the most popular formats like aa, aac, m4a, wma and it can easily strip iTunes, Zune or Wal-Mart...
This is why I advice just to give it a try.
Do you have a link for TuneConverter?
I usually go the complicated way of:
- download as Format "4"
- write to CD (virtual CD), which includes the titles as CD Text
- rip CD(s), converting tracks to titles from CD Text
Audio quality is just bearable with format "4" (I guess ~32k mp3), but the path of ripping to CD is the only one if you don't want to have iTunes installed.
To deal with the Audible AA to MP3 conversion, you can use TuneFab Apple Music Converter. As an excellent audio DRM removal, it has the ability to remove DRM from the AA audiobooks and convert protected AA to MP3, FLAC, M4A, etc. for making AA files available on any media player and device. Better still, the original ID Tags and chapter info will be preserved in output MP3 or M4A files while converting.
What I used to convert Audible audiobooks is this one, but it is not a freeware. If necessary, you can try it from it's website.
T
I have tried the software, but most of them can't keep the original quality of Audible files.
Currently, I used the DRmare Audiobook Converter for Mac. It seems it the software that is most closest to it.
I will give a try soon my friend also recommend me another one calls Tunelf Audible Audiobook Converter ,seems have similar function.

[BUG] Brackets in an mp3 genre field crash HTC Music Manager (and phone)

In case anyone is having difficulty with their HTC Music Application not including mp3s in the library I have discovered a fairly comical bug and is described in more detail over at the HTC forums
Essentially any mp3 ID3 tag that has a bracket ( in the genre field causes the music update process to hang only recoverable after a reboot. It also (on my device) takes down the network connection.
Brackets and other characters !!!
Very important bug, Please relay the info
Hi there. I also have a lot of issues with my music library too.
So, what is the problem? I, as others, noticed that after transferring new files to my SD card (audio files or not), my music player crashes. Once it crashes, only a softreset would make it work properly. Re-connecting the device and removing the newly added files won't make the Player work again...
To transfer files to my SD card, I connect my device to my computer using a USB cable. If you connect using the "Disk Drive" mode, the speed is better, but the phone music player cannot access files, until you disconnect it from the computer. If you connect using the "ActiveSync" mode, it's less easy to transfer stuff, but the bug remains...
Normally, the Music player is able to update the files in a few seconds and should display every single tracks if you click on "Library" and choose the tab "All tracks". I means, it's extremely fast and my 4Go mp3s appear in 20 seconds or so. Wow!
Unfortunately, from time to time, when I disconnect my device, the Music Player crashes, the little update circle turns for ever, the "All tracks" tab remains empty, the player displays "no music found" and is unable to play any track, until the next softreset. From blazing fast to just plain buggy. Gosh!
Now, the good news. I discovered that the mp3 Tag (the so-called ID3 tag) is responsible for my problems.
I already gathered the facts that brackets in GENRE field cause the HTC Music Player to crash (See here), as wall as tag format other than ID3v2.4 UTF-8 (See here).
Still, it didn't complete solve the problem to convert all the ID3-tag to ID3v2.4 UTF-8 format and even removing the "genre" field from every single track. The problems were solved after I alse removed the "tracknumber" field from every track. Here are my complete findings about this bug.
What make the HTC Music player crash?
- The crash problem seems only related to the mp3 tag (ID3 tag)
- Tag format "ID3v2.3 UTF-16" => solution: use only ID3v2.4 UTF-8 tag or convert all the mp3 files in the player using MP3-Tag or similar software (shareware)
- Genre field using the following characters: brackets (), and symbol (&). No problem with the dash (-), underscore (_) nor space.
- Tracknumber including a star symbol (*). No problem with format like 1/16.
- Only one mp3 file is able to crash the whole player
- Only softreset will solve the problem once it happens. Even re-connecting the player and removing the bad files won't solve the problem once it happens.
So, if you have some mp3 tagged "Rock & Roll", "R&B" or "Pop (Rock)" files, you'll likely to see your Player crash everytime you connect and disconnect the USB cable.
What I don't know, is if everybody has the same problem. Myself, I'm using the latest official ROM 1.48 WWE with some tweaks...
For now on, I'm converting every file I transfer to my HD2 with MP3-tag using "ID3v2.3 UTF-16" tag, no *, no (), no &... And I happy again with my device... Until?
So what do you think? Do you have the same problem?
Reply, anyone?
I know for a fact many people did experience the same music player crashes.
See here
Or here
Or here
Or here
Or here
Or here (post #2)
Or here
Might they all be related to the same problems, I still don't know... But I might need your help
nothing understand
hello,
m-player plays the mp3-files on storage card for 3 or 4 seconds.
than it stops.
and allway its circling (left on the top side).
the mp3-songs are the same, that can play by orbit, x800, diamond, expedings-bums (sony) and tg01 (toshiba). whats wrong on leo?
whats wrong on htc? if htc needed beta-tester, than ... i am to angry!!!!
nothing understand resolving by mp3-tags. sorry.
if exists a real solution for the m..-f..-device?
okokur
"For now on, I'm converting every file I transfer to my HD2 with MP3-tag using "ID3v2.3 UTF-16" tag, no *, no (), no &... And I happy again with my device... Until?"
Hello guys! I did exactly what you suggested, converted all tags from my 5 GB of MP3. No success, Music Player takes ages to load (approx. 8 minutes, but every time you open it). Seems that the database (that is created when the Sd-card is inserted for the first time, hence the looooong loading. Right?) will not be saved for some reason. So the HTC-Music player is useless at present.
Greetings, and all the best for 2010 Dudes!
Studebaker
The size of my music folder is 4,5GB. I put all the songs at the same time on my microSD and then I opened the Music Tab. I had the same, never ending circle.
I deleted all of my songs, opened Music Tab, no songs of course, gave it a soft reset, plugged my HD2 to the pc, splitted my songs in parts of between 600-800MB. So I put the first part of 600MB on my phone, unplugged it, waited a lil bit and then opened the Music Tab. Sometimes it doesn't see the new files directly, so I have to soft reset it. Then start Music Tab, the circle will come up for a minute or less, and disappear again. Press on the library button, scroll to All Songs and select a random song and see if it plays for more than a minute. If everything is okay, you can pause the song, go to the main screen and put the next part of 600MB.
Sometimes the circle doesn't come, and sometimes it never stops. In that case, you have to wait for a few minutes on the Music Tab, and after that give it a soft reset and see if it helps.
It takes a long time, but at the end the music tab will finally work. If the whole thing crashes and doesn't react if you press the Play-button, give it a soft-reset and delete the last part again, soft reset and see if music tab works.
Before you try this, increase the standby time to 10 minutes, otherwise it will turn off all the time. You have to be patient, but in my case it fixed the problem.
okokur said:
hello,
m-player plays the mp3-files on storage card for 3 or 4 seconds.
than it stops. and allway its circling (left on the top side).
Click to expand...
Click to collapse
Take it easy. I definitely agree with you that something is wrong with the Sense music player, but until HTC really fixes this, we'll encounter various issues. You have to understand that only one wrong file will make your player crash and act exactly as you observed: playing any mp3 for few seconds and then stop. Let's make it clear. If you have only one wrong file in the whole library, not only will this particular file be impossible to play, but the whole library as well won't be able to play!
What do I call wrong files? I'm referring to the files not respecting the characteristics I described previously (TAG => more info here, if you don't know what I'm talking about). What is certain is that some "wrong" characteristics, other than MP3 tags, will make your play crash, that is for sure.
First things first. Did you at least try a softreset? Even so, I observed that the soft reset will "solve" the problem as long as the problem is related to MP3 TAGS. But I already experienced freezes and crashes even after a fresh softreset. This means that some "wrong files", not necessarily badly tagged will make the player crash, that's for sure. I still haven't found answer to that...
What you should do, as someone mentioned, is avoid putting your files in the same folder. As I always listen to full albums, already arranged in specific folders, I might have not experience bugs related to this issue.
Studebaker72 said:
"For now on, I'm converting every file I transfer to my HD2 with MP3-tag using "ID3v2.3 UTF-16" tag, no *, no (), no &... And I happy again with my device... Until?"
Hello guys! I did exactly what you suggested, converted all tags from my 5 GB of MP3. No success, Music Player takes ages to load (approx. 8 minutes, but every time you open it). Seems that the database (that is created when the Sd-card is inserted for the first time, hence the looooong loading. Right?) will not be saved for some reason. So the HTC-Music player is useless at present.
Greetings, and all the best for 2010 Dudes!
Studebaker
Click to expand...
Click to collapse
Read the above message and answer these questions:
- Do you still have the problem after a softreset?
- Do you still have the problem if you only have few mp3 on the SD card?
- Do you have a lot of files in a unique folder?
- Do you have other music filetype?
- Look for specific characters in the TAGS, maybe other characters are not supported (; ~ \ ç ^ µ ????)
As I mentionned before, be aware that only one wrong file is able to make the whole music library crash, so you'll have to search and find that (or those files)... and share your findings with us
I'm sure this will get a fix sooner or later.
rzasharp said:
Take it easy. I definitely agree with you that something is wrong with the Sense music player, but until HTC really fixes this, we'll encounter various issues. You have to understand that only one wrong file will make your player crash and act exactly as you observed: playing any mp3 for few seconds and then stop. Let's make it clear. If you have only one wrong file in the whole library, not only will this particular file be impossible to play, but the whole library as well won't be able to play!
What do I call wrong files? I'm referring to the files not respecting the characteristics I described previously (TAG => more info here, if you don't know what I'm talking about). What is certain is that some "wrong" characteristics, other than MP3 tags, will make your play crash, that is for sure.
First things first. Did you at least try a softreset? Even so, I observed that the soft reset will "solve" the problem as long as the problem is related to MP3 TAGS. But I already experienced freezes and crashes even after a fresh softreset. This means that some "wrong files", not necessarily badly tagged will make the player crash, that's for sure. I still haven't found answer to that...
What you should do, as someone mentioned, is avoid putting your files in the same folder. As I always listen to full albums, already arranged in specific folders, I might have not experience bugs related to this issue.
Read the above message and answer these questions:
- Do you still have the problem after a softreset?
- Do you still have the problem if you only have few mp3 on the SD card?
- Do you have a lot of files in a unique folder?
- Do you have other music filetype?
- Look for specific characters in the TAGS, maybe other characters are not supported (; ~ \ ç ^ µ ????)
As I mentionned before, be aware that only one wrong file is able to make the whole music library crash, so you'll have to search and find that (or those files)... and share your findings with us
I'm sure this will get a fix sooner or later.
Click to expand...
Click to collapse
thank you for making my angry-heart slower (to 100 bpm, its normal for me).
at end, i delete all mp3s and try it with only one mp3 - to see that the player really function is o.k.
change all like you say (make filename smaller and this time without underscore "_").
and what can i see ... time is more than 5 seconds ... 8 seconds ... 15 ...
o.k., now i will test with my other mp3s (all together are max 1,2 GByte and not more than 30 files ... )
thank you
cant believe it ...
change my other mp3s as same as above i describes,
but more than one title the player makes the same shi.. as before.
i check all and find only one different thing in the list:
i have some mpegIII, mpegII and mpegI mp3-files.
could this a problem for the player?
okokur
okokur i have the same problem as you - the player will play a song then once the update circle has finished spinning does the player crash. You have to press pause/play numerous times to get it to start again and then the whole cycle repeats. I have tried everything. Formating, folder by folder transfer - nothing works. Until I change the ROM to something else by another Chef - then it works. Go back to the old ROM - Bang dies again.....I've looked at reg settings etc and cannot see any difference - this is very confusing/frustrating and annoying!
same prob as above have a 8 gb sandisk that came with the phone.had 5 gb of wma all good then added 1.2gb of mp3 then did some cover art updating and bang sense player now crashes.....play/pause button to resume and good for 30 secs and bang same prob......also have a "sandisk" 8gb from thailand that the phone doesnt even recognize....note the both worked in my hermes.
embedded meta data has always been a source of problems, especially when mixed with the literally thousands of different encoding variables. I once spent two days trying to figure out a winamp problem that eventually turned out to be a single track with a non standard character in the 'notes' field of the tags. (damn those stupid kids filling napster with tracks full of tags like '®¡pp€¤ 8y $p&®kz' )
Same goes for videos, try opening a folder with a hundred avi files in vista with preview turned on. takes forever.
I haven't had ' too' much trouble with the media player on here, and if it is tag related then it makes sense cause a year or so ago I used a multi file tagger to remove everything but title album track and artist fields.
(I guess my long winded story just ads a little weight to the tags theory)
I wish to confirm the UTF-8 UTF-16 issue.
None of my cd-ripped in WMP (windows 7) music plays on the HD2 and even makes my HD2 to badly respond (slow).
I noticed some downloaded files did play.
For the cd-ripped trakcs I noticed that the filename was given instead of the Title/artist. It was clear to me that this is a tag issue.
I found this thread and tested to save the ID3 tags in UTF-8 instead of UTF-16 and indead my tracks are playing now.
It is clear that the HD2 does not support UTF-16 and this is very annoying.
I believe, but thats a suspicion only, the problem lies in the combination of ripping cd's in to WMP Windows 7. Posibly Win7 WMP started using UTF-16???
I reported the issue to HTC NL, but the find it weird they do not have many calls for this.
Posibly this is because I belong to the few persons that still buy CD's, use Windows 7 and wants music on their HTC phone
Is there still no fix for this????
I have 14gb of music on my sandisk micro sdhc
all ripped with winamp flac format
my new htc legend wont play any of my music
so i re-ripped it all to mp3 format, and used mp3 tag, now htc player finds about 6-10% of the music on the disk
POS phone!!!!!!!!!!!!!!!
HTC is fixing nothing (or not much) for the HD2. I believe they have disabandond the HD2 and are focussing on delivering the HD3 with Windows Phone 7.
Hoping that every HD2 user will buy the HD3 out of frustration.
The HD2 is/was a promissing machine, but HTC sense is so buggy that its unsuable 3x resets a day is way to much. I purchased the replacement shell from SPB, my HD2 is now working reasonably normal.
What I do is, after syncing (I use WMP7 for that) the SD card (in the HD2) , I scan my SD card with a soft called MP3 tag (www . mp3tag . de/en), select all files and click on the save button to save the tags.
My MP3 tag is default set to ID3V2.3 ISO-8859-1 (if I'm not mistaking).
So it saves the tags in a format that the HD2 understands.
I have the same issue with my Car Radio.
I need to do this everytime I sync my HTC SD card.

[Q] How to cancel file association with certain program

How do you change/edit file association with certain program?
Usually if you have more than 1 program that can handle certain type of files, you get the selection to choose which program to use to open that file.
If you also select the check box below it, it will not ask you anymore next time you open the same type of file.
But, how do you edit/change that selection in the future?
I associated AVI files with QQPlayer and it actually makes it default for all my other video files and I found it not very smooth. Some other players play other format much better, and I want to change it back.
Just have not found a good player for AVI files yet. Really surprised provided this format (AVI) is used by Canon cameras.
lie_ui said:
How do you change/edit file association with certain program?
Usually if you have more than 1 program that can handle certain type of files, you get the selection to choose which program to use to open that file.
If you also select the check box below it, it will not ask you anymore next time you open the same type of file.
But, how do you edit/change that selection in the future?
I associated AVI files with QQPlayer and it actually makes it default for all my other video files and I found it not very smooth. Some other players play other format much better, and I want to change it back.
Just have not found a good player for AVI files yet. Really surprised provided this format (AVI) is used by Canon cameras.
Click to expand...
Click to collapse
as far as i know, you have to clear defaults for the program. It can be done under settings applications manage applications, click on the app and click clear defaults

Audiobook Streaming on JellyBean - Solution without ROOT access

This outlines a solution to people with Android 4.1 and above who previously could stream their Audiobook collection to their Phone/Tablet using ICS or earlier.
There are a lot of threads about 'user access' to CIFS/SMB having been 'broken' in JellyBean, and giving very useful suggestions to fix this, but all seem to require a 'rooted' device. I suspect in most cases it is the inability to select and stream Audio/Video files from a networked source which is a main cause for concern.
This solution will work without root access.
Prior to JellyBean one could often point an Audio Book player to a shared folder on a computer or NAS, and access a collection of audio files from a folder on an external device. This is no longer possible for most of the players currently available.
I recently bought a Tablet running Android 4.2.2, and have tried many players, up till now, without success. Of course one can still transfer all files for a particular book to your device, and play them that way, but this is wasteful of time and device memory if you have your collection on a networked system.
Some 'File Managers' can access your networked audio/video files, but invariably will stop playing at the end of the selected file. Not much good for Audio Books.
Today I found a free App that solves this issue.
'Network Audio Player', (NAP) available free from PlayStore has built in CIFS/SMB networking capabilities.
It will identify your network WORKGROUP, and you can select/play individual files, and more importantly a whole directory for addition to the programs 'Playlist'.
The program remembers the last file and it's position, essential for listening to Audio books, and you can quickly manipulate your files. Audio files will play in the background.
The only thing it lacks is a 'sleep timer', which is very useful for book listening. All is not lost, however, there is another free application available to do this, called 'Sleep Timer'. So once your Audio Book is playing, just open 'Sleep Timer', set how long you want it to operate, and at the end of that time it automatically 'pauses' the audio play.
The 'Network Audio Player' interface is not, in my opinion, as easy to use as a dedicated Audio Book player, but not difficult. The 'trick'' is to select 'Network', then navigate to the folder containing the audio book you want to listen to , but do NOT open the folder. Highlight the entry, with a long press, then select 'Add to playlist'. Then select the Playlist option, and choose your file where you want to start. Finally select 'Playing' and all the controls you need are displayed, including volume and position sliders, plus play/pause and navigation buttons.
The above is equally applicable to music files of course.
Owners of Archos Tablets already have network (SMB) access via 'Archos Music', and this is also available as a 'paid' App. This is mostly satisfactory for Audio Books, in combination with 'Sleep Timer', but it does not remember the last track/position once it has been closed, so not ideal.
Playing video files via a Network, on JellyBean is catered for by many available standard File Apps such as Easy File Explorer, where the playing of just one file at a time is less problematic than accessing the multiple files of an Audio Book. Once Again, Archos Tablets have the Archos Video Player as standard, which allows the viewing and playing of network share files. It too can be purchased as a paid APP.
I hope this proves useful to Audio Book fans. It solved my problem very nicely.
Quick Update
The Network Audio Player now has a built in Timer.
As far as I can tell it is still the only App that has built in cifs/smb functions, which will operate on KitKat and later, allowing network access, selection and playback of Audio Book files/folders without having to download them to your device first.
Although it is still advertised only as a music player, it functions excellently with Audio Books.

Which Record Audio format to use, base64, and stopping on silence.

I want to records short audio on the Android and recognize it with google cloud. The idea would be to stop the recorder when there is a pause, or after a few seconds or so, whichever comes first. I tried the built-in speech recognizer, but it no longer seems to support stopping the listener at will, and instead waits for 5 to 6 seconds after the last utterance before stopping, which makes it unusable to me. Further, i may want to temporarily store the audio files.
Some testing with google cloud speech shows promise, and now i want to record the audio in a supported format. Google speech recognizer lists supported encodings here and MediaRecorder here. The only overlap seems to AMR_WB. The speech recognizer recommends using lossless, where available.
So, that leads me to AudioRecord (i'm not quite sure why i didn't start there in the first place), with a lot more formats available.
One more point, is that the speech recognizer request (ultimately to be made from a separate system) can be sent with Base64 encoding (as opposed to saving the audio file on the google cloud).
I have three questions right now:
Which audio format does it make the most sense to use?
How do i encode it afterwards in Base64?
How do i stop the recorder when the user stops talking or after a set amount of seconds, whichever comes first?

Categories

Resources