-rw-r--r-- | core/applets/vmemo/vmemo.cpp | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp index 4278f46..cfa07b4 100644 --- a/core/applets/vmemo/vmemo.cpp +++ b/core/applets/vmemo/vmemo.cpp | |||
@@ -456,96 +456,79 @@ void VMemo::record(void) | |||
456 | if(systemZaurus) { | 456 | if(systemZaurus) { |
457 | 457 | ||
458 | msg.sprintf("Recording format zaurus"); | 458 | msg.sprintf("Recording format zaurus"); |
459 | qDebug(msg); | 459 | qDebug(msg); |
460 | signed short sound[512], monoBuffer[512]; | 460 | signed short sound[512], monoBuffer[512]; |
461 | 461 | ||
462 | if(format==AFMT_S16_LE) { | 462 | if(format==AFMT_S16_LE) { |
463 | 463 | ||
464 | 464 | ||
465 | 465 | ||
466 | while(recording) { | 466 | while(recording) { |
467 | 467 | ||
468 | result = read(dsp, sound, 512); // 8192 | 468 | result = read(dsp, sound, 512); // 8192 |
469 | int j=0; | 469 | int j=0; |
470 | 470 | ||
471 | // if(systemZaurus) { | 471 | // if(systemZaurus) { |
472 | for (int i = 0; i < result; i++) { //since Z is mono do normally | 472 | for (int i = 0; i < result; i++) { //since Z is mono do normally |
473 | monoBuffer[i] = sound[i]; | 473 | monoBuffer[i] = sound[i]; |
474 | } | 474 | } |
475 | 475 | ||
476 | length+=write(wav, monoBuffer, result); | 476 | length+=write(wav, monoBuffer, result); |
477 | if(length<0) | 477 | if(length<0) |
478 | recording=false; | 478 | recording=false; |
479 | 479 | ||
480 | // } else { //ipaq /stereo inputs | ||
481 | |||
482 | |||
483 | // for (int i = 0; i < result; i+=2) { | 480 | // for (int i = 0; i < result; i+=2) { |
484 | // monoBuffer[j] = sound[i]; | 481 | // monoBuffer[j] = sound[i]; |
485 | // // monoBuffer[j] = (sound[i]+sound[i+1])/2; | 482 | // // monoBuffer[j] = (sound[i]+sound[i+1])/2; |
486 | 483 | ||
487 | // j++; | 484 | // j++; |
488 | // } | 485 | // } |
489 | |||
490 | // length+=write(wav, monoBuffer, result); | ||
491 | // if(length<0) | ||
492 | // recording=false; | ||
493 | // // length+=write(wav, monoBuffer, result/2); | ||
494 | // } | ||
495 | qApp->processEvents(); | 486 | qApp->processEvents(); |
496 | // printf("%d\r",length); | 487 | // printf("%d\r",length); |
497 | // fflush(stdout); | 488 | // fflush(stdout); |
498 | } | 489 | } |
499 | 490 | ||
500 | } else { //AFMT_U8 | 491 | } else { //AFMT_U8 |
501 | // 8bit unsigned | 492 | // 8bit unsigned |
502 | unsigned short sound[512], monoBuffer[512]; | 493 | unsigned short sound[512], monoBuffer[512]; |
503 | while(recording) { | 494 | while(recording) { |
504 | result = read(dsp, sound, 512); // 8192 | 495 | result = read(dsp, sound, 512); // 8192 |
505 | int j=0; | 496 | int j=0; |
506 | 497 | ||
507 | // if(systemZaurus) { | 498 | // if(systemZaurus) { |
508 | 499 | ||
509 | for (int i = 0; i < result; i++) { //since Z is mono do normally | 500 | for (int i = 0; i < result; i++) { //since Z is mono do normally |
510 | monoBuffer[i] = sound[i]; | 501 | monoBuffer[i] = sound[i]; |
511 | } | 502 | } |
512 | 503 | ||
513 | length+=write(wav, monoBuffer, result); | 504 | length+=write(wav, monoBuffer, result); |
514 | 505 | ||
515 | // } else { //ipaq /stereo inputs | ||
516 | |||
517 | // for (int i = 0; i < result; i+=2) { | 506 | // for (int i = 0; i < result; i+=2) { |
518 | // monoBuffer[j] = (sound[i]+sound[i+1])/2; | 507 | // monoBuffer[j] = (sound[i]+sound[i+1])/2; |
519 | // j++; | 508 | // j++; |
520 | // } | 509 | // } |
521 | |||
522 | // length+=write(wav, monoBuffer, result/2); | 510 | // length+=write(wav, monoBuffer, result/2); |
523 | |||
524 | // if(length<0) | ||
525 | // recording=false; | ||
526 | |||
527 | // } | ||
528 | length += result; | 511 | length += result; |
529 | // printf("%d\r",length); | 512 | // printf("%d\r",length); |
530 | // fflush(stdout); | 513 | // fflush(stdout); |
531 | } | 514 | } |
532 | 515 | ||
533 | qApp->processEvents(); | 516 | qApp->processEvents(); |
534 | } | 517 | } |
535 | 518 | ||
536 | } else { // 16 bit only capabilities | 519 | } else { // 16 bit only capabilities |
537 | 520 | ||
538 | 521 | ||
539 | msg.sprintf("Recording format other"); | 522 | msg.sprintf("Recording format other"); |
540 | qDebug(msg); | 523 | qDebug(msg); |
541 | 524 | ||
542 | signed short sound[512], monoBuffer[512]; | 525 | signed short sound[512], monoBuffer[512]; |
543 | 526 | ||
544 | while(recording) { | 527 | while(recording) { |
545 | 528 | ||
546 | result = read(dsp, sound, 512); // 8192 | 529 | result = read(dsp, sound, 512); // 8192 |
547 | 530 | ||
548 | write(wav, sound, result); | 531 | write(wav, sound, result); |
549 | length += result; | 532 | length += result; |
550 | if(length<0) { | 533 | if(length<0) { |
551 | 534 | ||