I want to record audio and save to my server as mp3 files, i googled and find like this
But it is not free and open source
How can i record audio as mp3 in java and php ?
In terms of Java, you could record with standard Java sound and then use something like lameonj to do the mp3 encoding - all free tools!
This question is the same as yours and the person was able to come up with a solution (which he posted as an answer).
A little additional information. It is possible to record sound in an applet. See this page for information on Java Sound and applets. You'll need to sign your applet, which isn't hard to do. The answer to question 5 doesn't mention this but you can create your own (untrusted) certificate with which to do the signing. This question here on SO has some information on self-signing code.
I solved my problem, I used lame library to encode mp3, If you want to pure code to encode mp3, you can use this
Its using java based lame library
Related
This question already has an answer here:
Prevent Mp3 file to play in another Media player
(1 answer)
Closed 9 years ago.
I am needing to build an Android application that has music/audio files downloaded from a webservice and ultimately stored on the filesystem for playing within the app, but I need to prevent the user from being able to access and play the files, rooted or not.
My first instinct is to encrypt them before storing to the filesystem, but I'm not sure which encryption algorithms I should be focused on, as well as whether it makes a difference that these are binary files being encrypted vs. plain text files (I'm reading posts about encryption not working correctly for audio files).
Is there a better way to approach this kind of thing? I see a similar question to this has been asked, but it unfortunately has no solid answers:
How can I store music on an android phone without allowing the user to be able to download it and use it?
My apologies if I have overlooked how this can be accomplished. Any advice would be greatly appreciated!
You are asking how to create a DRM system. It is a controversial topic, and there is no direct answer. The site Defective by Design discusses the negative aspects to DRM systems from the perspective of the user.
The answer to your question really depends on how you define "the user". If you mean the average, ordinary user, you could really encrypt the file any way you like. Even something as trivial as XORing the file would work.
However, if the "user" you are talking about is a determined individual with a decent amount of knowledge and technical aptitude, the simple answer is that you can't. It is trivially easy to get the java source out of a .class file so anyone who really wants to get at those files can look at your code to find out how you encrypted it and then reverse engineer it.
Simply put, if your client can read the file, any user who has the client can read the file (with or without using your client).
Is there a JAVA library/class which provides parsing capabilities for Flash cookie files (.SOL) by any chance?
The user case scenario is quite simple:
Given a *.SOL file I need to read all the text info (programmatically).
PS.: From a similar question someone figured out that SOL files format is based on AMF, however I would like to know whether Adobe has opened the format or not.
Thanks a lot,
--Max
Any of the following libraries claim to do the work:
AMF48AMF Encode/Decode Library for Java
http://amf48.develop.jp/en/download
AMF-serializer
http://code.google.com/p/amf-serializer/downloads/detail?name=amf-serializer-1.0.0.zip&can=2&q=
Open AMF
http://programmaremobile.blogspot.com/2009/10/java-and-amf-by-as3-in-flash.html
Not that I am aware of.
I'm not sure if it's an open format or not but this software certainly seems to read them from the harddrive
http://www.nirsoft.net/utils/flash_cookies_view.html
More info on wikipedia including a list of software reading them
http://en.wikipedia.org/wiki/Local_Shared_Object
this claims to translate sol files to xml... you might be able to use this easily in Java
http://osflash.org/s2x
Is there any freely available library (other than java media framework) that I can use to extract the bit rate (eg. 128 kbps, VBR) and the audio quality (eg 44.1KHz, Stereo) from a MP3 file?
I would like a standalone library that I can incorporate into my application jar, to be deployed on older Macs too that have only Java 1.5 available and I can't get them upgraded or add any big Java library to.
Just to clarify: I will not play, transcode or do anything of the sort with the audio stream itself, I am interested in the metadata only.
I confess I do not know much about MP3 files, but you can see from the format specification that all the informations needed are in the 32 bits long header of the file.
You could open the MP3 with a FileInputStream, read the first 4 bytes of the file and, using some simple binary masks, retrieve the informations you need. IMHO using a specialized library for that is a bit of an overkill.
Take a look at JAudioTagger, plain simple and easy to use, the data you are looking for is into MP3AudioHeader class, with methods like getBitRate()
You can use the LAMEOnJ library:
http://openinnowhere.sourceforge.net/lameonj/
This java library is light but you must have the LAMELib installed on target computer.
I'm not a java programmer, but i'm pretty sure you could read the mp3 file into a byte array then see http://www.mp3-tech.org/programmer/frame_header.html for frame info.
This format specification shows you what's contained the MPEG (mp3) header. You can write code to retrieve this header.
Hey all, i'm new to web development so i'm really dumb when it comes to tools for working on it. I have .amr files recorded from my BB application that are sent and saved on a server. I want to be able to play these files via a webplayer on a website, I have a couple of questions regarding this:
1) Would it be sound to convert these files to something like mp3 o wav instead of trying to play using the amr format? The sound files are received by a java web service and saved as files on my hard drive with the URL saved on a MySQL database. So if a conversion method is suggested I would prefer it be in Java.
2) What player can I use and how, to play these files? Be it the amr files or converted files
3) How can I create a link that will point to said audio file so people can go to it and hear it? I know this differs a little from my original question line but I have to able to do it as well.
thanks in advance
1) MP3 or wav would be a good idea. You could use something like LAMEonJ (http://openinnowhere.sourceforge.net/lameonj/) for wav -> mp3. And with luck there's something similar for AMR.
2) Is the <audio> tag in HTML5 likely to be an option? The users could then play the file directly in the browser, and you could just render HTML on the website, rather than providing it through a webservice.
I think you are suggesting an applet on a web page, that connects to the server via a webservice, which would certainly be possible but a lot more work.
Otherwise, if you're just serving a music file, you're not going to be able to control what player is used on the client side, once they have your file they can do with it whatever they like.
The only down side of HTML5 is that they'll need a relatively recent browser.
3) If you're using <audio> then this is already taken care of.
If you google for the <audio> tag I think you'll find a lot of information,as well as strategies for providing alternative players to older browsers.
I am looking for a 100% Java solution for encoding software generated images into an AVI stream together with an uncompressed audio track.
At the moment I am using JMF, but its size and installation problems make it a bad solution for my purpose.
While it does not support audio, I created an MJPEG AVI Java class some years ago. You basically just tell it the resolution of your output video, along with the frame rate, then you just keep adding images to it. When you are done, you tell it to finish and it'll close out the AVI. It is based off of the Microsoft documentation on AVI, RIFF, and BITMAP file formats.
Other than not supporting audio, the only real problem is it implements the version of the AVI format limited to 2GB per file. While the class will write out a much larger file, I am uncertain that any players or video editors would be able to read it.
The way I've used this code in the past, is to generate an MJPEG AVI for processing in a video editor (adding audio, etc. in the editor). It helped me with automating some tedious slide show generation. Not sure if this code will help you, as is, but it might help if you are trying to roll your own solution. MJPEGGenerator.java is available if you are interested!
You can use JMF, see this nice example.
There is a nice blog entry here:
http://www.randelshofer.ch/blog/2008/08/writing-avi-videos-in-pure-java/
By Werner Randelshofer