react-native-audio-api 0.7.1-nightly-5a218c6-20250809 → 0.7.1-nightly-4d86c14-20250811

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/RNAudioAPI.podspec +31 -7
  2. package/android/src/main/cpp/audioapi/CMakeLists.txt +22 -1
  3. package/android/src/main/cpp/audioapi/android/core/AudioDecoder.cpp +81 -63
  4. package/common/cpp/audioapi/core/utils/AudioDecoder.h +54 -29
  5. package/common/cpp/audioapi/external/arm64-v8a/libogg.a +0 -0
  6. package/common/cpp/audioapi/external/arm64-v8a/libopus.a +0 -0
  7. package/common/cpp/audioapi/external/arm64-v8a/libopusfile.a +0 -0
  8. package/common/cpp/audioapi/external/arm64-v8a/libvorbis.a +0 -0
  9. package/common/cpp/audioapi/external/arm64-v8a/libvorbisenc.a +0 -0
  10. package/common/cpp/audioapi/external/arm64-v8a/libvorbisfile.a +0 -0
  11. package/common/cpp/audioapi/external/armeabi-v7a/libogg.a +0 -0
  12. package/common/cpp/audioapi/external/armeabi-v7a/libopus.a +0 -0
  13. package/common/cpp/audioapi/external/armeabi-v7a/libopusfile.a +0 -0
  14. package/common/cpp/audioapi/external/armeabi-v7a/libvorbis.a +0 -0
  15. package/common/cpp/audioapi/external/armeabi-v7a/libvorbisenc.a +0 -0
  16. package/common/cpp/audioapi/external/armeabi-v7a/libvorbisfile.a +0 -0
  17. package/common/cpp/audioapi/external/include/ogg/config_types.h +26 -0
  18. package/common/cpp/audioapi/external/include/ogg/config_types.h.in +26 -0
  19. package/common/cpp/audioapi/external/include/ogg/ogg.h +212 -0
  20. package/common/cpp/audioapi/external/include/ogg/os_types.h +157 -0
  21. package/common/cpp/audioapi/external/include/opus/opus.h +1286 -0
  22. package/common/cpp/audioapi/external/include/opus/opus_custom.h +390 -0
  23. package/common/cpp/audioapi/external/include/opus/opus_defines.h +896 -0
  24. package/common/cpp/audioapi/external/include/opus/opus_multistream.h +728 -0
  25. package/common/cpp/audioapi/external/include/opus/opus_projection.h +621 -0
  26. package/common/cpp/audioapi/external/include/opus/opus_types.h +170 -0
  27. package/common/cpp/audioapi/external/include/opusfile/opusfile.h +2151 -0
  28. package/common/cpp/audioapi/external/include/vorbis/codec.h +241 -0
  29. package/common/cpp/audioapi/external/include/vorbis/vorbisenc.h +446 -0
  30. package/common/cpp/audioapi/external/include/vorbis/vorbisfile.h +226 -0
  31. package/common/cpp/audioapi/external/iphoneos/libogg.a +0 -0
  32. package/common/cpp/audioapi/external/iphoneos/libopus.a +0 -0
  33. package/common/cpp/audioapi/external/iphoneos/libopusfile.a +0 -0
  34. package/common/cpp/audioapi/external/iphoneos/libvorbis.a +0 -0
  35. package/common/cpp/audioapi/external/iphoneos/libvorbisenc.a +0 -0
  36. package/common/cpp/audioapi/external/iphoneos/libvorbisfile.a +0 -0
  37. package/common/cpp/audioapi/external/iphonesimulator/libogg.a +0 -0
  38. package/common/cpp/audioapi/external/iphonesimulator/libopus.a +0 -0
  39. package/common/cpp/audioapi/external/iphonesimulator/libopusfile.a +0 -0
  40. package/common/cpp/audioapi/external/iphonesimulator/libvorbis.a +0 -0
  41. package/common/cpp/audioapi/external/iphonesimulator/libvorbisenc.a +0 -0
  42. package/common/cpp/audioapi/external/iphonesimulator/libvorbisfile.a +0 -0
  43. package/common/cpp/audioapi/external/x86/libogg.a +0 -0
  44. package/common/cpp/audioapi/external/x86/libopus.a +0 -0
  45. package/common/cpp/audioapi/external/x86/libopusfile.a +0 -0
  46. package/common/cpp/audioapi/external/x86/libvorbis.a +0 -0
  47. package/common/cpp/audioapi/external/x86/libvorbisenc.a +0 -0
  48. package/common/cpp/audioapi/external/x86/libvorbisfile.a +0 -0
  49. package/common/cpp/audioapi/external/x86_64/libogg.a +0 -0
  50. package/common/cpp/audioapi/external/x86_64/libopus.a +0 -0
  51. package/common/cpp/audioapi/external/x86_64/libopusfile.a +0 -0
  52. package/common/cpp/audioapi/external/x86_64/libvorbis.a +0 -0
  53. package/common/cpp/audioapi/external/x86_64/libvorbisenc.a +0 -0
  54. package/common/cpp/audioapi/external/x86_64/libvorbisfile.a +0 -0
  55. package/common/cpp/audioapi/libs/miniaudio/decoders/libopus/miniaudio_libopus.c +623 -0
  56. package/common/cpp/audioapi/libs/miniaudio/decoders/libopus/miniaudio_libopus.h +71 -0
  57. package/common/cpp/audioapi/libs/miniaudio/decoders/libvorbis/miniaudio_libvorbis.c +574 -0
  58. package/common/cpp/audioapi/libs/miniaudio/decoders/libvorbis/miniaudio_libvorbis.h +41 -0
  59. package/common/cpp/test/CMakeLists.txt +7 -0
  60. package/common/cpp/test/RunTests.sh +3 -8
  61. package/ios/audioapi/ios/core/AudioDecoder.mm +62 -51
  62. package/package.json +1 -1
