microphone

How can I check if a microphone is plugged into the iPhone?

非 Y 不嫁゛ 提交于 2019-12-01 09:29:11
问题 I'm using AVAudioRecorder in the AVFoundation framework. I'm wondering how I can check for a microphone device being plugged in (on the iPod Touch)? 回答1: Device Support section of the iPhone Application Programming Guide is your friend In iPhone OS 3.0 and later, use the AVAudioSession class to determine if audio input is available. This class accounts for many different sources of audio input on iPhone OS–based devices, including built-in microphones, headset jacks, and connected accessories

Measure speaker volume by recording playing sound with microphone

给你一囗甜甜゛ 提交于 2019-12-01 07:28:44
问题 I want to measure a system's speaker volume by playing a sound and listening for it on a local microphone at the same time. This is for a specific application. The exact recorded sound is not as important as differentiating between the microphone volume recorded before the sound is played and while it is playing. The idea is to warn the user if speakers are turned off or too low. How can I record a sound while playing it and determine a difference in volume? Are there are any managed

Check for mic permission on iOS 7 without showing prompt

陌路散爱 提交于 2019-12-01 05:59:09
问题 The only documented method for checking mic permission on iOS 7 that I could find is requestRecordPermission documented on AVAudioSession . https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVAudioSession_ClassReference/Reference/Reference.html#//apple_ref/occ/instm/AVAudioSession/requestRecordPermission: However, the very act of checking permission using this method will display an alert asking user for permission if user hasn't already made a decision, which can

How to detect user giving microphone permission on iOS?

≡放荡痞女 提交于 2019-12-01 05:17:43
So the thing is that I need to call some function after user gives (or declines) a permission to use the microphone. I already saw this: [[AVAudioSession sharedInstance] requestRecordPermission:^(BOOL granted) { if (granted) { // Microphone enabled code [self someFunction]; } else { // Microphone disabled code } }]; However, this works only to detect current state. If the current state is "no" and popup shows and user gives the permission - the function will not be called. That's because in the moment of executing this the permission was "no" and until we run the code next time the function

Which /dev/… (devices) are the microphone and speaker in Mac OS X?

梦想的初衷 提交于 2019-12-01 02:13:45
问题 I have a MacBook Alluminium and I want to capture the microphone in a RAW format and output a RAW audio through the speakers, in a standard way, i.e., using the terminal with standard Unix commands and using the standard /dev/??? devices. So, the question/s: Which devices are the microphone and speakers? Those both should start with /dev/... Are they different if they are built-in or external? Which ones? (Also they have to start with /dev/...) If you know also the unix commands to print the

Is it possible to share audio input (Microphone) stream in Android?

若如初见. 提交于 2019-11-30 21:18:17
I am writing an application that runs as a background service recording and analyzing audio recorded from the microphone. When my app is running I can't use other apps that use the microphone (e.g. phone, voice recording, etc...). My question is - Is there a way to share the microphone stream in Android? Maybe by using the NDK? If not, is it possible to receive an indication (e.g. a BroadcastIntent) that another app is requiring the microphone? Simple Answer would be "NO" , This is just because Audio Recording Method is synchronized. So Two or more resources can not attempt it simantenously.

How to adjust microphone volume in android?

五迷三道 提交于 2019-11-30 20:56:50
I want to recorder the sound, but the mic (microphone) input sound is too loud, and I want to adjust the mic volume, would someone help me? The following is the main code: private int audioSource = MediaRecorder.AudioSource.MIC; private static int sampleRateInHz = 8000; private static int channelConfig = AudioFormat.CHANNEL_CONFIGURATION_MONO; private static int audioFormat = AudioFormat.ENCODING_PCM_16BIT; audioRecord = new AudioRecord(audioSource, sampleRateInHz,channelConfig, audioFormat, bufferSizeInBytes); audioManager.setSpeakerphoneOn(false); When the microphone is open, it used the

How to mute microphone in Windows 7 with C/C++?

白昼怎懂夜的黑 提交于 2019-11-30 14:20:58
问题 I made a program to mute microphone using WinAPI and it seems to work perfectly in Windows XP but doesn't do a thing in Windows 7. Is it possible to control microphone volume or mute with WinAPI in Windows 7? void setVolume(DWORD volume) { HMIXER mixer; if (mixerOpen(&mixer, 0, 0, 0, 0) != MMSYSERR_NOERROR) { MessageBoxW(NULL, L"Error: mixerOpen()", NULL, MB_ICONHAND); return; } // Get the line info MIXERCAPS mixcaps; MIXERLINE mixerLine; mixerGetDevCaps(0, &mixcaps, sizeof(MIXERCAPS));

How to mute microphone in Windows 7 with C/C++?

混江龙づ霸主 提交于 2019-11-30 10:24:20
I made a program to mute microphone using WinAPI and it seems to work perfectly in Windows XP but doesn't do a thing in Windows 7. Is it possible to control microphone volume or mute with WinAPI in Windows 7? void setVolume(DWORD volume) { HMIXER mixer; if (mixerOpen(&mixer, 0, 0, 0, 0) != MMSYSERR_NOERROR) { MessageBoxW(NULL, L"Error: mixerOpen()", NULL, MB_ICONHAND); return; } // Get the line info MIXERCAPS mixcaps; MIXERLINE mixerLine; mixerGetDevCaps(0, &mixcaps, sizeof(MIXERCAPS)); mixerLine.cbStruct = sizeof(MIXERLINE); mixerLine.dwComponentType = MIXERLINE_COMPONENTTYPE_DST_WAVEIN;

How to record audio using audio api in Android?

南楼画角 提交于 2019-11-30 07:55:34
I have an LG Android Phone with Version 2.3.3. I need to connect a microphone in the headphone jack because I want to create an app that reads sound samples. How can I read samples programmatically?. If you really want to read AudioSamples, I would suggest you to use AudioRecord instead of MediaRecorder since it gives you more control on AudioSamples... For that you can use following code, AudioCapturer is my wrapper class which I use for getting the samples from AudioRecord object..IAudioReceiver is an interface which has methods for handling audio data. public class AudioCapturer implements