|
7 | 7 | #include <SKP_Silk_control.h> |
8 | 8 | #include <SKP_Silk_SDK_API.h> |
9 | 9 | #include <SKP_Silk_SigProc_FIX.h> |
10 | | -#include <_string.h> |
11 | | -#include <malloc/_malloc.h> |
12 | 10 |
|
13 | 11 | constexpr SKP_int32 sample_rate = 24000; |
14 | 12 |
|
@@ -67,7 +65,7 @@ int silk_decode(uint8_t* silk_data, int data_len, cb_codec callback, void* userd |
67 | 65 | while (true) { |
68 | 66 | SKP_int16 out[(FRAME_LENGTH_MS * MAX_API_FS_KHZ << 1) * MAX_INPUT_FRAMES]; |
69 | 67 | if (remainPackets == 0) { |
70 | | - nBytes = *reinterpret_cast<short *>(psRead); // Read payload size |
| 68 | + nBytes = *reinterpret_cast<short*>(psRead); // Read payload size |
71 | 69 | psRead += sizeof(SKP_int16); |
72 | 70 |
|
73 | 71 | #ifdef _SYSTEM_IS_BIG_ENDIAN |
@@ -186,7 +184,7 @@ int silk_encode(uint8_t* pcm_data, int data_len, cb_codec callback, void* userda |
186 | 184 | return 1; |
187 | 185 | } |
188 | 186 |
|
189 | | - callback(userdata, static_cast<uint8_t *>((void*)"\x02#!SILK_V3"), sizeof(char) * 10); |
| 187 | + callback(userdata, static_cast<uint8_t*>((void*)"\x02#!SILK_V3"), sizeof(char) * 10); |
190 | 188 |
|
191 | 189 | result = SKP_Silk_SDK_Get_Encoder_Size(&enc_size_bytes); |
192 | 190 | if (result) { |
@@ -236,7 +234,7 @@ int silk_encode(uint8_t* pcm_data, int data_len, cb_codec callback, void* userda |
236 | 234 | swap_endian(&n_bytes_le, 1); |
237 | 235 | callback(userdata, (void*)&n_bytes_le, sizeof(SKP_int16)); |
238 | 236 | #else |
239 | | - callback(userdata, static_cast<uint8_t *>((void*)&n_bytes), sizeof(SKP_int16)); |
| 237 | + callback(userdata, static_cast<uint8_t*>(static_cast<void*>(&n_bytes)), sizeof(SKP_int16)); |
240 | 238 | #endif |
241 | 239 | // Write payload |
242 | 240 | callback(userdata, payload, sizeof(SKP_uint8) * n_bytes); |
|
0 commit comments