speex_bind.cpp 945 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #include "memory.h"
  2. #include "speex_bind.h"
  3. #include
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. void *speex_alloc (int size) {
  8. uint8_t * mem = (uint8_t*)memalloc(size);
  9. for(int i=0;i<size;i++)
  10. mem[i]=0;
  11. return mem;
  12. }
  13. void *speex_alloc_scratch (int size) {
  14. return memalloc(size);
  15. }
  16. void *speex_realloc (void *ptr, int size) {
  17. return memrealloc(ptr,size);
  18. }
  19. void speex_free (void *ptr) {
  20. memfree(ptr);
  21. }
  22. void speex_free_scratch (void *ptr) {
  23. memfree(ptr);
  24. }
  25. void _speex_fatal(const char *str, const char *file, int line) {
  26. _err_print_error("SPEEX ERROR",p_file,p_line,str);
  27. }
  28. void speex_warning(const char *str) {
  29. _err_print_error("SPEEX WARNING","",0,str);
  30. }
  31. void speex_warning_int(const char *str, int val) {
  32. _err_print_error("SPEEX WARNING INT","Value",val,str);
  33. }
  34. void speex_notify(const char *str) {
  35. print_line(str);
  36. }
  37. void _speex_putc(int ch, void *file) {
  38. // will not putc, no.
  39. }
  40. #ifdef __cplusplus
  41. }
  42. #endif