iOS line in via headphone jack (adapter?) - iphone

I want to record an audio signal with my Audio Unit on my iPhone which comes from a normal 3.5mm audio cable (e.g. with another iPhone acting as sound source).
A direct line-in is not possible, because the iPhone has a 4 port headphone jack.
I tried different kinds of these adapters:
http://www.amazon.com/StarTech-com-headsets-separate-headphone-microphone/dp/B004SP0WAQ/ref=sr_1_3?ie=UTF8&qid=1446196112&sr=8-3&keywords=3.5mm+headphone+mic+splitter
But none of these worked.
Am I doing something wrong?
What else could I try?
Thanks a lot and have a nice day!

You have to match the expected impedance for the microphone. Otherwise the device treats it as if it weren't there. Check this out for details.

Related

Objective-c re-route audio input from bluetooth HFP to mix with audio out the headphone jack

I am trying to implement a feature in Objective-C where the use case requires the user to speak into a Hands-Free bluetooth headset and have their voice mix with an audio file and play both over the headphone jack.
I have the program working and will allow mixing of microphone and audio over the HFB, or using a wired microphone. But the audio always plays the same place as the microphone source. I cannot find a way to override only audio output to the headphone jack.
I used the following code, which I found in the documentation to override output to the speaker, but I cannot find one to force audio to the headphone jack:
[[AVAudioSession sharedInstance] overrideOutputAudioPort:AVAudioSessionPortOverrideSpeaker error:nil];
Another problem with the above line of code is that it overrides input and output to the built in speaker and built in microphone.
Back to my use case - I need to use hands free bluetooth to voice over audio going out of the headphone jack. Any ideas how this can be implemented?
I have a very similar use case but after searching the Apple Documentation and speaking with Apple directly, it's not currently possible to set the input and output data sources/ports independently.
Per Apple's documentation:
https://developer.apple.com/library/ios/qa/qa1799/_index.html
If an application uses the setPreferredInput:error: method to select a Bluetooth HFP input, the output will automatically be changed to the Bluetooth HFP output. Moreover, selecting a Bluetooth HFP output using the MPVolumeView's route picker will automatically change the input to the Bluetooth HFP input. Therefore both the input and output will always end up on the Bluetooth HFP device even though only the input or output was set individually.
Submit a bug report to Apple. They may change it if there are enough complaints.

iOS capturing audio via jack port

I know ios audio programming can route the audio signal to headphone jack port instead the speakers.
But How to treat the headphone jack port as input mic (and be able to capture the signal)?
is that possible?
this is what I need
cool video explaining what I need
thanks in advance
Dario
Apple has a nice demonstration project about using Audio Queue Services
http://developer.apple.com/library/ios/#samplecode/SpeakHere/Introduction/Intro.html
I would suggest going through this project, and it should show you what you need.

Sharing Audio over bluetooth

I want to write a function in my iPad App, which allows me to stream the music choosen on iPad to the connected Game-Interfaces (iPod, iPhone...) via bluetooth. Does anyone knows a simple solution or maybe wants to share some sample code?
Thanks for help!
I am doing something very similar. I have my iphone connecting to multiple devices to stream audio to them, but I want the device that is streaming the audio to also play audio as well.
You can look into the GKSession in the GameKit API and that should give you a good start.
Also maybe openAl, but I think that might be a little overboard. I heard Core Audio has a built in feature for bluetooth devices that are connected to play audio through them but I dont think this goes for iPhone, iPad, iTouch etc....
I have also created my own peer connection interface that allows me to see multiple bluetooth devices that are running my app. I then can click each one and each gets connected. I then I added a test to push a text message to all connected devices for testing. Next I need to find out how to stream audio to the connected apple devices.
If anyone has any info on this I am sure we would both appreciate it.

Outputting sound using multiple audio routes at the same time in an iPhone App?

I'm playing around with audio routes in AVAudioSession at the moment and I'm wondering whether it is possible to output sound to multiple audio routes at the same time i.e. a sound playing from the speaker and a different sound playing in the headphones? Ideally I'd like to be able to play separate sounds via a dock connector (using a 3.5mm jack adapter) and the headphone jack at the same time so if someone could tell me whether or not this is actually possible that would be a great help.
Thanks
I don't think it was possible three years ago when you wrote this, but it is possible now to play one sound through the headphone jack and another through a USB audio interface connected to the dock connector. This WWDC presentation walks you through it and provides sample code.
I don't think it's possible to play separate sounds through the headphone jack and the speaker because the AVAudioSessionRouteDescription only shows one of these built-in output ports at a time. You'd have to add a second audio interface via USB, which adds a second output port to the AVAudioSessionRouteDescription. I'm testing with a Roland Duo-Capture mk2 right now and it's working.

Read from "output" as from "input"

Some on of you saw this.
So the question is, how to access mobile audio out in read mode?
Thank you!
That's fundamentally impossible, at least from the level of a software application (it could be possible in hardware or even firmware). That device works by taking advantage of the microphone jack included in the headphone jack. The hardware communicates with the application via an audio signal that is read from the microphone input.