Get Metadata
Retrieves detailed metadata information from an audio segment including duration, quality settings, and amplitude metrics.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
info
If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.
Inputs
- Audio Segment ID - The ID of the audio segment to retrieve metadata from.
Options
This node does not have any configurable options.
Output
- metadata - An object containing detailed audio metadata with the following properties:
- length_ms - Duration of the audio in milliseconds
- frame_rate - Sample rate in Hz (e.g., 44100, 48000)
- channels - Number of audio channels (1=mono, 2=stereo)
- frame_width - Size of each frame in bytes
- sample_width - Size of each sample in bytes
- dbfs - Average loudness in dBFS (decibels relative to full scale)
- max_dbfs - Peak loudness in dBFS
- rms_amplitude - Root mean square amplitude value
How It Works
The Get Metadata node analyzes an audio segment and extracts technical information. When executed, the node:
- Validates the segment ID is not empty
- Retrieves the audio segment from memory
- Analyzes the segment's properties
- Calculates amplitude and loudness metrics
- Handles special cases (like infinite values for silent audio)
- Returns a metadata object with all information
Requirements
- Valid audio segment ID (from Create, Slice, Concatenate, etc.)
- Segment must exist in memory
Understanding Metadata Properties
length_ms (Duration)
- Audio duration in milliseconds
- Example: 5000 = 5 seconds
- Use for: Timing calculations, validation, progress tracking
frame_rate (Sample Rate)
- Number of samples per second
- Common values:
- 8000 Hz - Telephone quality
- 22050 Hz - Low quality
- 44100 Hz - CD quality (standard)
- 48000 Hz - Professional audio/video
- 96000 Hz - High-resolution audio
- Use for: Quality assessment, conversion planning
channels
- Number of audio channels
- Values:
- 1 = Mono (single channel)
- 2 = Stereo (left and right)
- 5.1, 7.1 = Surround sound (rare in typical processing)
- Use for: Format determination, conversion decisions
frame_width
- Number of bytes per frame
- Calculated as: sample_width × channels
- Use for: Technical analysis, memory calculations
sample_width
- Number of bytes per sample
- Common values:
- 1 byte = 8-bit audio
- 2 bytes = 16-bit audio (standard)
- 3 bytes = 24-bit audio
- 4 bytes = 32-bit audio
- Use for: Quality assessment, compatibility checks
dbfs (Average Loudness)
- Decibels relative to full scale
- Range: -∞ to 0 dB
- Values closer to 0 are louder
- Example values:
- 0 dBFS = Maximum possible level (clipping)
- -3 dBFS = Very loud
- -12 dBFS = Moderate volume
- -20 dBFS = Quiet
- 0 = Complete silence (converted from -∞)
- Use for: Loudness normalization, quality control
max_dbfs (Peak Loudness)
- Maximum loudness level in the audio
- Same scale as dbfs
- Should be < 0 to avoid clipping
- Use for: Detecting peaks, preventing distortion
rms_amplitude (Root Mean Square)
- Average signal strength
- Linear scale (not decibels)
- Higher values = louder audio
- 0 = Silence
- Use for: Loudness calculations, normalization
Error Handling
The node will return specific errors in the following cases:
- Audio segment ID is empty or null
- Audio segment with the specified ID does not exist
- Segment has been deleted
Usage Examples
Example 1: Check Audio Duration
Verify audio length before processing:
- Create audio segment from file
- Use Get Metadata to retrieve metadata
- Use Condition node to check if
{{msg.metadata.length_ms}}> 10000 (10 seconds) - Process accordingly
Example 2: Validate Audio Quality
Ensure audio meets quality requirements:
- Create segment from uploaded file
- Get Metadata
- Check if frame_rate 4 or greater4100
- Check if channels == 2 (stereo required)
- Accept or reject based on criteria
Example 3: Calculate Processing Time
Estimate how long operations will take:
Duration in seconds = metadata.length_ms / 1000
Estimated processing time = duration × complexity_factor
Example 4: Detect Silent Audio
Check if audio is actually silent:
- Create segment
- Get Metadata
- If dbfs == 0 or rms_amplitude == 0, audio is silent
- Handle accordingly (skip, reject, etc.)
Example 5: Loudness Normalization Decision
Determine if loudness adjustment is needed:
- Get Metadata from segment
- If max_dbfs > -1, audio may be clipping
- If dbfs < -20, audio is too quiet
- Apply appropriate processing based on values
Example 6: Format Information Display
Show audio properties to users:
Duration: {{msg.metadata.length_ms / 1000}} seconds
Quality: {{msg.metadata.frame_rate}} Hz, {{msg.metadata.channels}} channel(s)
Loudness: {{msg.metadata.dbfs}} dBFS average
Usage Notes
- Metadata extraction is very fast (milliseconds)
- The operation is non-destructive - doesn't modify the segment
- Metadata reflects the current state of the segment
- For transformed segments (sliced, sped up), metadata shows the result
- Infinite values (for silent audio) are automatically converted to 0
- Use metadata for validation, decision-making, and quality control
- Metadata can be logged for auditing and debugging
Practical Applications
Quality Assurance
1. Get Metadata
2. Check frame_rate >= 44100 (CD quality)
3. Check channels == 2 (stereo)
4. Check max_dbfs < -1 (no clipping)
5. Accept/reject based on criteria
Conditional Processing
1. Get Metadata
2. If length_ms < 60000, skip processing (too short)
3. If length_ms > 3600000, split into chunks (too long)
4. Otherwise, process normally
Batch Processing Statistics
1. Process multiple files
2. Get Metadata for each
3. Calculate:
- Total duration
- Average quality
- Format distribution
4. Generate report
Loudness Analysis
1. Get Metadata
2. Check dbfs value:
- > -6: Too loud, needs reduction
- -12 to -6: Good level
- < -20: Too quiet, needs boost
3. Apply appropriate gain adjustment
Understanding Audio Levels
dBFS Scale
- 0 dBFS = Maximum possible level (digital ceiling)
- Every -6 dB represents approximately half the amplitude
- Professional standards:
- Podcasts: -16 to -20 dBFS average
- Music: -9 to -13 dBFS average
- Broadcast: -23 dBFS average (LUFS)
Preventing Clipping
- Keep max_dbfs below -1 dBFS
- Leave headroom for processing
- Use metadata to detect potential clipping
Common Use Cases
- Validating uploaded audio files
- Checking audio duration for scheduling
- Ensuring audio quality meets requirements
- Detecting silent or corrupt audio files
- Calculating processing estimates
- Generating audio file reports
- Quality control in batch processing
- Conditional workflow routing
- Loudness normalization preparation
- Format compatibility checks
- Generating audio inventories
- Debugging audio processing issues
Best Practices
- Check metadata before heavy processing operations
- Use duration to estimate processing time
- Validate audio quality early in workflows
- Log metadata for troubleshooting
- Set clear quality thresholds for your use case
- Handle edge cases (silent audio, corrupt files)
- Use metadata for conditional branching
- Store metadata with processed files for documentation
- Create validation rules based on your requirements
- Monitor loudness levels to prevent clipping
Metadata in Decision Making
Example Decision Tree
Get Metadata
↓
Check length_ms:
< 1000ms → Too short, reject
> 7200000ms → Too long, split
Otherwise → Continue
↓
Check frame_rate:
< 44100 → Convert to higher quality
>= 44100 → Accept
↓
Check channels:
1 → Convert to stereo if needed
2 → Accept
↓
Check max_dbfs:
> -1 → Apply limiter to prevent clipping
< -1 → Continue
↓
Process audio
Integration with Other Nodes
Works seamlessly with:
- Create - Get metadata immediately after loading
- Convert - Verify conversion success
- Slice - Check duration of sliced segments
- Concatenate - Verify combined segment properties
- Speedup - Confirm duration changes
- Condition - Use metadata for branching logic
- Log - Record metadata for auditing
Performance Tips
- Get metadata once and store in variables
- Use metadata early to avoid processing invalid files
- Cache metadata for repeated checks
- Metadata extraction has minimal overhead
- No need to worry about performance impact
Troubleshooting
All values are 0
- The audio segment is silent or empty
- Use Create with Silent format if intended
Unexpected frame_rate
- Audio was converted from another format
- Check source file specifications
High max_dbfs (close to 0)
- Audio may be clipping (distorted)
- Consider applying gain reduction
Very low dbfs (< -30)
- Audio is very quiet
- May need amplification or boost