How does one obtain the system sound, (beeps and such), and then record it and output to a sound file? I can get sound from a line - in mic, but I can't figure out how to get the actual system sound.
Any assistance?
This has been a long unanswered question which has been frustrating me as well.
I found a way to capture/record Windows' audio output, but it is more of a hack job rather then an actual solution. Disclaimer: This is my blog. I say this because from what I have found Java doesn't capture the data from a specified audio device [See the official Accessing Audio System Resources Java tutorial (although you can list out all of the audio I/O devices/audio ports, See: Programming JavaSound), instead it just takes the default device (which is how I 'solved' the problem).
This, however, introduces a problem where because the default recording device is no longer the microphone, you can no longer record from the microphone as another input; Although, using the Port.Info class to capture the microphone might be a possible solution to this side effect.
I hope this will help.
Related
I am newbie in android developing, I have searched for this question but i didn't find my answer.
I want to know is there any ability to edit the sound calls in android?
I mean i want to add noise or change sounds of caller, Is it possible to change the sound in calls or adding a new sound to it?
TL DR : The answer is not yet.
And it's not like we've been waiting. The first entry i can find is from July 31 of 2009, the issue #3434 and, as of today (May 13 of 2015) it's still has not been assigned.
It's really hard to actually work on low-latency project, audio recording and of course, voices changers when you can't do low latency.
Not to say there's hasn't been any workarounds, you could emulate yourself the call, and add the voice effect sure (build your own dialer, and work with that), but let me warn you : you probably won't have any good perfs when it comes to real-time appliucations. No low-latency means no efficiency when it comes to audio recording.
You'll have to wait then.
Your question can be resolved partially depending your using model. the premises are :
you just want to eject some noise into your outgoing audio stream,
not into the incoming audio stream.
you may use a third-party VoIP application to make the phone call.
or simply say, you just want the peer to hear some modified voice. it is feasible.
Normal a native phone application on Android platform uses "Android audio system module" in the framework, the vendor provided audio libraries and Linux ALSA audio libraries to transmit/receive the audio data. These .so and .a files are under the read-only mode normally and could not be overwritten by user, so you can not inject data into this data chain.
But you have more capability to manipulate the data if you use a VoIP application to make the phone call, some VoIP applications can give a real phone number, like Fongo, you can receive a phone call to that number, the caller does not know you are using a VoIP application to speak.
So if I was assigned to do this project, here are my steps:
find a usable and open sourced VoIP client on Android.
find the code to sample the audio data from microphone ,add the code
to manipulate the raw PCM data and send the result to audio encoder.
build and run it on Android
register or apply a phone number for this VoIP client.
done.
Hope it help
Well, i want to call from my code and when the other persons answered my call send a audio clip in the audio streaming, i was ready is possible but also that isnt, help please.-
So, multiple questions in one. I'll answer all of them, mostly so you can get the keywords you can search for.
Setting up a call programatically, perfectly possible and quite easy
Playing an audio file into the call, not so trivial. Using the Java API for Android, you just can't do it. Anyhow, you can create a C application which can play an audio file, use it in your Android app (NKD and JNI required here), and give it control of the microphone.
If you are comfortable using C and think you can learn how to use NDK and JNI, you can do it. If you're gonna need it to be done using Java... right now you will just not be able to do it.
pd: if you are thinking about playing a file in the speaker and hope it to get into the microphone, it won't work on most of the devices out there. There are quite good echo cancellation chips out there.
I'm trying to get the data that the soundcard is outputting. Unfortunately, from my understanding of the Java Sound API, SourceDataLine does not support the read method, and there is no way to listen for raw data. I want to stick to Java for this, rather than C++, so if anyone knows how to listen for audio output on the soundcard that would be great.
Thanks very much!
Sorry if this post is confusing, just woke up.
I've researched this a while, and determined any implementation using only java sound will not work with any reliability on multiple audio cards.
There are a few solutions though. Hopefully one of these helps you.
Bite the bullet, write some C++ code to allow this functionality on different operating systems.
Use Java Sound to capture audio from a virtual audio recorder adapter which loops back the system audio output.
Create a loopback yourself using cables to feed a sound output port into a sound input port.
I recommend option 1 if you're developing this for a professional application as installation will be cleaner.
Go with option 2 if you've a short amount of time, and you expect to spend more time with your users, or your users are tech savvy.
Use option 3 if this is just a hobby, or some one-off project for a client.
After extensive searches I can't find any information on how to detect the microphone sound level input in mac OSX using either Applescript or Java.
The purpose of this is to write an automatic volume adjust script based on the sound level detected by the built in microphone.
I know that commercial solutions exist but I'm interested simply as an exercise.
Just in case people think I'm posting on here just to make a statement I'm informed that I should add something to which a question mark can be added or people won't understand that it's a question.
I am after some example code in either java or applescript to show how to detect the microphone input sound level. Can anyone help with this?
set currentVolume to output volume of (get volume settings)
This is from a MacScripter thread that will probably answer some more of your questions on this project as well.
Is there a way to get the sound from the default audio output for the computer? I don't want to manipulate it, I just want to make a visual representation of the frequencies; much like an equalizer.
This question is duplicate of:
Real Time Audio Visualization Java
The java sound API lets you interact with the current audio output. You can find the reference here:
http://www.java-tips.org/java-se-tips/javax.sound/capturing-audio-with-java-sound-api.html
Mac computers do not feed audio output back into the computer for programs to access, and since everything in java has to work on both mac and windows computers, they cannot provide specific access to this feature to windows users either. Windows computers might provide an input device which you can access representing system output, I'm not sure about it, but you could find out with
AudioSystem.getMixerInfo()
It returns a list of objects containing strings for the name, description, version, and vendor of every available audio device. Printing these on a loop lets you look at all the audio devices. If none of them look like they could be the widows system output feedback then you are out of luck, unless you want to use native classes. I'm not going into that here but there is a good page about them here.