jack2 codebase
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
808B

  1. #include "JackAudioQueueAdapter.h"
  2. #define CHANNELS 2
  3. static void DSPcompute(int count, float** input, float** output)
  4. {
  5. for (int i = 0; i < CHANNELS; i++) {
  6. memcpy(output[i], input[i], count * sizeof(float));
  7. }
  8. }
  9. int main(int argc, char *argv[]) {
  10. NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
  11. Jack::JackAudioQueueAdapter audio(2, 2, 512, 44100, DSPcompute);
  12. if (audio.Open() < 0) {
  13. fprintf(stderr, "Cannot open audio\n");
  14. return 1;
  15. }
  16. // Hang around forever...
  17. while(1) CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.25, false);
  18. int retVal = UIApplicationMain(argc, argv, nil, nil);
  19. [pool release];
  20. if (audio.Close() < 0) {
  21. fprintf(stderr, "Cannot close audio\n");
  22. }
  23. return retVal;
  24. }