
public class AudioChannel extends RefCounted
| Modifier and Type | Class and Description |
|---|---|
static class |
AudioChannel.Layout
Different layouts of audio channels.
|
static class |
AudioChannel.Type
Flags for each type of audio channel that can be in multi-channel audio.
|
| Modifier and Type | Method and Description |
|---|---|
AudioChannel |
copyReference()
Create a new AudioChannel object that is actually referring to the
exact same underlying native object.
|
boolean |
equals(Object obj)
Compares two values, returning true if the underlying objects in native code are the same object.
|
static long |
getChannelBitmask(String name)
Return a channel layout bitmask that matches name, or 0 if no match is found.
name can be one or several of the following notations, separated by '+' or '|': - the name of an usual channel layout (mono, stereo, 4.0, quad, 5.0, 5.0(side), 5.1, 5.1(side), 7.1, 7.1(wide), downmix); - the name of a single channel (FL, FR, FC, LFE, BL, BR, FLC, FRC, BC, SL, SR, TC, TFL, TFC, TFR, TBL, TBC, TBR, DL, DR); - a number of channels, in decimal, optionally followed by 'c', yielding the default channel layout for that number of channels (@see av_get_default_channel_layout);- a channel layout mask, in hexadecimal starting with "0x" (see the Layout and Channel enums). Example: "stereo+FC" = "2+FC" = "2c+1c" = "0x7" |
static String |
getChannelDescription(AudioChannel.Type channel)
Get the description of a given channel.
|
static AudioChannel.Type |
getChannelFromLayoutAtIndex(AudioChannel.Layout layout,
int index)
Get the channel with the given index in channel_layout.
|
static String |
getChannelLayoutString(int numChannels,
long layout)
Return a description of a channel bitmask.
If numChannels is <= 0, it is guessed from the layout. Note to C/C++ callers. |
static String |
getChannelName(AudioChannel.Type channel)
Get the name of a given channel.
|
static AudioChannel.Layout |
getDefaultLayout(int numChannels)
Return default channel layout for a given number of channels.
|
static int |
getIndexOfChannelInLayout(AudioChannel.Layout layout,
AudioChannel.Type channel)
Get the index of a channel in channel_layout.
|
static String |
getLayoutName(AudioChannel.Layout layout)
Get the value and name of a standard channel layout.
index index in an internal list, starting at 0 layout channel layout mask name name of the layout |
static int |
getNumChannelsInLayout(AudioChannel.Layout layout)
Return the number of channels in the channel layout.
|
int |
hashCode()
Get a hashable value for this object.
|
delete, getCurrentRefCountpublic AudioChannel copyReference()
copyReference in class RefCountedpublic boolean equals(Object obj)
public int hashCode()
public static long getChannelBitmask(String name)
public static String getChannelLayoutString(int numChannels, long layout)
public static int getNumChannelsInLayout(AudioChannel.Layout layout)
public static AudioChannel.Layout getDefaultLayout(int numChannels)
public static int getIndexOfChannelInLayout(AudioChannel.Layout layout, AudioChannel.Type channel)
Use this method to find out which index into channel data corresponds
to the channel you care about. The way you use this differs depending
on whether your audio is packed or planar. To illustrate, let's assume
you have CH_LAYOUT_STEREO audio, and you ask for the index of CH_FRONT_LEFT,
and we return 1 (indexes are zero based).
If packed, then audio is laid out in one big buffer as "RLRLRLRLRLRLRLRL" audio,
and every 2nd (1+1) sample is the left channel
If planar, then audio is out in two buffer as "RRRRRRRR" and "LLLLLLLL", and the
second plan (1+1) is the left channel.
channel - a channel layout describing exactly one channel which must bepublic static AudioChannel.Type getChannelFromLayoutAtIndex(AudioChannel.Layout layout, int index)
public static String getChannelName(AudioChannel.Type channel)
public static String getChannelDescription(AudioChannel.Type channel)
channel - a channel layout with a single channelpublic static String getLayoutName(AudioChannel.Layout layout)
Copyright © 2018 Humble Software. All rights reserved.