author | llornkcor <llornkcor> | 2002-07-29 12:18:47 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-07-29 12:18:47 (UTC) |
commit | b4827a8b268af9d1485455cdf727f564047f396e (patch) (unidiff) | |
tree | e4cfe0063c4130337d46bce247e0430bf37ce70d | |
parent | b79ef334c6d13beb4fe7fff1e6985c081081a2f6 (diff) | |
download | opie-b4827a8b268af9d1485455cdf727f564047f396e.zip opie-b4827a8b268af9d1485455cdf727f564047f396e.tar.gz opie-b4827a8b268af9d1485455cdf727f564047f396e.tar.bz2 |
fix bug number 140
-rw-r--r-- | core/applets/vmemo/vmemo.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp index 035965e..0c792c6 100644 --- a/core/applets/vmemo/vmemo.cpp +++ b/core/applets/vmemo/vmemo.cpp | |||
@@ -479,12 +479,13 @@ int VMemo::openWAV(const char *filename) { | |||
479 | if(!track.open(IO_WriteOnly|IO_Truncate|IO_Raw)) { | 479 | if(!track.open(IO_WriteOnly|IO_Truncate|IO_Raw)) { |
480 | errorMsg=filename; | 480 | errorMsg=filename; |
481 | return -1; | 481 | return -1; |
482 | } | 482 | } |
483 | 483 | ||
484 | wav=track.handle(); | 484 | wav=track.handle(); |
485 | useADPCM = vmCfg.readBoolEntry("use_ADPCM", 0); | ||
485 | 486 | ||
486 | WaveHeader wh; | 487 | WaveHeader wh; |
487 | 488 | ||
488 | wh.main_chunk = RIFF; | 489 | wh.main_chunk = RIFF; |
489 | wh.length=0; | 490 | wh.length=0; |
490 | wh.chunk_type = WAVE; | 491 | wh.chunk_type = WAVE; |
@@ -528,12 +529,13 @@ bool VMemo::record() { | |||
528 | 529 | ||
529 | int bufsize=1024; | 530 | int bufsize=1024; |
530 | int bytesWritten=0; | 531 | int bytesWritten=0; |
531 | signed short sound[1024], monoBuffer[1024]; | 532 | signed short sound[1024], monoBuffer[1024]; |
532 | char abuf[bufsize/2]; | 533 | char abuf[bufsize/2]; |
533 | short sbuf[bufsize]; | 534 | short sbuf[bufsize]; |
535 | useADPCM = vmCfg.readBoolEntry("use_ADPCM", 0); | ||
534 | 536 | ||
535 | while(recording) { | 537 | while(recording) { |
536 | 538 | ||
537 | if(useADPCM) | 539 | if(useADPCM) |
538 | result = read( dsp, sbuf, bufsize); // 8192 | 540 | result = read( dsp, sbuf, bufsize); // 8192 |
539 | else | 541 | else |
@@ -570,13 +572,12 @@ bool VMemo::record() { | |||
570 | // printf("%d\r",length); | 572 | // printf("%d\r",length); |
571 | // fflush(stdout); | 573 | // fflush(stdout); |
572 | qApp->processEvents(); | 574 | qApp->processEvents(); |
573 | } | 575 | } |
574 | // qDebug("file has length of %d lasting %d seconds", | 576 | // qDebug("file has length of %d lasting %d seconds", |
575 | // length, (( length / speed) / channels) / 2 ); | 577 | // length, (( length / speed) / channels) / 2 ); |
576 | // medialplayer states wrong length in secs | ||
577 | // } | 578 | // } |
578 | 579 | ||
579 | //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<// | 580 | //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<// |
580 | 581 | ||
581 | value = length+36; | 582 | value = length+36; |
582 | 583 | ||