Recording audio on Mac - cocoa

I am developing an application which access my audio input device and record audio from my microphone.
Here when i am pressing START button it have to record audio from microphone and have to stop recording when pressing STOP button.
My device is Lynx-AES16 and i got driver from there site.
In windows i am accessing the machine(Lynx) by using direct-show SDK(Graph edit). 
Is there any similar tool  like direct-show is available. I checked with AUAudio and IOkit but didnt understood that much.
Can anyone provide some sample or some useful links. Apple link is not good for a starter 

Look at the CoreAudio sample code at developer.apple.com. There is plenty of useful code there.
In particular look at the RecordAudioToFile example.

Related

Playing audio while dictation is active in Mavericks

In Mavericks Apple introduced "Enhanced Dictation" -- an ability to transcribe speech into text locally, in off-line mode. Unfortunately, they also introduced another feature -- while the dictation is active, all the sound is muted. A bit of digging around turned out that the "muted" sound is still being played. For example, Audio Hijack captures the sound as it should be played and saves it into a file. I'm making an application that requires sound output during dictation (I'm assuming that the user is wearing headphones). It does not look like they change the volume settings: querying the master volume level on the headphone device shows that it is the same before and during dictation. The Sound volume indicator in the menu bar does not change either. As far as the rest of the system is concerned the sound is playing.
I'm a CoreAudio noob. I can do basic things with recording and playback, but not much more. Is it possible to get the "muted" sound back? Is there a switch, a flag, a feature in CoreAudio that would enable the sound from my application to reach the headphones with the dictation active?
For people who would stumble on this page: I did find an answer eventually. You can disable audio ducking by setting the following user defaults:
defaults write com.apple.SpeechRecognitionCore AllowAudioDucking -bool NO
defaults write com.apple.speech.recognition.AppleSpeechRecognition.prefs DictationIMAllowAudioDucking -bool NO
See the detailed explanation on Youtube.

Recording Audio Stream in Background in Windows phone 7/8

I m developing an app which can record audio stream.
I want to know that is it possible to record that audio in background, i,e when the application is in deactivated mode?
I have already tried to do that in many different ways,but its not helping out.
Please suggest me some way to do such...
Thank you.
As mentioned in the comments, it's not possible to record in the background.
Your app must be running in the foreground for it to be able to record audio using the microphone. For an overview of all the audio recording options, please refer to this tutorial on the Nokia Developer Wiki.
Also, an app will not run when the phone is locked - it is suspended. So if your app was recording, it would stop when the phone is locked. You can change this behaviour with IdleDetectionMode.Disabled which means your app keeps running even though the phone is locked.
Haven't implemented it before, but classifying it as a VOIP app could be the way to go:
http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj207046(v=vs.105).aspx

Audio recording problem

I am trying to use Apple's RecordAudioToFile and MyRecorder examples. The first example runs well and the file is recorded but I can't hear any sound. And the second example, when I press the Start button, it does nothing. I'm using a Mac Mini to record.

Device driver to act as a virtual web camera

I'm looking for writing virtual camera drivers. Does anybody has idea?
Any book that would be helpful or any link.
Adding more details:
I have developed a device driver which saves the image to disk and the display uses the device driver to display the image. The performance does not seem good.
The fns. that I have used are:
//to capture
GetDesktopWindow()
CreateCompatibleBitmap()
Save()
//to display
WM_MOUSEMOVE
giving a call to capture and display every time
but the display is not continuous and appears only after window goes out of focus and comes in focus again
Should I use some other technique to record or display images, what will give fruitful results, please help.
Thanks,
-mitesh
What do you mean by virtual camera driver?
It is possible to write a virtual capture device using DirectShow. Such a virtual capture device can then be used by applications such as skype, etc. If that suffices for your needs, you can download vcam from http://tmhare.mvps.org/downloads.htm under the "Capture Source Filter" link.
Edit:
In order to use that capture device in the link I posted you need to download the Windows SDK. The Windows SDK has a tool called "GraphEdit" If you search online, I'm sure you can find a quick GraphEdit tutorial. Basically GraphEdit allows you to construct a multimedia pipeline by connecting a bunch of filters. (This is what happens in the background for instance when you play a movie on your computer. ) This could be something like
web cam -> renderer
or
file source -> some decoder -> renderer
and would result in you seeing the video captured by the web cam or the content of the file. The example download shows how you can construct a virtual capture device i.e. it looks like media is coming from a 'real' capture device, but actually you can generate any video you want if you adapt the code to your specific means i.e. take a screengrab and output that. Applications like skype can pick up you virtual capture device if it is registered correctly.
The easiest way to find out if this is sufficient for your needs is to download the capture source filter, register it with the regsvr32 command, and then to use GraphEdit to insert the capture source into a graph, connect the source to a video renderer and hit the play button. A lot of the above mentioned concepts/keywords might seem new to you, but you can do some reading on each topic, and perhaps this will give you a point to get started.
Edit 2:
Is the capture source filter approach not sufficient for your requirements?
1) AFAIR you stated in your (now deleted) answer that you would like to take a screen grab, and use that as a virtual camera device for use in applications such as skype.
If that is all you require, you do NOT have to write a device driver. DirectShow can do that perfectly well by means of the capture source filter. You would then need to
learn some basic DirectShow
modify the source code of the capture filter to take screen grabs etc.
As far as books are concerned to write device driver to accomplish the same, I have no idea. The point I'm trying to make, is that you need to determine whether you actually need to write a device driver or whether simply modifying the open source capture filter is sufficient.

simple record and play application!

I am trying to make a simple application which will store the sound said by user , say on click of record button and will play it back to him/her , say on click of play button.
Can anyone suggest me some appropriate way to do this ??
Thanks,
Miraaj
You can use QuickTime Kit's capture APIs to record a movie of the audio, and QTMovie (from the same framework) to convert it to a more conventional format for audio files and to play back both the intermediate file and the converted file.
There used to be a QuickTime Kit Programming Guide, but it didn't cover capturing and is now gone from developer.apple.com. You should file a bug against the docs.
This answer will work in a Cocoa (Mac) app. If you meant to ask about the iPhone, you should re-tag your question, as the solution will be completely different for a Cocoa app vs. a Cocoa Touch (iPhone) app.
I used direct sound to create an entire internet phone application a few years ago. Your question is far simpler, you won't have to deal with the circular buffer as critically. Direct sound is pretty main stream and you can find a lot of help with it in forums, and it's free!

Resources