20 #include "IAudioSamples.h"
22 #include "AudioSamples.h"
24 #include "FfmpegIncludes.h"
26 namespace com {
namespace avpkit {
namespace core
29 IAudioSamples :: IAudioSamples()
33 IAudioSamples :: ~IAudioSamples()
40 int bits = av_get_bytes_per_sample((
enum AVSampleFormat) format)<<3;
48 return AudioSamples::make(numSamples, numChannels);
56 return AudioSamples::make(numSamples, numChannels, format);
65 return AudioSamples::make(buffer, channels, format);
78 int64_t den = sampleRate;
79 long double calc = ((
long double)num)/((
long double)den);
80 retval = (int64_t)(calc);
92 int64_t num = duration * sampleRate;
94 long double calc = ((
long double)num)/((
long double)den);
95 retval = (int64_t)(calc);
static const int64_t DEFAULT_PTS_PER_SECOND
The default time units per second that we use for decoded IAudioSamples and IVideoPicture objects.
static const int64_t NO_PTS
A value that means no time stamp is set for a given object.
static void init()
Internal Only.
A set of raw (decoded) samples, plus a timestamp for when to play those samples relative to other ite...
static int32_t findSampleBitDepth(Format format)
A convenience method that returns the # of bits in a given format.
static int64_t defaultPtsToSamples(int64_t duration, int sampleRate)
Converts a duration in microseconds into a number of samples, assuming a given sampleRate.
Format
The format we use to represent audio.
static IAudioSamples * make(int32_t numSamples, int32_t numChannels)
Get a new audio samples buffer.
static int64_t samplesToDefaultPts(int64_t samples, int sampleRate)
Converts a number of samples at a given sampleRate into Microseconds.
Allows Java code to get data from a native buffers, and optionally modify native memory directly.
WARNING: Do not use logging in this class, and do not set any static file variables to values other t...