microphone

Android: sample microphone without recording to get live amplitude/level?

妖精的绣舞 提交于 2019-11-27 18:02:50
I was trying to get the amplitude level of a microphone on Android like so: MediaRecorder recorder = new MediaRecorder(); recorder.setAudioSource(MediaRecorder.AudioSource.MIC); Timer timer = new Timer(); timer.scheduleAtFixedRate(new RecorderTask(recorder), 0, 1000); private class RecorderTask extends TimerTask { private MediaRecorder recorder; public RecorderTask(MediaRecorder recorder) { this.recorder = recorder; } public void run() { Log.v("MicInfoService", "amplitude: " + recorder.getMaxAmplitude()); } } Unfortunately, this only returns 0 all the time. It appears that for this to work I

Capture a Microphone Audio Stream Using .NET Framework

柔情痞子 提交于 2019-11-27 14:44:33
问题 I need to capture the input stream from a microphone in my application, which is written in VB.NET. I need to be able to stream this data to a file or over HTTP and possibly encode it using LAME MP3. Can anybody help me get started with this? Thank you! 回答1: If you want a .NET solution, you can check out NAudio which is an open source audio library. Look at the WaveInStream class (or WaveIn in the latest code). This will let you open a microphone, and receive events containing the latest

Forcing iPhone Microphone as Audio Input

亡梦爱人 提交于 2019-11-27 14:26:36
I am developing an iOS application (targetted specifically for iPhone, at the moment) that requires the application to record audio only from iPhone internal microphone (even when headphone/headset is plugged in), and playback at headphone (let's assumed headphone is plugged in for now). I am wondering if this is currently possible with the available APIs? If so, can anyone please shed some light on how do I go about doing this? Thanks! I believe the answer to this question to be 'no'. I used an iPhone 4 and the new-to-iOS 4 AVFoundation to experiment, focussing on the AVCaptureDevice class. I

How does setMicrophoneMute() work?

谁都会走 提交于 2019-11-27 11:41:20
I have been trying to use Android's AudioManager.setMicrophoneMute() without much success. That is, it simply refuses to mute the microphone, no matter what I do. I searched the web for some clues and I found several references reporting similar experience: AudioManger.setMicrophoneMute functionality not working?? setMicrophoneMute(boolean) doesn't work on some devices Unable to mute the microphone in Android Which begs the question: Does AudioManager.setMicrophoneMute() work at all? Is it only a stub method, waiting to be implemented in some future version of Android? If not, how does it work

Java Sound API - capturing microphone

落花浮王杯 提交于 2019-11-27 11:08:26
I have been reading up on the Sound API for Java for a couple of days I am unable to make sense of it. I am decent programmer, I just having difficulty getting my head around the API. I have been trying to capture audio from my microphone and display a wave graph in real time. I am having trouble capturing audio, they say in the tutorial to do this, but I cant seem to get it to work. Any suggestions and help would be much appreciated, a line by line answer would be ideal. Please and thank you. import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioSystem; import javax.sound

How to access the second mic android such as Galaxy 3

送分小仙女□ 提交于 2019-11-27 07:09:05
A lot of smart phone now have more than one microphone. One for voice input and another for reducing the enviroment noise. I am wondering how could I access the two microphone's signal independently? Or turn off one of the microphone? Any thoughts or comments are welcomed. Thanks a lot. I'm not familiar with the Galaxy S3 specifically, but the following is true for the majority of devices I've worked with: There's no reliable way of selecting whether to use the primary or secondary mic for a mono recording. The MIC AudioSource usually means the primary mic when doing a mono recording, and the

How to addTrack in MediaStream in WebRTC

放肆的年华 提交于 2019-11-27 02:09:15
I'm using webrtc to communicate between to peers. I wan't to add new track to old generated stream, as I wan't to give functionality to users to switch their microphones during audio communications. The code I'm using is, Let "pc" be the peerConnection object through which audio communication takes place & "newStream" be the new generated MediaStream got from getUserMedia function with new selected microphone device. var localStreams = pc.getLocalStreams()[0]; localStreams.removeTrack(localStreams.getAudioTracks()[0]); var audioTrack = newStream.getAudioTracks()[0]; localStreams.addTrack

How to record audio on webpage (iOS, Android, PC/Mac) - no flash

孤人 提交于 2019-11-27 00:14:53
问题 I have a requirement to allow a user to record an audio file using their microphone, but it has to work without flash as it needs to work on iOS (mobile safari), Android browser or Chrome, and a modern browser on a PC/Mac. Is there a clean, simple HTML5 method for recording audio and posting to a server? I haven't been able to find anything. 回答1: You can use the HTML5 WebAudio API. An introduction to audio and video capturing Capture audio & video in HTML5 A good library to record audio with

Detect tap with pyaudio from live mic

蹲街弑〆低调 提交于 2019-11-26 21:39:49
How would I use pyaudio to detect a sudden tapping noise from a live microphone? Russell Borogove One way I've done it: read a block of samples at a time, say 0.05 seconds worth compute the RMS amplitude of the block (square root of the average of the squares of the individual samples) if the block's RMS amplitude is greater than a threshold, it's a "noisy block" else it's a "quiet block" a sudden tap would be a quiet block followed by a small number of noisy blocks followed by a quiet block if you never get a quiet block, your threshold is too low if you never get a noisy block, your

How get sound input from microphone in python, and process it on the fly?

霸气de小男生 提交于 2019-11-26 21:24:18
Greetings, I'm trying to write a program in Python which would print a string every time it gets a tap in the microphone. When I say 'tap', I mean a loud sudden noise or something similar. I searched in SO and found this post: Recognising tone of the audio I think PyAudio library would fit my needs, but I'm not quite sure how to make my program wait for an audio signal (realtime microphone monitoring), and when I got one how to process it (do I need to use Fourier Transform like it was instructed in the above post)? Thank you in advance for any help you could give me. jbochi If you are using