How to determine number of voices in one recorded file in cocoa? - objective-c

I want to extract the information such as how many voices as per person in one recorded file.
I know the NSSpeechRecognizer class to recognise the speech, but not able to get to know the number of voices in one recorded file.
Please provide some suggestion.
Thanks,
Yogesh Arora

Counting the number of voices requires segmenting the audio file and diarising the speakers, which is by no means a simple task. Cocoa doesn't provide an API for that, at least yet. There are some open-source libraries that might help. You might want to check the ALIZE toolkit, for example.

Related

comparing two audio files [duplicate]

I want to record two voices and compare them. I think there is some Apple sample code for voice recording. I have no idea about
comparing two audio files. What is the right approach for this? Is there any framework Apple provides for this purpose or is there any third party framework?
It's not in objective C, but it does contain some fantastic explanation about how audio is compared by Shazam, and includes sample code (and source for a working application) in Java:
Check this out
Additionally, This Question has a fantastic link to audio fingerprinting, which is essentially the same as the article above, but more in depth.
Hope this helps
I'm using Visqol for this purpose. If your audio files are generally not more than 10sek this could be something worth looking into. Also check ffmpeg library for converting the files into the desired format(Visqol will require certain sample rate depending if it is just music or speech).
https://github.com/google/visqol

Programmatically capture audio in OS X [duplicate]

I'm due to work on a small application that captures audio from the Mac's Audio Queue and needs to save it to disk in some reasonable audio format.
Does anyone have a some decent sample code (Cocoa / Objective-C) that they can share?
I specifically need to capture the audio that is being passed to the Built-in Output device in order to record it. Any insights? The answers so far have been helpful, but have not helped me understand how the data going to the output can be captured, agnostic of the input source.
Working with audio in Mac OS X involves interfacing with Core Audio. For a quick overview, take a look at the Core Audio Overview.
You will need to interface with the AUHAL to perform input and output; a technical note exists detailing the steps required to do so. This code seems to usually be written in C++, as that is the procedure taken in the SimplePlayThru demo.
This doesn't cover the actual steps required to capture that audio input. However, these links should provide you with enough sample code to begin interfacing with your input device. I'll post more links in this answer if I happen across them.
Take a look at /Developer/Example/CoreAudio/Services/AudioFileTools. Specifically, look at afrecord.cpp. Admittedly, this is not Cocoa per se; Cocoa itself doesn't seem to have any specific capabilities for recording. If you'll want to interface with the C++ file there, you'll likely need to write some Objective C++ like in SimplePlayThru.
There is a good example code at Ulli Kusterers Github Repository
Cocoadev also has an article about that topic. The source code at the bottom of the page uses QuickTimes Sequence Grabber API. I would go with Core Audio.

Shipment Tracking in iOS

iOS 4 automatically detects tracking numbers found in emails, notes, and messages and turns them into clickable links.
And it redirects to this URL,
http://trackingshipment.apple.com/?Company=UPS&Locale=&TrackingNumber=1Z1234567890123456
How can we use this API or library into our iOS apps so it will automatically detect or force detect shipping numbers?
Unfortunately, the publicly-released data detector types don't include common carrier tracking numbers. I wrote a small project showing how to detect UPS, USPS, and FedEx package numbers and got pretty good results:
You'll have to do the work of assembling the tracking URLs yourself, but this sample code may help you get started. Download here.
The class being used to do this is called NSDataDetector.
It is a subclass of NSRegularExpression where you can specify some built in patterns to look for.
The list of built in type values in the NSTextCheckingType enum can be seen here.
I don't see one specifically for tracking information, but the closest thing appears to be NSTextCheckingTypeTransitInformation. That is most likely the one you're going to be using.
Good luck!

Create wmv-file from code?

I have a project where the requirements is that a end user will select a template, enter some information and then my program should create a wmv movie file that has the information entered encoded in the movie.
So from my perspective I would like to have a framework that allows me to add graphics and text to a movie. Something like this:
movie.addframes(framecount, templateimage)
movie.frame(x).drawtext(x,y,text,font,size,color)
movie.frame(x).drawRectangle(rect,color,bordersize)
movie.frame(x).drawImage(rect,borderstyle,bordersize, image,sizemode)
movie.save(filename,filetype)
Does this exists?
I have searched and only found information about ffmpeg that doesn't seem to do what I want.
I don't need it to be real-time encoding.
I don't care if the framework/library is expensive.
If there are information of how to do this with for example DirectX or DirectShow and pointing to real working vb.net examples, then ill be happy too. ;) (Believe me, I have tried to search and haven't found anything.)
I have not found any good information about how to use Windows Media Encoder for this, but It seems like Windows Media Encoder is the way to go if doing it myself..
you can use DirectShow, check Samples\Capture\CapWMV here

Code sample for capturing audio from a Mac in Cocoa and saving to file?

I'm due to work on a small application that captures audio from the Mac's Audio Queue and needs to save it to disk in some reasonable audio format.
Does anyone have a some decent sample code (Cocoa / Objective-C) that they can share?
I specifically need to capture the audio that is being passed to the Built-in Output device in order to record it. Any insights? The answers so far have been helpful, but have not helped me understand how the data going to the output can be captured, agnostic of the input source.
Working with audio in Mac OS X involves interfacing with Core Audio. For a quick overview, take a look at the Core Audio Overview.
You will need to interface with the AUHAL to perform input and output; a technical note exists detailing the steps required to do so. This code seems to usually be written in C++, as that is the procedure taken in the SimplePlayThru demo.
This doesn't cover the actual steps required to capture that audio input. However, these links should provide you with enough sample code to begin interfacing with your input device. I'll post more links in this answer if I happen across them.
Take a look at /Developer/Example/CoreAudio/Services/AudioFileTools. Specifically, look at afrecord.cpp. Admittedly, this is not Cocoa per se; Cocoa itself doesn't seem to have any specific capabilities for recording. If you'll want to interface with the C++ file there, you'll likely need to write some Objective C++ like in SimplePlayThru.
There is a good example code at Ulli Kusterers Github Repository
Cocoadev also has an article about that topic. The source code at the bottom of the page uses QuickTimes Sequence Grabber API. I would go with Core Audio.