MediaPlayer.snoop on android - java

I found the function MediaPlayer.snoop(short[], int) in Accessing the Android media stream for audio visualization but I couldn't use it.
I am wondering there is a method snoop in MediaPlayer.class.
Looks it is not public method but private one of MediaPlayer.
If there is how can i get audio stream from that method.
Thank you.

Look at the GrabAudio class of this open source wallpaper app,
https://bitbucket.org/Metastable/deadmau5-audio-visualizer/src/249150da7cfa2c20e8d1456a31aaabd46df6d26d/src/com/metastable/deadmau5?at=default
This is a magic class that will get tons of audio data. Very useful source.
This is the other open source app that you can look at but it doesn't seem to get audio data from the output, it just loads a media player and analyzes that one.
https://github.com/felixpalmer/android-visualizer

Related

How to Create a Video from a BufferedImage List?

I'm trying to create a Simple Recording Software, so i Created a List<BufferedImage> for Storing the Frames, so how do i convert this in a Video? Most of the Stuff that i found is About Xuggler(That is very dead) and i also want a method that allows me to add Audio to the Video
i didn't get any responses so after a pretty long time searching i solved it with ffmpeg

Is there a way to read Raw midi data in java?

Using javax.sound.midi i've managed to open my midi device up for outputting a .midi file in the past but the issue is i need to be able to pickup the midievent in it's raw form as in "3C40"/"903C40".
I'm able to find documentation on opening transmitters/receivers/sequencers but no code examples using these to output to say a string as the raw data from the midi device example of which is my yamaha ypt-240
digital keyboard.
Basically the reasoning behind why i want this raw data is to make some simple keybindings that would be triggered by said raw data from the midi device almost like a stream deck or using software that allows this.
The ShortMessage seems like the way to go but again can't find any code using it the way i would like to.
Every example is mididevice||file.midi -> synth||mididevice
I need a way to intercept that input java is getting from the device...
please help lol

Using MediaRecorder.AudioSource.VOICE_DOWNLINK in Google Cloud Speech API(Android App)

I'm developing an Android app that displays the text of voice of other party who's in the phone call. I'm using Google Cloud Speech API. I think I've two options:
Record Audio of other person(in regular intervals) and send it through API as InputStream and receive the corresponding text.
Change this line of code to something like MediaSource.AudioSource.VOICE_DOWNLINKwith proper AudioFormat Encodings.
In the first case, mApi object in SpeechService.java is becoming null (Although in onPostExcute() method, mApi isn't null. I'm sure I'm calling recognizeInputStream() method after mApi is assigned. I don't know what's wrong here.
In the second case, I don't know if it possible to change AudioSource from MIC to VOICE_DOWNLINK(I got Invalid Audio Source Error, when I changed). If it's possible, I don't know proper AudioFormat settings (like Channel and Encoding). Do I have to direct BroadcastReceiver method to make this case possible?

vlcj - audio callback

I need audio data callback while vlcj is playing the video file.
And then I want to add some effect (pitch shifting, etc..) on that audio and direct sound out.
I found vedio buffer call back in vlcj documentation, but not audio callback.
if i can get the audio callback, i can use other library such as soundtouch, etc...
or please let me know other alternative like as vlcj.
i just success with nVLC + NAudio on Windows.
It is possible with vlcj? Should I use gstreamer (gstreamer-java) or MPlayer?
regards,
-pph
vlcj 2.4.0 adds a new DirectAudioPlayer and associated DirectAudioPlayerComponent.
and sound touch wrapper
http://www.aplu.ch/home/apluhomex.jsp?site=44
make me complete.

Recording audio in android

I want to record own voice or any through mic(In any way) into a file in my project and want to read later and listen to it.How can i do this? Anyone reply me please.
http://developer.android.com/guide/topics/media/index.html
About 3/4 the way down the page you'll see
Performing Audio Capture
Audio capture from the device is a bit more complicated than audio and video playback, but still fairly simple:
Create a new instance of android.media.MediaRecorder.
Set the audio source using MediaRecorder.setAudioSource(). You will probably want to use MediaRecorder.AudioSource.MIC.
Set output file format using MediaRecorder.setOutputFormat().
Set output file name using MediaRecorder.setOutputFile().
Set the audio encoder using MediaRecorder.setAudioEncoder().
Call MediaRecorder.prepare() on the MediaRecorder instance.
To start audio capture, call MediaRecorder.start().
To stop audio capture, call MediaRecorder.stop().
When you are done with the MediaRecorder instance, call MediaRecorder.release() on it. Calling MediaRecorder.release() is always recommended to free the resource immediately.
Followed by code showing exactly how to store audio input and play it back, hope this helps. (I tried to paste the code here but pasting from android's guides is difficult)

Categories