System audio in Quartz Composer - macos

I am building a music visualizer in Quartz Composer, and it works just fine. The problem is that the audio input is through a microphone, so any noise that I make while its running displays.
What I want it to do is take only the sound that is running digitally through the system. Not a line input, but whats running through the Mixer AU for output in the system. I haven't found any way to do this except for WireTap, but I don't want a demo and I can't currently afford the full version.
Thanks in advance.

Try Cycling 74's Soundflower to route audio between applications.
You might also want to check out Kineme AudioTools, which provides more analysis capability than QC's built-in Audio Input patch.

Related

Intercepting all system level audio in Mac os

I have been working with CoreAudio last couple of days and I'm able to access all the AudioDevices, their properties and receive notifications when something changes. However, I'm now struggling to "intercept" the audio (ideally before it is played) from any application in the mac. I wasn't sure it was possible but this app actually does it.
So I'm in search of some guidance. Thank you in advance.
Unfortunately macOS provides no facility to do this.
The only way to achieve this is to patch lower level frameworks and/or drivers like Audio Hijack does. I will be a messy process.
Depending on the use case however it might suffice to have an audio loopback virtual audio device so application A can send audio into it while application B can receive the audio from it. This can be done by creating a Core Audio AudioServerPlugin which is a user space audio driver mechanism. For an example please have a look at:
https://github.com/ExistentialAudio/BlackHole
https://github.com/kyleneideck/BackgroundMusic
In regards to the limitations, you can read more about it here:
https://stackoverflow.com/a/18595698/2576876
From there you can go in a lot of directions by following the links provided.

I want to build a OSX app that applies some simple dsp to all audio. Where do I get started?

I want to build a little utility app that sits in the OSX tool bar and allows a user to apply a little dsp (equalization, etc.) to whatever audio is playing.
E.g., A user could adjust the equalization of the overall sound, regardless of what app the audio is playing in.
What Libraries, APIs, will allow me to tap into the audio stream?
This is my first time to program for OSX so any advice, help with gotchas, on this topic would be appreciated!
Look into Audio Units.
AU Lab can be configured as a system-wide equalizer, when combined with Soundflower.

What is a good cross platform audio processing library?

I'm looking for an audio processing library that i can use to do some on-the-fly audio editing in my program, such as turn a knob and it'll increase the pitch of the audio file being played, without saving the change to the song file itself. And i plan to make this program for windows and mac so i would need a cross platform library. I don't have much money to spare so it can't cost too much either. My program will be commercially available if that changes anything. Thanks in advance for any help.
SoX at http://sox.sourceforge.net/
Wavesurfer at http://www.speech.kth.se/wavesurfer/

Can I programatically save the data stream sent to the sound card as a WAV file?

In Windows XP, you can configure your sound card properties via the preloaded windows software. In the recording properties, if "stereo mix" or "wave out" (or something similar) is selected as the recording device, programs that can record audio ("Sound Recorder" in windows for example) record a decent quality wave file of the audio stream. I usually use Goldwave from download.com to do this as an example of a third-party application that functions the same.
Well, I've had trouble getting this scenario to happen on Windows Vista or later in a direct no-bullsh*t manner as described above. It's more than just Vista+, it's also that some sound cards don't have that option at all.
I was just wondering if there is a way to run a windows-friendly program (VB?) that takes your audio output stream and converts it (in realtime, obviously) to a WAV file with the default sampling rate as other WAV files have.
Ideally, it would cool if it worked on any operating system, so is it possible to write a web service that "listens" to your audio card like that without making the computer think it's getting a virus attack or something?
Possibly related question:
How to save web audio streaming to file ( c++ / java )
I'm only aware of one manufacturer of sound cards that enabled that option (Creative). However Vista and beyond support a "loopback" mode which gives you effectively the same functionality. You need to use the low level WASAPI rendering stack but it should work just fine.
https://github.com/rdp/virtual-audio-output-sniffer provides a directshow input device to capture the sum of wave out for vista+
You could use low level waveOut API injection and capture what it receives.
I have SkypeMXrecorder, a software that does just that - inject into any exe and 'sniffs' what's going out from it and into the sound hardware. But, it seems rather complicated to implement...

Programmatically stream audio in Cocoa on the Mac

How do I go about programmatically creating audio streams using Cocoa on the Mac. To make, say a white-noise generator using core frameworks on Mac OSX in Cocoa apps?
One way is using the CoreAudio DefaultOutputUnit.
You can configure it with parameters such as output sampling rate, resolution, and output sample format. Then you can programmatically create a raw sound wave and provide this to the output unit.
Take a look at this example on your machine at /Developer/Examples/CoreAudio/SimpleSDK/DefaultOutputUnit/
Which uses the default output unit to play a programmatically rendered sine wave. Using that as a starting point and you can write a routine to render any thing else to output.
This location at /Developer/Examples/CoreAudio/ also contains tons of other core audio examples.
Look at Audio Queue Services.

Resources