vuo.audio
These nodes are for receiving, analyzing, and outputting audio signals.
You can play an audio file using the Play Audio File
node. It supports files with extension .wav, .aif, .aiff, .mp3, .mp2, .aac, .m4a, .ac3, .3gp, and .amr. To play audio from a movie file, use the Play Movie
node in the vuo.video
node set.
An audio input device (such as the MacBook Pro’s built-in microphone, or an external USB interface) can send audio to the Receive Live Audio
node, allowing the audio to control the composition.
An audio output device (such as the MacBook Pro’s built-in speakers, or an external USB interface) can receive audio from the Send Live Audio
node, allowing you to hear audio that was read from a movie or sound file, or synthesized within Vuo.
Each audio device has a unique ID, which is assigned by the operating system. If all devices were plugged in after the computer started up, then ID 0 is usually the first device plugged in, ID 1 is usually the second device plugged in, etc.
Each audio device has a name, which is not necessarily unique. On Mac OS X, you can look up a device’s name in the Audio MIDI Setup application.
Each audio device has one or more channels. A channel is an independent audio signal — for example, in stereo audio, there are two channels: left and right. In stereo, typically, left is channel 1 and right is channel 2. You can look up a device’s channel numbers in the Audio MIDI Setup application.
A continuous stream of audio is broken up into slices called samples. Each sample is a measurement of the amplitude of the audio signal, which represents how much the physical airwaves are compressed or expanded at that instant in time. In Vuo, each sample is typically a number between -1 and 1. On Mac OS X, you can configure the sample rate in the Audio MIDI Setup application. Higher sample rates result in a more accurate digital reproduction of the audio signal, but also require more computational power.
The Receive Live Audio
node fires an event each time a new sample buffer is received. A sample buffer is a collection of 512 audio samples. Samples are grouped into buffers in order to improve efficiency.
Each event from the Receive Live Audio
node provides a sample buffer for each channel. You can split up the channels and analyze them individually using the Analyze Audio Loudness
node, or you can combine them first using the Mix Audio Channels
node.
Example compositions:
- Control Loudness: Plays an audio file, with volume controlled by the mouse.
- Pan Audio: Pans audio between the left and right speakers. For this to work, you need stereo speakers or headphones.
- Play Audio File: Plays an audio file aloud.
- Play Audio File And Loop: Plays an audio file aloud. When playback reaches the end of the file, it loops back to the beginning.
- Play Audio Wave: Generates a pitch controlled by the position of the mouse.
- Play Blues Organ: Plays notes when you press keys on the keyboard.
- Show Live Audio Trail: Renders live audio input as a waveform image, using feedback to produce a rainbow trail.
- Show Live Audio Waveform: Renders live audio input as a waveform image.
- Visualize Frequencies: Displays a graph of the loudness of different frequency ranges in an audio file (like an equalizer display).
- Visualize Loudness: Displays graphics that react to the loudness of live audio input.
Nodes:
- Calculate Loudness (vuo.audio.analyze.loudness): Approximates the perceived loudness of the audio samples.
- Get Audio File Info (vuo.audio.file.info): Gives information about an audio file.
- Play Audio File (vuo.audio.file.play): Outputs a stream of audio from a file.
- Get Audio Input Values (vuo.audio.get.input): Gives information about an audio input device.
- Get Audio Output Values (vuo.audio.get.output): Gives information about an audio output device.
- Make Image from Channels (vuo.audio.image.channels): Creates an image of audio amplitudes.
- Make Waveform Image (vuo.audio.image.waveform): Creates a graph of an audio waveform.
- List Audio Devices (vuo.audio.listDevices): Gives a list of all available audio input and output devices.
- Adjust Loudness (vuo.audio.loudness): Changes the volume of the audio samples.
- Make Audio Input from ID (vuo.audio.make.input.id): Finds an audio input device that is connected to the computer running the composition.
- Make Audio Input from Name (vuo.audio.make.input.name): Finds an audio input device that is connected to the computer running the composition.
- Make Audio Output from ID (vuo.audio.make.output.id): Finds an audio output device that is connected to the computer running the composition.
- Make Audio Output from Name (vuo.audio.make.output.name): Finds an audio output device that is connected to the computer running the composition.
- Mix Audio Channels (vuo.audio.mix): Combines multiple audio channels into a single channel.
- Receive Live Audio (vuo.audio.receive): Outputs a stream of audio from an input device.
- Send Live Audio (vuo.audio.send): Sends audio channels to an audio output device, and fires events when the audio device is ready for more.
- Split Audio by Frequency (vuo.audio.split.frequency): Separates audio into multiple channels by frequency.
- Make Audio Wave (vuo.audio.wave): Calculates a set of values for a simple audio waveform.