Sound utility methods. More...
Instance Methods | |
(instancetype) | - init |
Class Methods | |
(int) | + calculateDataLengthFloatPreciseWithDuration:clockRate:channelCount: |
Calculates the number of bytes in a given audio chunk given its duration (ms), clock rate, and channel count. More... | |
(int) | + calculateDataLengthFloatPreciseWithDuration:config: |
Calculates the number of bytes in a given audio chunk given its duration (ms), clock rate, and channel count. More... | |
(int) | + calculateDataLengthFloatWithDuration:clockRate:channelCount: |
Calculates the number of bytes in a given audio chunk given its duration (ms), clock rate, and channel count. More... | |
(int) | + calculateDataLengthFloatWithDuration:config: |
Calculates the number of bytes in a given audio chunk given its duration (ms), clock rate, and channel count. More... | |
(int) | + calculateDataLengthFromTimestampDelta:channelCount: |
Calculates a data length in bytes given a timestamp delta and channel count. More... | |
(int) | + calculateDataLengthFromTimestampDelta:channelCount:bytesPerSample: |
Calculates a data length in bytes given a timestamp delta, channel count, and number of bytes per sample. More... | |
(int) | + calculateDataLengthPreciseWithDuration:clockRate:channelCount: |
Calculates the number of bytes in a given audio chunk given its duration (ms), clock rate, and channel count. More... | |
(int) | + calculateDataLengthPreciseWithDuration:config: |
Calculates the number of bytes in a given audio chunk given its duration (ms), clock rate, and channel count. More... | |
(int) | + calculateDataLengthWithDuration:clockRate:channelCount: |
Calculates the number of bytes in a given audio chunk given its duration (ms), clock rate, and channel count. More... | |
(int) | + calculateDataLengthWithDuration:config: |
Calculates the number of bytes in a given audio chunk given its duration (ms), clock rate, and channel count. More... | |
(int) | + calculateDurationFloatWithDataLength:clockRate:channelCount: |
Calculates the duration of an audio chunk given its data length (the number of bytes), clock rate, and channel count. More... | |
(int) | + calculateDurationFloatWithDataLength:config: |
Calculates the duration of an audio chunk given its data length (the number of bytes), clock rate, and channel count. More... | |
(int) | + calculateDurationFromSystemTimestampDelta: |
Calculates a duration in milliseconds given a system timestamp delta in ticks. More... | |
(int) | + calculateDurationFromTimestampDelta:clockRate: |
Calculates a duration in milliseconds given a timestamp delta and its clock rate. More... | |
(int) | + calculateDurationWithDataLength:clockRate:channelCount: |
Calculates the duration of an audio chunk given its data length (the number of bytes), clock rate, and channel count. More... | |
(int) | + calculateDurationWithDataLength:config: |
Calculates the duration of an audio chunk given its data length (the number of bytes), clock rate, and channel count. More... | |
(int) | + calculateOutputLengthForChannelCountWithInputLength:inputChannelCount:outputChannelCount: |
Calculates the length of an output data buffer after conversion from an input to an output channel count. More... | |
(int) | + calculateSystemTimestampDeltaFromDuration: |
Calculates a system timestamp delta in ticks given a duration in milliseconds. More... | |
(long long) | + calculateSystemTimestampDeltaFromTimestampDelta:clockRate: |
Calculates a system timestamp delta given a timestamp delta and its clock rate. More... | |
(int) | + calculateTimestampDeltaFromDataLength:channelCount: |
Calculates a timestamp delta given a data length and channel count. More... | |
(int) | + calculateTimestampDeltaFromDataLength:channelCount:bytesPerSample: |
Calculates a timestamp delta given a data length in bytes, channel count, and number of bytes per sample. More... | |
(int) | + calculateTimestampDeltaFromDuration:clockRate: |
Calculates a timestamp delta given its clock rate and a duration in milliseconds. More... | |
(long long) | + calculateTimestampDeltaFromSystemTimestampDelta:clockRate: |
Calculates a timestamp delta given its clock rate and a system timestamp delta. More... | |
(FMLiveSwitchDataBuffer *) | + convertChannelCountWithInput:inputChannelCount:output:outputChannelCount: |
Converts a data buffer to a new channel count. More... | |
(float) | + floatFromShort: |
Converts a short value to a floating-point value. More... | |
(FMLiveSwitchDataBuffer *) | + monoToStereoWithMono:stereo: |
Converts each sample into two identical samples. More... | |
(short) | + readPcmShortWithInput:index: |
Reads a PCM short value from a byte array. More... | |
(short) | + shortFromFloat: |
Converts a floating-point value to a short value. More... | |
(FMLiveSwitchSoundUtility *) | + soundUtility |
(FMLiveSwitchDataBuffer *) | + stereoToMonoWithStereo:mono: |
Converts each pair of samples into one mixed sample. More... | |
(void) | + writePcmShortWithInput:output:index: |
Writes a PCM short value to a byte array. More... | |
Sound utility methods.
+ (int) calculateDataLengthFloatPreciseWithDuration: | (double) | duration | |
clockRate: | (int) | clockRate | |
channelCount: | (int) | channelCount | |
Calculates the number of bytes in a given audio chunk given its duration (ms), clock rate, and channel count.
duration | The duration in ms. |
clockRate | The clock rate. |
channelCount | The channel count. |
+ (int) calculateDataLengthFloatPreciseWithDuration: | (double) | duration | |
config: | (FMLiveSwitchAudioConfig *) | config | |
Calculates the number of bytes in a given audio chunk given its duration (ms), clock rate, and channel count.
duration | The duration in ms. |
config | The configuration. |
+ (int) calculateDataLengthFloatWithDuration: | (int) | duration | |
clockRate: | (int) | clockRate | |
channelCount: | (int) | channelCount | |
Calculates the number of bytes in a given audio chunk given its duration (ms), clock rate, and channel count.
duration | The duration in ms. |
clockRate | The clock rate. |
channelCount | The channel count. |
+ (int) calculateDataLengthFloatWithDuration: | (int) | duration | |
config: | (FMLiveSwitchAudioConfig *) | config | |
Calculates the number of bytes in a given audio chunk given its duration (ms), clock rate, and channel count.
duration | The duration in ms. |
config | The configuration. |
+ (int) calculateDataLengthFromTimestampDelta: | (int) | timestampDelta | |
channelCount: | (int) | channelCount | |
Calculates a data length in bytes given a timestamp delta and channel count.
timestampDelta | The timestamp delta. |
channelCount | The channel count. |
+ (int) calculateDataLengthFromTimestampDelta: | (int) | timestampDelta | |
channelCount: | (int) | channelCount | |
bytesPerSample: | (int) | bytesPerSample | |
Calculates a data length in bytes given a timestamp delta, channel count, and number of bytes per sample.
timestampDelta | The timestamp delta. |
channelCount | The channel count. |
bytesPerSample | The number of bytes per sample. |
+ (int) calculateDataLengthPreciseWithDuration: | (double) | duration | |
clockRate: | (int) | clockRate | |
channelCount: | (int) | channelCount | |
Calculates the number of bytes in a given audio chunk given its duration (ms), clock rate, and channel count.
duration | The duration in ms. |
clockRate | The clock rate. |
channelCount | The channel count. |
+ (int) calculateDataLengthPreciseWithDuration: | (double) | duration | |
config: | (FMLiveSwitchAudioConfig *) | config | |
Calculates the number of bytes in a given audio chunk given its duration (ms), clock rate, and channel count.
duration | The duration in ms. |
config | The configuration. |
+ (int) calculateDataLengthWithDuration: | (int) | duration | |
clockRate: | (int) | clockRate | |
channelCount: | (int) | channelCount | |
Calculates the number of bytes in a given audio chunk given its duration (ms), clock rate, and channel count.
duration | The duration in ms. |
clockRate | The clock rate. |
channelCount | The channel count. |
+ (int) calculateDataLengthWithDuration: | (int) | duration | |
config: | (FMLiveSwitchAudioConfig *) | config | |
Calculates the number of bytes in a given audio chunk given its duration (ms), clock rate, and channel count.
duration | The duration in ms. |
config | The configuration. |
+ (int) calculateDurationFloatWithDataLength: | (int) | dataLength | |
clockRate: | (int) | clockRate | |
channelCount: | (int) | channelCount | |
Calculates the duration of an audio chunk given its data length (the number of bytes), clock rate, and channel count.
dataLength | The length of the audio chunk. |
clockRate | The clock rate. |
channelCount | The channel count. |
+ (int) calculateDurationFloatWithDataLength: | (int) | dataLength | |
config: | (FMLiveSwitchAudioConfig *) | config | |
Calculates the duration of an audio chunk given its data length (the number of bytes), clock rate, and channel count.
dataLength | The length of the audio chunk. |
config | The configuration. |
+ (int) calculateDurationFromSystemTimestampDelta: | (int) | systemTimestampDelta |
Calculates a duration in milliseconds given a system timestamp delta in ticks.
systemTimestampDelta | The system timestamp delta. |
+ (int) calculateDurationFromTimestampDelta: | (int) | timestampDelta | |
clockRate: | (int) | clockRate | |
Calculates a duration in milliseconds given a timestamp delta and its clock rate.
timestampDelta | The timestamp delta. |
clockRate | The clock rate. |
+ (int) calculateDurationWithDataLength: | (int) | dataLength | |
clockRate: | (int) | clockRate | |
channelCount: | (int) | channelCount | |
Calculates the duration of an audio chunk given its data length (the number of bytes), clock rate, and channel count.
dataLength | The length of the audio chunk. |
clockRate | The clock rate. |
channelCount | The channel count. |
+ (int) calculateDurationWithDataLength: | (int) | dataLength | |
config: | (FMLiveSwitchAudioConfig *) | config | |
Calculates the duration of an audio chunk given its data length (the number of bytes), clock rate, and channel count.
dataLength | The length of the audio chunk. |
config | The configuration. |
+ (int) calculateOutputLengthForChannelCountWithInputLength: | (int) | inputLength | |
inputChannelCount: | (int) | inputChannelCount | |
outputChannelCount: | (int) | outputChannelCount | |
Calculates the length of an output data buffer after conversion from an input to an output channel count.
inputLength | The input data buffer length. |
inputChannelCount | The input channel count. |
outputChannelCount | The output channel count. |
+ (int) calculateSystemTimestampDeltaFromDuration: | (int) | duration |
Calculates a system timestamp delta in ticks given a duration in milliseconds.
duration | The duration in milliseconds. |
+ (long long) calculateSystemTimestampDeltaFromTimestampDelta: | (long long) | timestampDelta | |
clockRate: | (int) | clockRate | |
Calculates a system timestamp delta given a timestamp delta and its clock rate.
timestampDelta | The timestamp delta. |
clockRate | The clock rate. |
+ (int) calculateTimestampDeltaFromDataLength: | (int) | dataLength | |
channelCount: | (int) | channelCount | |
Calculates a timestamp delta given a data length and channel count.
dataLength | The data length in bytes. |
channelCount | The channel count. |
+ (int) calculateTimestampDeltaFromDataLength: | (int) | dataLength | |
channelCount: | (int) | channelCount | |
bytesPerSample: | (int) | bytesPerSample | |
Calculates a timestamp delta given a data length in bytes, channel count, and number of bytes per sample.
dataLength | The data length in bytes. |
channelCount | The channel count. |
bytesPerSample | The number of bytes per sample. |
+ (int) calculateTimestampDeltaFromDuration: | (int) | duration | |
clockRate: | (int) | clockRate | |
Calculates a timestamp delta given its clock rate and a duration in milliseconds.
duration | The duration in milliseconds. |
clockRate | The clock rate. |
+ (long long) calculateTimestampDeltaFromSystemTimestampDelta: | (long long) | systemTimestampDelta | |
clockRate: | (int) | clockRate | |
Calculates a timestamp delta given its clock rate and a system timestamp delta.
systemTimestampDelta | The system timestamp delta. |
clockRate | The clock rate. |
+ (FMLiveSwitchDataBuffer*) convertChannelCountWithInput: | (FMLiveSwitchDataBuffer *) | input | |
inputChannelCount: | (int) | inputChannelCount | |
output: | (FMLiveSwitchDataBuffer *) | output | |
outputChannelCount: | (int) | outputChannelCount | |
Converts a data buffer to a new channel count.
The input data buffer length must be a multiple of the input frame size. If the input channel count is greater than the output channel count, the input channel count must divide evenly into the output channel count, and vice versa if the output channel count is greater than the input channel count.
input | The input data buffer. |
inputChannelCount | The input channel count. |
output | The output data buffer. |
outputChannelCount | The output channel count. |
+ (float) floatFromShort: | (short) | value |
Converts a short value to a floating-point value.
value | The short value. |
- (instancetype) init |
+ (FMLiveSwitchDataBuffer*) monoToStereoWithMono: | (FMLiveSwitchDataBuffer *) | mono | |
stereo: | (FMLiveSwitchDataBuffer *) | stereo | |
Converts each sample into two identical samples.
null
. + (short) readPcmShortWithInput: | (NSMutableData *) | input | |
index: | (int) | index | |
Reads a PCM short value from a byte array.
input | The source byte array. |
index | The source index in the byte array. |
+ (short) shortFromFloat: | (float) | value |
Converts a floating-point value to a short value.
value | The floating-point value. |
+ (FMLiveSwitchSoundUtility*) soundUtility |
+ (FMLiveSwitchDataBuffer*) stereoToMonoWithStereo: | (FMLiveSwitchDataBuffer *) | stereo | |
mono: | (FMLiveSwitchDataBuffer *) | mono | |
Converts each pair of samples into one mixed sample.
null
. + (void) writePcmShortWithInput: | (short) | input | |
output: | (NSMutableData *) | output | |
index: | (int) | index | |
Writes a PCM short value to a byte array.
input | The short value to write. |
output | The target byte array. |
index | The target index in the byte array. |