@@ -0,0 +1,390 @@
1
+ /* Copyright (c) 2007-2008 CSIRO
2
+ Copyright (c) 2007-2009 Xiph.Org Foundation
3
+ Copyright (c) 2008-2012 Gregory Maxwell
4
+ Written by Jean-Marc Valin and Gregory Maxwell */
5
+ /*
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions
8
+ are met:
9
+
10
+ - Redistributions of source code must retain the above copyright
11
+ notice, this list of conditions and the following disclaimer.
12
+
13
+ - Redistributions in binary form must reproduce the above copyright
14
+ notice, this list of conditions and the following disclaimer in the
15
+ documentation and/or other materials provided with the distribution.
16
+
17
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18
+ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
21
+ OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
24
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
+ */
29
+
30
+ /**
31
+ @file opus_custom.h
32
+ @brief Opus-Custom reference implementation API
33
+ */
34
+
35
+ #ifndef OPUS_CUSTOM_H
36
+ #define OPUS_CUSTOM_H
37
+
38
+ #include "opus_defines.h"
39
+
40
+ #ifdef __cplusplus
41
+ extern "C" {
42
+ #endif
43
+
44
+ #ifdef CUSTOM_MODES
45
+ #define OPUS_CUSTOM_EXPORT OPUS_EXPORT
46
+ #define OPUS_CUSTOM_EXPORT_STATIC OPUS_EXPORT
47
+ #else
48
+ #define OPUS_CUSTOM_EXPORT
49
+ #ifdef OPUS_BUILD
50
+ #define OPUS_CUSTOM_EXPORT_STATIC static OPUS_INLINE
51
+ #else
52
+ #define OPUS_CUSTOM_EXPORT_STATIC
53
+ #endif
54
+ #endif
55
+
56
+ /** @defgroup opus_custom Opus Custom
57
+ * @{
58
+ * Opus Custom is an optional part of the Opus specification and
59
+ * reference implementation which uses a distinct API from the regular
60
+ * API and supports frame sizes that are not normally supported.\ Use
61
+ * of Opus Custom is discouraged for all but very special applications
62
+ * for which a frame size different from 2.5, 5, 10, or 20 ms is needed
63
+ * (for either complexity or latency reasons) and where interoperability
64
+ * is less important.
65
+ *
66
+ * In addition to the interoperability limitations the use of Opus custom
67
+ * disables a substantial chunk of the codec and generally lowers the
68
+ * quality available at a given bitrate. Normally when an application needs
69
+ * a different frame size from the codec it should buffer to match the
70
+ * sizes but this adds a small amount of delay which may be important
71
+ * in some very low latency applications. Some transports (especially
72
+ * constant rate RF transports) may also work best with frames of
73
+ * particular durations.
74
+ *
75
+ * Libopus only supports custom modes if they are enabled at compile time.
76
+ *
77
+ * The Opus Custom API is similar to the regular API but the
78
+ * @ref opus_encoder_create and @ref opus_decoder_create calls take
79
+ * an additional mode parameter which is a structure produced by
80
+ * a call to @ref opus_custom_mode_create. Both the encoder and decoder
81
+ * must create a mode using the same sample rate (fs) and frame size
82
+ * (frame size) so these parameters must either be signaled out of band
83
+ * or fixed in a particular implementation.
84
+ *
85
+ * Similar to regular Opus the custom modes support on the fly frame size
86
+ * switching, but the sizes available depend on the particular frame size in
87
+ * use. For some initial frame sizes on a single on the fly size is available.
88
+ */
89
+
90
+ /** Contains the state of an encoder. One encoder state is needed
91
+ for each stream. It is initialized once at the beginning of the
92
+ stream. Do *not* re-initialize the state for every frame.
93
+ @brief Encoder state
94
+ */
95
+ typedef struct OpusCustomEncoder OpusCustomEncoder;
96
+
97
+ /** State of the decoder. One decoder state is needed for each stream.
98
+ It is initialized once at the beginning of the stream. Do *not*
99
+ re-initialize the state for every frame.
100
+ @brief Decoder state
101
+ */
102
+ typedef struct OpusCustomDecoder OpusCustomDecoder;
103
+
104
+ /** The mode contains all the information necessary to create an
105
+ encoder. Both the encoder and decoder need to be initialized
106
+ with exactly the same mode, otherwise the output will be
107
+ corrupted. The mode MUST NOT BE DESTROYED until the encoders and
108
+ decoders that use it are destroyed as well.
109
+ @brief Mode configuration
110
+ */
111
+ typedef struct OpusCustomMode OpusCustomMode;
112
+
113
+ /** Creates a new mode struct. This will be passed to an encoder or
114
+ * decoder. The mode MUST NOT BE DESTROYED until the encoders and
115
+ * decoders that use it are destroyed as well.
116
+ * @param [in] Fs <tt>int</tt>: Sampling rate (8000 to 96000 Hz)
117
+ * @param [in] frame_size <tt>int</tt>: Number of samples (per channel) to
118
+ * encode in each packet (64 - 1024, prime factorization must contain zero or
119
+ * more 2s, 3s, or 5s and no other primes)
120
+ * @param [out] error <tt>int*</tt>: Returned error code (if NULL, no error will
121
+ * be returned)
122
+ * @return A newly created mode
123
+ */
124
+ OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT OpusCustomMode *
125
+ opus_custom_mode_create(opus_int32 Fs, int frame_size, int *error);
126
+
127
+ /** Destroys a mode struct. Only call this after all encoders and
128
+ * decoders using this mode are destroyed as well.
129
+ * @param [in] mode <tt>OpusCustomMode*</tt>: Mode to be freed.
130
+ */
131
+ OPUS_CUSTOM_EXPORT void opus_custom_mode_destroy(OpusCustomMode *mode);
132
+
133
+ #if !defined(OPUS_BUILD) || defined(CELT_ENCODER_C)
134
+
135
+ /* Encoder */
136
+ /** Gets the size of an OpusCustomEncoder structure.
137
+ * @param [in] mode <tt>OpusCustomMode *</tt>: Mode configuration
138
+ * @param [in] channels <tt>int</tt>: Number of channels
139
+ * @returns size
140
+ */
141
+ OPUS_CUSTOM_EXPORT_STATIC OPUS_WARN_UNUSED_RESULT int
142
+ opus_custom_encoder_get_size(const OpusCustomMode *mode, int channels)
143
+ OPUS_ARG_NONNULL(1);
144
+
145
+ #ifdef CUSTOM_MODES
146
+ /** Initializes a previously allocated encoder state
147
+ * The memory pointed to by st must be the size returned by
148
+ * opus_custom_encoder_get_size. This is intended for applications which use
149
+ * their own allocator instead of malloc.
150
+ * @see opus_custom_encoder_create(),opus_custom_encoder_get_size()
151
+ * To reset a previously initialized state use the OPUS_RESET_STATE CTL.
152
+ * @param [in] st <tt>OpusCustomEncoder*</tt>: Encoder state
153
+ * @param [in] mode <tt>OpusCustomMode *</tt>: Contains all the information
154
+ * about the characteristics of the stream (must be the same characteristics as
155
+ * used for the decoder)
156
+ * @param [in] channels <tt>int</tt>: Number of channels
157
+ * @return OPUS_OK Success or @ref opus_errorcodes
158
+ */
159
+ OPUS_CUSTOM_EXPORT int opus_custom_encoder_init(
160
+ OpusCustomEncoder *st,
161
+ const OpusCustomMode *mode,
162
+ int channels) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2);
163
+ #endif
164
+ #endif
165
+
166
+ /** Creates a new encoder state. Each stream needs its own encoder
167
+ * state (can't be shared across simultaneous streams).
168
+ * @param [in] mode <tt>OpusCustomMode*</tt>: Contains all the information about
169
+ * the characteristics of the stream (must be the same characteristics as used
170
+ * for the decoder)
171
+ * @param [in] channels <tt>int</tt>: Number of channels
172
+ * @param [out] error <tt>int*</tt>: Returns an error code
173
+ * @return Newly created encoder state.
174
+ */
175
+ OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT OpusCustomEncoder *
176
+ opus_custom_encoder_create(const OpusCustomMode *mode, int channels, int *error)
177
+ OPUS_ARG_NONNULL(1);
178
+
179
+ /** Destroys an encoder state.
180
+ * @param[in] st <tt>OpusCustomEncoder*</tt>: State to be freed.
181
+ */
182
+ OPUS_CUSTOM_EXPORT void opus_custom_encoder_destroy(OpusCustomEncoder *st);
183
+
184
+ /** Encodes a frame of audio.
185
+ * @param [in] st <tt>OpusCustomEncoder*</tt>: Encoder state
186
+ * @param [in] pcm <tt>float*</tt>: PCM audio in float format, with a normal
187
+ * range of +/-1.0. Samples with a range beyond +/-1.0 are supported but will be
188
+ * clipped by decoders using the integer API and should only be used if it is
189
+ * known that the far end supports extended dynamic range. There must be exactly
190
+ * frame_size samples per channel.
191
+ * @param [in] frame_size <tt>int</tt>: Number of samples per frame of input
192
+ * signal
193
+ * @param [out] compressed <tt>char *</tt>: The compressed data is written here.
194
+ * This may not alias pcm and must be at least maxCompressedBytes long.
195
+ * @param [in] maxCompressedBytes <tt>int</tt>: Maximum number of bytes to use
196
+ * for compressing the frame (can change from one frame to another)
197
+ * @return Number of bytes written to "compressed".
198
+ * If negative, an error has occurred (see error codes). It is IMPORTANT
199
+ * that the length returned be somehow transmitted to the decoder. Otherwise, no
200
+ * decoding is possible.
201
+ */
202
+ OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT int opus_custom_encode_float(
203
+ OpusCustomEncoder *st,
204
+ const float *pcm,
205
+ int frame_size,
206
+ unsigned char *compressed,
207
+ int maxCompressedBytes) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2)
208
+ OPUS_ARG_NONNULL(4);
209
+
210
+ /** Encodes a frame of audio.
211
+ * @param [in] st <tt>OpusCustomEncoder*</tt>: Encoder state
212
+ * @param [in] pcm <tt>opus_int16*</tt>: PCM audio in signed 16-bit format
213
+ * (native endian). There must be exactly frame_size samples per channel.
214
+ * @param [in] frame_size <tt>int</tt>: Number of samples per frame of input
215
+ * signal
216
+ * @param [out] compressed <tt>char *</tt>: The compressed data is written here.
217
+ * This may not alias pcm and must be at least maxCompressedBytes long.
218
+ * @param [in] maxCompressedBytes <tt>int</tt>: Maximum number of bytes to use
219
+ * for compressing the frame (can change from one frame to another)
220
+ * @return Number of bytes written to "compressed".
221
+ * If negative, an error has occurred (see error codes). It is IMPORTANT
222
+ * that the length returned be somehow transmitted to the decoder. Otherwise, no
223
+ * decoding is possible.
224
+ */
225
+ OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT int opus_custom_encode(
226
+ OpusCustomEncoder *st,
227
+ const opus_int16 *pcm,
228
+ int frame_size,
229
+ unsigned char *compressed,
230
+ int maxCompressedBytes) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2)
231
+ OPUS_ARG_NONNULL(4);
232
+
233
+ /** Encodes a frame of audio.
234
+ * @param [in] st <tt>OpusCustomEncoder*</tt>: Encoder state
235
+ * @param [in] pcm <tt>opus_int32*</tt>: PCM audio in signed 32-bit format
236
+ * (native endian) representing (or slightly exceeding) 24-bit values. There
237
+ * must be exactly frame_size samples per channel.
238
+ * @param [in] frame_size <tt>int</tt>: Number of samples per frame of input
239
+ * signal
240
+ * @param [out] compressed <tt>char *</tt>: The compressed data is written here.
241
+ * This may not alias pcm and must be at least maxCompressedBytes long.
242
+ * @param [in] maxCompressedBytes <tt>int</tt>: Maximum number of bytes to use
243
+ * for compressing the frame (can change from one frame to another)
244
+ * @return Number of bytes written to "compressed".
245
+ * If negative, an error has occurred (see error codes). It is IMPORTANT
246
+ * that the length returned be somehow transmitted to the decoder. Otherwise, no
247
+ * decoding is possible.
248
+ */
249
+ OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT int opus_custom_encode24(
250
+ OpusCustomEncoder *st,
251
+ const opus_int32 *pcm,
252
+ int frame_size,
253
+ unsigned char *compressed,
254
+ int maxCompressedBytes) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2)
255
+ OPUS_ARG_NONNULL(4);
256
+
257
+ /** Perform a CTL function on an Opus custom encoder.
258
+ *
259
+ * Generally the request and subsequent arguments are generated
260
+ * by a convenience macro.
261
+ * @see opus_encoderctls
262
+ */
263
+ OPUS_CUSTOM_EXPORT int opus_custom_encoder_ctl(
264
+ OpusCustomEncoder *OPUS_RESTRICT st,
265
+ int request,
266
+ ...) OPUS_ARG_NONNULL(1);
267
+
268
+ #if !defined(OPUS_BUILD) || defined(CELT_DECODER_C)
269
+ /* Decoder */
270
+
271
+ /** Gets the size of an OpusCustomDecoder structure.
272
+ * @param [in] mode <tt>OpusCustomMode *</tt>: Mode configuration
273
+ * @param [in] channels <tt>int</tt>: Number of channels
274
+ * @returns size
275
+ */
276
+ OPUS_CUSTOM_EXPORT_STATIC OPUS_WARN_UNUSED_RESULT int
277
+ opus_custom_decoder_get_size(const OpusCustomMode *mode, int channels)
278
+ OPUS_ARG_NONNULL(1);
279
+
280
+ /** Initializes a previously allocated decoder state
281
+ * The memory pointed to by st must be the size returned by
282
+ * opus_custom_decoder_get_size. This is intended for applications which use
283
+ * their own allocator instead of malloc.
284
+ * @see opus_custom_decoder_create(),opus_custom_decoder_get_size()
285
+ * To reset a previously initialized state use the OPUS_RESET_STATE CTL.
286
+ * @param [in] st <tt>OpusCustomDecoder*</tt>: Decoder state
287
+ * @param [in] mode <tt>OpusCustomMode *</tt>: Contains all the information
288
+ * about the characteristics of the stream (must be the same characteristics as
289
+ * used for the encoder)
290
+ * @param [in] channels <tt>int</tt>: Number of channels
291
+ * @return OPUS_OK Success or @ref opus_errorcodes
292
+ */
293
+ OPUS_CUSTOM_EXPORT_STATIC int opus_custom_decoder_init(
294
+ OpusCustomDecoder *st,
295
+ const OpusCustomMode *mode,
296
+ int channels) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2);
297
+
298
+ #endif
299
+
300
+ /** Creates a new decoder state. Each stream needs its own decoder state (can't
301
+ * be shared across simultaneous streams).
302
+ * @param [in] mode <tt>OpusCustomMode</tt>: Contains all the information about
303
+ * the characteristics of the stream (must be the same characteristics as used
304
+ * for the encoder)
305
+ * @param [in] channels <tt>int</tt>: Number of channels
306
+ * @param [out] error <tt>int*</tt>: Returns an error code
307
+ * @return Newly created decoder state.
308
+ */
309
+ OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT OpusCustomDecoder *
310
+ opus_custom_decoder_create(const OpusCustomMode *mode, int channels, int *error)
311
+ OPUS_ARG_NONNULL(1);
312
+
313
+ /** Destroys a decoder state.
314
+ * @param[in] st <tt>OpusCustomDecoder*</tt>: State to be freed.
315
+ */
316
+ OPUS_CUSTOM_EXPORT void opus_custom_decoder_destroy(OpusCustomDecoder *st);
317
+
318
+ /** Decode an opus custom frame with floating point output
319
+ * @param [in] st <tt>OpusCustomDecoder*</tt>: Decoder state
320
+ * @param [in] data <tt>char*</tt>: Input payload. Use a NULL pointer to
321
+ * indicate packet loss
322
+ * @param [in] len <tt>int</tt>: Number of bytes in payload
323
+ * @param [out] pcm <tt>float*</tt>: Output signal (interleaved if 2 channels).
324
+ * length is frame_size*channels*sizeof(float)
325
+ * @param [in] frame_size Number of samples per channel of available space in
326
+ * *pcm.
327
+ * @returns Number of decoded samples or @ref opus_errorcodes
328
+ */
329
+ OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT int opus_custom_decode_float(
330
+ OpusCustomDecoder *st,
331
+ const unsigned char *data,
332
+ int len,
333
+ float *pcm,
334
+ int frame_size) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4);
335
+
336
+ /** Decode an opus custom frame
337
+ * @param [in] st <tt>OpusCustomDecoder*</tt>: Decoder state
338
+ * @param [in] data <tt>char*</tt>: Input payload. Use a NULL pointer to
339
+ * indicate packet loss
340
+ * @param [in] len <tt>int</tt>: Number of bytes in payload
341
+ * @param [out] pcm <tt>opus_int16*</tt>: Output signal (interleaved if 2
342
+ * channels). length is frame_size*channels*sizeof(opus_int16)
343
+ * @param [in] frame_size Number of samples per channel of available space in
344
+ * *pcm.
345
+ * @returns Number of decoded samples or @ref opus_errorcodes
346
+ */
347
+ OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT int opus_custom_decode(
348
+ OpusCustomDecoder *st,
349
+ const unsigned char *data,
350
+ int len,
351
+ opus_int16 *pcm,
352
+ int frame_size) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4);
353
+
354
+ /** Decode an opus custom frame
355
+ * @param [in] st <tt>OpusCustomDecoder*</tt>: Decoder state
356
+ * @param [in] data <tt>char*</tt>: Input payload. Use a NULL pointer to
357
+ * indicate packet loss
358
+ * @param [in] len <tt>int</tt>: Number of bytes in payload
359
+ * @param [out] pcm <tt>opus_int32*</tt>: Output signal (interleaved if 2
360
+ * channels) representing (or slightly exceeding) 24-bit values. length is
361
+ * frame_size*channels*sizeof(opus_int32)
362
+ * @param [in] frame_size Number of samples per channel of available space in
363
+ * *pcm.
364
+ * @returns Number of decoded samples or @ref opus_errorcodes
365
+ */
366
+ OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT int opus_custom_decode24(
367
+ OpusCustomDecoder *st,
368
+ const unsigned char *data,
369
+ int len,
370
+ opus_int32 *pcm,
371
+ int frame_size) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4);
372
+
373
+ /** Perform a CTL function on an Opus custom decoder.
374
+ *
375
+ * Generally the request and subsequent arguments are generated
376
+ * by a convenience macro.
377
+ * @see opus_genericctls
378
+ */
379
+ OPUS_CUSTOM_EXPORT int opus_custom_decoder_ctl(
380
+ OpusCustomDecoder *OPUS_RESTRICT st,
381
+ int request,
382
+ ...) OPUS_ARG_NONNULL(1);
383
+
384
+ /**@}*/
385
+
386
+ #ifdef __cplusplus
387
+ }
388
+ #endif
389
+
390
+ #endif /* OPUS_CUSTOM_H */