Sunday, June 24, 2012

How to allow Java access to recording devices through browser

So I needed to allow Java access to my Mac's mic and speakers through one of our websites at work. I was prompted to download a .exe file supplied by the vendor to allow access. Since I'm a Mac user, this wasn't an option.

The solution was simply as follows:
  1. Open up your Terminal.app
  2. Create a new file called .java.policy
mSergani:~ $ vim .java.policy
  1. Add the following to the newly created file:
grant {
    permission javax.sound.sampled.AudioPermission "record";
};
  1. Save the file and restart your browser.

I'm now able to record and play sounds through the browser, and so should you :)
This should work just fine on Linux as well.


Let me know if that worked out for you, if there are better ways to do the same!

No comments:

Post a Comment