Skip to content

Commit d177548

Browse files
committed
ai: Implement non-assembly byteswapping routine for audio samples
1 parent 3615ddf commit d177548

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ai/controller.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,11 @@ const uint8_t *byteswap_audio_buffer(const uint8_t *input,
319319

320320
return ret_buf;
321321
#else
322-
#error "Unimplemented byteswap_audio_buffer!"
322+
for (i = 0; i < length >> 1; ++i) {
323+
output[i << 1] = input [(i << 1) + 1];
324+
output[(i << 1) + 1] = input [i << 1];
325+
}
326+
return (const uint8_t*)output;
323327
#endif
324328

325329
}

0 commit comments

Comments
 (0)